ZX81+35 Clone

Discussions about Sinclair ZX80 and ZX81 Hardware
User avatar
1024MAK
Posts: 5534
Joined: Mon Sep 26, 2011 10:56 am
Location: Looking forward to summer in Somerset, UK...
Contact:

Re: ZX81 Clone

Post by 1024MAK »

Ah, it's a emitter follower in the circuit that you are talking about. I should have checked (where's the d'oh smilie when you want it :? ).
Yes, in that case, if you have a low impedance load, more base current should enable better switching performance, as a transistors frequency performance is affected by the current gain. The given maximum frequency is often only at unity gain.

Mark
ZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor Amp

:!: Standby alert :!:
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :!:
Spring approaching...
User avatar
PokeMon
Posts: 2264
Joined: Sat Sep 17, 2011 6:48 pm

Re: ZX81 Clone

Post by PokeMon »

1024MAK wrote:where's the d'oh smilie when you want it :? ).
Maybe this one :shock:
:lol:
User avatar
mahjongg
Posts: 181
Joined: Tue Nov 24, 2015 10:25 pm

Re: ZX81 Clone

Post by mahjongg »

Okay, I implemented PokeMon's recommendations, and I'm happy to say it worked!
The picture quality improved, so now the checkerboard pattern of chr$(8) is crisp, and black letters are quite readable, so I jumpered the picture back to a white picture with black letters, with good result.

That said, when looking at the composite video signal with a digital storage scope, the signal isn't nice at all.
The voltage level of the sync pulses are way too small, about 20% to 30% of what they should be (that is 40% of the voltage range between black and white), in fact the only reason the TV sees a sync pulse at all is that the cync pulse out of the gate has a small glitch, where the first quarter of the pulse goes deeper to ground than the remaining 3/4, and its only that first quarter of the pulse that shows up in the sync signal, so sync pulses are in essence too narrow, just 1/3th of what they should be. In other words, the diode to "short the signal to ground" idea doesn't really work when the sync level is tiny (fraction of a volt). Perhaps it better to invert the sync signal and drive a transistor open to short the video signal to ground during sync. By the way, I have no idea why the gate output behaves this way. Perhaps I should photograph the scope signal.

What also disturbed me somewhat was that I did implement the back-porch, but I see a spike going to the white level right after the end of the back-porch, perhaps I need to extend the back-porch a bit. It does not seem to bother the two TV's I tried. Contrast was good.

Inverted text no longer destabilizes the picture, so that is good too.

I did note that if I printed several checkerboard characters after each other they did not neatly connect up, need to make a picture of that so you can see what I mean.

I will try to change the ratio between R48 and R49 so the sync pulse to video signal ratio becomes larger.
I will order some faster transistors (PMBT2369) too, to try if it makes a noticeable difference.
Perhaps I will replace the gate driving csync with one that has the inverted output, and patch in a (PMBT2369) transistor (with base resistor) to create a more reliable sync signal.
User avatar
RetroTechie
Posts: 379
Joined: Tue Nov 01, 2011 12:16 am
Location: Hengelo, NL
Contact:

Re: ZX81 Clone

Post by RetroTechie »

mahjongg wrote:The voltage level of the sync pulses are way too small, about 20% to 30% of what they should be (that is 40% of the voltage range between black and white), in fact the only reason the TV sees a sync pulse at all is that the cync pulse out of the gate has a small glitch, where the first quarter of the pulse goes deeper to ground than the remaining 3/4, and its only that first quarter of the pulse that shows up in the sync signal, so sync pulses are in essence too narrow, just 1/3th of what they should be. In other words, the diode to "short the signal to ground" idea doesn't really work when the sync level is tiny (fraction of a volt).
Seems that problem occurs because during /CSYNC low, the 'pixel output' (HC00 gate U20.B) should also be low (black level). @ That point video output is already driven to near 0V, so trying to pull it down further doesn't do much.

Fix: replace D13 with a resistor whose value is matched to R48 (roughly double the value), and remove R49 entirely. That way voltage on the base of T8 is a weighed average of [pixel stream] and /CSYNC. With /CSYNC high, output varies between black level and white level. With /CSYNC low, output varies between even-lower sync level, and a 4th voltage level that's not used. Effectively a 2-bit DAC with output voltages chosen to match "sync", "black", "not used" and "white".

