CPLD replacement for ZX8301

Nagging hardware related question? Post here!
User avatar
tofro
Font of All Knowledge
Posts: 2723
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: CPLD replacement for ZX8301

Post by tofro »

Nasta wrote:
Why did they not do this right from the start?
There are two main reasons:
1) Decision to use TTL RGB outputs for high resolution, which only makes every one of the RGB lines be either 0 or 1, so that's 8 total color combinations. It should be noted that there were some TTL input monitors with a fourth bit, made for IBM PCs back then, but the price was more than the QL itself.
Oh well, the ZX Spectrum 128 (Toastrack) that they put onto the market shortly after the QL used the same RGB connector, but added a separate line for "BRIGHT". So, they obviously knew how to do it right ;)


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
lliont
Trump Card
Posts: 240
Joined: Sat Nov 22, 2014 9:18 am
Location: Athens, Greece
Contact:

Re: CPLD replacement for ZX8301

Post by lliont »

Nasta wrote:The extra resistors should be connected to the voltage divider before the series capacitor connected between it and the actual RGB pins of the PAL chip. The extra resistor should be connected to the common point of the 8.2k resistor from the RGB signals and 1k resistor to ground, as well as the aforementioned capacitor on the way to the PAL chip RGB input pins. Connecting to the PAL chip pins directly upsets the internals of the chip so the value of the extra resistor and the change in color will not be proportional.
.
This is what I did, I didn't get into details.


lliont
Trump Card
Posts: 240
Joined: Sat Nov 22, 2014 9:18 am
Location: Athens, Greece
Contact:

Re: CPLD replacement for ZX8301

Post by lliont »

Derek_Stewart wrote:Hi

Looks great, is there an updated PCB?
There is the new smd pcb and smd cpld program.

Warning, build this project at your own risk :)
I tested it on 2 issue 5 QL's and 2 cards (qubide clone and micro peripherals floppy controller).
Be careful what pins you will use, they have to be thin (not the common header ones) so not to damage the ULA socket and make good contact.
Also measure the length so that the pcb is just above the ram ics when inserted.
And another thing I have to mention, sometimes QL has to be powered twice to boot correctly but then works well even after reset.
Last edited by lliont on Tue Oct 25, 2022 1:06 pm, edited 2 times in total.


lliont
Trump Card
Posts: 240
Joined: Sat Nov 22, 2014 9:18 am
Location: Athens, Greece
Contact:

Re: CPLD replacement for ZX8301

Post by lliont »

Nasta wrote: Is there an alternative way to do this? In principle yes, by using a pulse width sort of trick. As we know, a pixel in mode 8 is twice the width of a pixel in mode 4. So, when one wants to have half bright or over-bright pixels in mode 8, you could make them half wide. The other half could then be black or white. There is a small problem because depending on what the inactive half is, you get one less color. For instance, if it is black, then all colors will be half bright except of black because half bright black is black :) and if it is white, then all pixels will be overbright except white because whiter white is still white. So, some cleverness would be used to avoid losing one color, then you could also change the halves over in every other row so the half pixel mode looks like a chequerboard stipple. Unfortunately, while this would work for high res color and monochrome monitors, it would produce serious trouble with PAL output, due to pixel pattern interference with the PAL modulation scheme, which is what can easily be seen using a PAL monitor in mode 4 and using chequerboard stipples.
I tried this by inserting white pixels but without alternating the phase at every other line so vertical lines where visible but in a thick enough area it did appeared as a lighter color.
I am going to try the checkerboard thing next.


lliont
Trump Card
Posts: 240
Joined: Sat Nov 22, 2014 9:18 am
Location: Athens, Greece
Contact:

Re: CPLD replacement for ZX8301

Post by lliont »

Nasta wrote: Is there an alternative way to do this? In principle yes, by using a pulse width sort of trick. As we know, a pixel in mode 8 is twice the width of a pixel in mode 4. So, when one wants to have half bright or over-bright pixels in mode 8, you could make them half wide. The other half could then be black or white. There is a small problem because depending on what the inactive half is, you get one less color. For instance, if it is black, then all colors will be half bright except of black because half bright black is black :) and if it is white, then all pixels will be overbright except white because whiter white is still white. So, some cleverness would be used to avoid losing one color, then you could also change the halves over in every other row so the half pixel mode looks like a chequerboard stipple. Unfortunately, while this would work for high res color and monochrome monitors, it would produce serious trouble with PAL output, due to pixel pattern interference with the PAL modulation scheme, which is what can easily be seen using a PAL monitor in mode 4 and using chequerboard stipples.

Dear Nasta here are the results of this method as seen on a LCD screen:

Chekerboard effect with black pixels
ula_i_b.jpg
Chekerboard effect with white pixels
ula_i_w.jpg
One more of composite video on crt
ula_16pal.jpg
Open the images to see them correctly.
The signal from pal composite is of poor quality but that was always bad, nothing to do with the 16 color modification, maybe I need to change caps on the signal path with better ones or filter the supply voltage line better or something.


Nasta
Gold Card
Posts: 447
Joined: Sun Feb 12, 2012 2:02 am
Location: Zapresic, Croatia

Re: CPLD replacement for ZX8301

Post by Nasta »

Excellent work Leon!
The black version looks better to me. The reason why composite will look bad is that the patterning produces a 2.5MHz frequency component which is not well filtered in the PAL coding process (Sinclair used a simplified circuit for the PAL modulation chip which does not filter chroma and luma signals before combining them) and interferes with the coluor modulation. Unfortunately there is not much that could easily be done except replace the PAL modulator chip with a more modern circuit.


User avatar
bwinkel67
QL Wafer Drive
Posts: 1229
Joined: Thu Oct 03, 2019 2:09 am

Re: CPLD replacement for ZX8301

Post by bwinkel67 »

Why does the CRT picture look so different?


lliont
Trump Card
Posts: 240
Joined: Sat Nov 22, 2014 9:18 am
Location: Athens, Greece
Contact:

Re: CPLD replacement for ZX8301

Post by lliont »

bwinkel67 wrote:Why does the CRT picture look so different?
Because it is from the composite output that is produced by analog mixing the fourth bit signal with the RGB bit signals using 3 extra resistors, but If you mean the bar width this is a change I did in the test program.
The LCD is from the unaltered standard QL RGB output and the checker pattern is produced by the cpld ula.


Derek_Stewart
Font of All Knowledge
Posts: 4038
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: CPLD replacement for ZX8301

Post by Derek_Stewart »

lliont wrote:
bwinkel67 wrote:Why does the CRT picture look so different?
Because it is from the composite output that is produced by analog mixing the fourth bit signal with the RGB bit signals using 3 extra resistors, but If you mean the bar width this is a change I did in the test program.
The LCD is from the unaltered standard QL RGB output and the checker pattern is produced by the cpld ula.
Well, I think it looks great, 16 colours on a standard QL, a really excellent achievement.


Regards,

Derek
User avatar
RalfR
Aurora
Posts: 872
Joined: Fri Jun 15, 2018 8:58 pm

Re: CPLD replacement for ZX8301

Post by RalfR »

Whats about the Thor OS, does it work here and can use the colours?


4E75 7000
Post Reply