miniporch - An AVR-based back-porch

Any discussions related to the creation of new hardware or software for the ZX80 or ZX81
Post Reply
Snial
Posts: 10
Joined: Sun Mar 16, 2014 4:09 pm

miniporch - An AVR-based back-porch

Post by Snial »

Hi folks,

For fun, I've been working on a mini Back-porch circuit based on an AVR Microcontroller (an ATTINY25, but I could have used anything down to an ATTINY13). The concept is simple: using an MCU I should be able to create a fairly intelligent Back-porch that only needs to monitor ULA-pin 16. The code waits for the Video out to go <=2.5v or so (using the Analog Comparator) then, using a pair of transistors switches out the ULA video and switches in its own sync voltage (which is 0V); then after 4.5µs pulls it up to 2.5v to generate black. I use BC548B transistors (or BC547Bs).

Image

Image

It works OK on my ZX81 (which is ULA 2C184), but the other ZX81 I was given in 2014* seems to require very sensitive tuning to generate a black [K] and when I start to type the text switches to white text over grey half way across the screen.

Image

Image

Where do you think is the most likely fault:

1. Modulator? How badly do they age?
2. TV Sensitivity?
3. Bad ULA, the old ZX81 uses a super-early ULA without "Ferranti ULA 2Cxxxx", just the production week: 8119?
4. Inadequate circuit?

https://sites.google.com/site/libby8dev ... #miniPorch

-cheers from Julz

[* I talked about it here: viewtopic.php?f=7&t=95&p=14027#p14027 It turned out to be a faulty Z80 and I was able to get that ZX81 to power up when I replaced it with a Z84C006]
Snial
Posts: 10
Joined: Sun Mar 16, 2014 4:09 pm

Re: miniporch - An AVR-based back-porch

Post by Snial »

Hi folks,

I should correct the description: The concept is simple: using an MCU I should be able to create a fairly intelligent Back-porch that only needs to monitor ULA-pin 16. The code waits for the Video out to go <=2.5v or so (using the Analog Comparator) then, using a pair of transistors switches out the ULA video and switches in its own sync voltage (which is 0V); then after 4.5µs pulls it up to 2.5v to generate black for another 10µs. It then sleeps until 56µs after it saw the Sync voltage.

This should cause miniporch to correctly synchronise with a horizontal sync pulse even though it would probably recognise 'black' as sync, because during the margins, the entire scan will be white and so the 56µs wait (after Sync goes low) will cause it to wake up on the right-hand margin of the screen, skipping all the video data after the top margin.


I use BC548B transistors (or BC547Bs).

-cheers from Julz
User avatar
PokeMon
Posts: 2264
Joined: Sat Sep 17, 2011 6:48 pm

Re: miniporch - An AVR-based back-porch

Post by PokeMon »

I have one original modulator which makes a strange ouput with white chars instead of black on TV (HF) which could have to do with the output of the ULA pin 16. We know that different ULA versions are quite different with output level and there may have been an adaption of the modulator by ALPS when delivering high volumes of customized modulators. Just a guess. But have one here which makes white char with my voltage levels when rebuilding the ZX80CORE.
User avatar
Andy Rea
Posts: 1606
Joined: Fri May 09, 2008 2:48 pm
Location: Planet Earth
Contact:

Re: miniporch - An AVR-based back-porch

Post by Andy Rea »

Hmmm interesting project, if you are using an analog comparator to monitor the video input, maybe it could be possible at first power up to test for high and low threshold, then set the comparator looking for the low threshold ( well just above it ), also i would test the lenght of the pulse and only if it is very close to the expected length of the h sync create a back-porch, then wait approx 50~ uS till you start looking again.

Andy
what's that Smell.... smells like fresh flux and solder fumes...
Moggy
Posts: 3267
Joined: Wed Jun 18, 2008 2:00 pm

Re: miniporch - An AVR-based back-porch

Post by Moggy »

If the ULA only has the date stamp on it it is probably the early 2C158E which will be stamped on the underside of the chip, as to what difference this makes to your project needs a keener mind than mine to work out unfortunately . :oops:
Snial
Posts: 10
Joined: Sun Mar 16, 2014 4:09 pm

Re: miniporch - An AVR-based back-porch

Post by Snial »

Hi Pokemon,
But have one here which makes white char with my voltage levels when rebuilding the ZX80CORE.
Good to know I'm not the only one :-)

Hi andy,
Hmmm interesting project
Thanks :-) !
if you are using an analog comparator to monitor the video input, maybe it could be possible at first power up to test for high and low threshold, then set the comparator looking for the low threshold ( well just above it )
The Internal avr comparator is fairly crude. You can either compare a voltage against 2 or 3 internal references (0v, 1.1v or 2.5v) or use a fixed external voltage for the reference. I use the last option, generating a ref voltage of 5*(2.2/3.7)= 2.97v. Because the top resistor of that voltage is controlled through an output I/o pin I can use the voltage as a reference; use it to generate the 'black' voltage for the back porch and use it to generate my sync voltage (by setting the output pin to 0v).

That means I don't measure the length of the zx81 sync, because as soon as I see a sync voltage I disable the zx81 sync and simultaneously enable my sync voltage for 4.5us.

The ADC can measure a range of voltages, but it's far too slow for measuring sync.

Hi moggy,
If the ULA only has the date stamp on it it is probably the early 2C158E which will be stamped on the underside of the chip, as to what difference this makes
Aaah, so there are earlier ULAs than the standard 3?

-cheers from Julz
Moggy
Posts: 3267
Joined: Wed Jun 18, 2008 2:00 pm

Re: miniporch - An AVR-based back-porch

Post by Moggy »

No ,as far as I'm aware, just the three..2C158E ,2C184E and the 2C210E.

A picture of the top and underside of the early ULA....
Attachments
ULA-2.jpg
ULA-2.jpg (18.91 KiB) Viewed 4242 times
ULA-1.jpg
ULA-1.jpg (19.99 KiB) Viewed 4242 times
Post Reply