Note that with higher-strength (faster) logic outputs, you can do away with the transistor buffer @ that point. Which is simpler, more reliable, and easier to calculate.
User avatar
mahjongg
Posts: 181
Joined: Tue Nov 24, 2015 10:25 pm

Re: ZX81 Clone

Post by mahjongg »

@RetroTechie

I'm not sure I understand your reasoning, during black level the output is NOT driven to near zero, because it only drives the bottom branch of a resistor divider low, so the signal does not go to zero, but to a level defined by the resistor divider.

This is the original video combiner:
[attachment=3]original video combiner.png[/attachment]

This is the modified video combiner with PokeMon's input:
[attachment=2]modified video combiner.png[/attachment]

the /Csync signal attempts to drive the video level further low, but because a diode has a forward voltage that is not zero, the signal does not go to zero either, but the forward voltage above that. With a white background the video level would be high during the sync pulse, so now the diode draws more current than originally, this means the forward voltage increases slightly, and that means the level of the sync pulse goes toward 0V has decreased. My solution would be to replace the diode with a transistor that shorts the video signal to GND.

[attachment=1]modified video combiner with transistor.png[/attachment]

The output of the /CSYNC pulse looks like this:
[attachment=0]CSYNC pulse.png[/attachment]

Only the first part of the pulse goes low enough to affect the current video signal.
Attachments
CSYNC pulse.png
CSYNC pulse.png (2.86 KiB) Viewed 2825 times
modified video combiner with transistor.png
modified video combiner with transistor.png (58.48 KiB) Viewed 2826 times
modified video combiner.png
modified video combiner.png (53.54 KiB) Viewed 2830 times
original video combiner.png
original video combiner.png (46.49 KiB) Viewed 2830 times
User avatar
PokeMon
Posts: 2264
Joined: Sat Sep 17, 2011 6:48 pm

Re: ZX81 Clone

Post by PokeMon »

I would try just using a schottky diode (BAT42 or BAT46 or similar) for D13 which has a significant lower voltage drop than the usual 1N4148 silizium diode (0.3V vs. 0.7V). I didn't inspect your whole video signal generation as I expected it to be tested already and you found the results okay. ;)

The main problem of your circuit is the very high output level (about 4V) which is much over the specification:
1V white level
0.3V black level
0V sync level

This time the 75R resistor takes about 55mA, quite much. There are TVs that could handle it but there are surely lot of (cheaper) TVs having problems with such levels. So your goal should be to get the output level as close as possible to the standard composite levels. And if you have less current due to less voltage at the output, the transistor needs less current in the base which would improve your signal much more. Let me think how this could be done easily ...
User avatar
PokeMon
Posts: 2264
Joined: Sat Sep 17, 2011 6:48 pm

Re: ZX81 Clone

Post by PokeMon »

As a fast solution you could do following:
Connect a zener diode 1.8V from base of T8 to GND (reverse).
This way the maximum base level would be around 1.8V and the output level maximum 1.1V.
I would than choose R49 as 3k3 and R48 as 820R.
U20.B goes low this should give around 0.95V for black level, giving about 0.3 at the output.
And leave D13 as schottky BAT42/BAT46.

This should be a quite good improvement.
Oh shit. The capacitance is too bad of zener diodes - near 100pF for the 1.8V types.

So better try a triple (3x 1N4148 in series) or 2 BAV99 or BAV199 where you connect 3 diodes in series - need less space than 3 1N4148 and instead the zener diode in forward direction. This will limit the maximum voltage to 3*0.65 = 1.95V, something like that. And the 3k3 and 820R resistor and the D13 schottky should do a good job. You have to test it - just in theory. But I am pretty sure the results would be good.

So there are other solutions as well but this would be a minimal invasive operation to your patient. ;)
User avatar
mahjongg
Posts: 181
Joined: Tue Nov 24, 2015 10:25 pm

Re: ZX81 Clone

Post by mahjongg »

Ah yes, you are right, I knew that the output level should be 1V p/p, how could I have missed that!
A 5V p/p drive signal is possibly suitable for a modulator, but much less so for a TV.

Truth is that I copied the video combiner from several other ZX-81 clones, and did not examine that circuit part well enough, and also did not give it enough thought, so its my own fault. Now I understand why these circuits used a potentiometer for R50, a detail I did not copy!

Yeah, using a schottky diode would help somewhat, but I doubt it would be good enough, the sync level would only be 0.3V below the black level, so even if the gate output would go completely to 0.0V. even a schottky diode would not conduct, as its forward voltage is probably larger than 0.3V. The only reason that it is working now is that the black level is also scaled up to 0.8V or so, so the diode manages to make a small impact, during the start of its pulse, when the output goes completely to 0.0V, but not during the 0.2V or so, in the later phase of the pulse.

Also, for signals lower than the base-emitter forward voltage of the BC847, I doubt the emitter follower would even work.
The conclusion seems to be to not lower the scale of the video signal at the base of T8 from 5V p/p to 1/V p/p, but to leave the scale as it is, and divide the signal at the emitter of T8 so we end up with a 1V p/p signal. So R50 should be replaced with a resistor divider.
I will replace D13 with a schottky diode (for now), and split R50 into a lower 47R ,and a top 180R resistor, and increase R48 to say 560R to increase the black level to 1.1V or so, so that the sync step level becomes larger too, and see what the result is.

have to try to keep the patch as simple as possible, as to avoid too much fine pernickety work, with the small SMT parts in a very tiny area.

P.S. Missed Pokemon' s reply while typing this, and initially I thought about a solution like his, but as I said, its better to lower the signal levels after the emitter follower for the reasons explained above.
User avatar
PokeMon
Posts: 2264
Joined: Sat Sep 17, 2011 6:48 pm

Re: ZX81 Clone

Post by PokeMon »

You are right about the base emitter voltage drop with about 0.7V - all values I calculated based on this.

So best would be at base:
0.7V sync level = 0.0V output level
1.0V black level = 0.3V output level
1.7V white level = 1.0V output level

That is why the schottky diode works perfect here as it drops the base to 0.3V or even 0.6V if the driver at the cathode does not exactly switch to 0.0V - so due to the transistor drop this will be definitely 0V at the output. The emitter voltage is just base voltage -0.7V and base voltage below this threshold would be just 0V. It is just an offset.

In fact it would be possible to divide the output signal with two resistors or a trimmer. The main disadvantage is that there is something to adjust and has to be adjusted with a TV connected (75R) and also a waste of power. And the output level depends on the correct termination. Maybe someone connects 2 TV's at the output - okay this maybe theoretical. ;)

But in fact I use it in my ZXmore similar but with fixed dividers. Nothing to adjust. And keep in mind that you need other input level for black (about 1.9V at the base).
User avatar
RetroTechie
Posts: 379
Joined: Tue Nov 01, 2011 12:16 am
Location: Hengelo, NL
Contact:

Re: ZX81 Clone

Post by RetroTechie »

mahjongg wrote:@RetroTechie

I'm not sure I understand your reasoning, during black level the output is NOT driven to near zero, because it only drives the bottom branch of a resistor divider low, so the signal does not go to zero, but to a level defined by the resistor divider.
Ah yes, you're right. :oops: Black level is a little higher than that. If you're pulling that signal low through a diode, one factor is the diode voltage drop. But another factor is the output voltage of the gate driving /CSYNC (74HC1G08 ?). Which is probably near-zero when outputting "0", but not quite. With more current to sink (lower values for R48/R49), this voltage will go up slightly.
PokeMon wrote:I would try just using a schottky diode (BAT42 or BAT46 or similar) for D13 which has a significant lower voltage drop than the usual 1N4148 silizium diode (0.3V vs. 0.7V).
Yeah, I'd try that too. Quick & easy, with an immediate 0.3~0.4V improvement.
mahjongg wrote:Yeah, using a schottky diode would help somewhat, but I doubt it would be good enough, the sync level would only be 0.3V below the black level, so even if the gate output would go completely to 0.0V. even a schottky diode would not conduct, as its forward voltage is probably larger than 0.3V.
Well perhaps you could simply adjust R48/R49 to produce the required voltages at base & output of the transistor. After choosing between Si or Schottky diode for D13. I second PokeMon's suggestion to make sync level correspond with 0V @ the transistor output, with black level around 0.3~0.4V, and white level ~0.7V above that (all with 75 Ohm load on the output).

You could duplicate the output circuit on a breadboard, including a 74HC1G08, HC00, and 75 Ohm load resistor as found in monitor inputs. Adjust component values until DC behavior produces exactly the desired voltages at the 'monitor input'. Then make those changes on the board, and verify full-speed behavior. In any case I'd avoid adding a 2nd transistor. That just makes a circuit that's already more-complicated-than-necessary, even more complicated. Totally against ZX81 philosophy! :lol:
Post Reply