Retromaster’s Electronics Projects

…related to old computers and other assorted stuff…

TFE+ Video Overlay Final

Posted by retromaster on February 22, 2010

Here are the latest (and hopefully final) results of my recent work on video generation for TFE+. Instead of the previous transistor-based video overlay circuitry, I decided to use a 74HC245 instead. When the outputs of the 245 are active (VBL low), the 100 ohm resistors either saturate the analog video (from the Amiga) to bright white (for a high output), or dim it (for a low output). When the outputs are disabled (VBL high), the overlay is effectively disabled, with no significant effect on the video output from the Amiga. I could have extended the previous design to use more transistors for driving all three channels, but using the 245 resulted in a simpler circuit with better signal quality.

In addition to improvements in the driver circuitry, I’ve also worked on the video sync part of the circuit. It is quite stable now, with the sync separation performed on the AVR itself. I’ve used the Input Capture feature of the built-in ATmega timers to detect short (horizontal) and long (vertical) sync pulses. The actual video generation is driven by the timers but sync detection is being performed every frame so that sync is not lost during video mode changes.

The reason why there is a second breadboard to the left has to do with how I’ve had to solve the problem of overlay video flickering. Specifically, even after sync detection was fixed, the video kept jerking right/left by one pixel in a (seemingly) random fashion. The original TFE had a 16MHz clock oscillator on board which is what I was using for the TFE+ video tests. The PAL Amiga I am using has a clock oscillator of 28.37516MHz, from which all video signals are generated. The edge detector in the ATmega uses the input clock to detect changes in the input capture signal (which is the sync signal from the Amiga in this case). It seems that the mismatch in the clock frequencies resulted in the edge detection being late or early by one clock cycle, which eventually resulted in the flicker. The obvious (and simplest) solution was to use the Amiga system clock as the ATmega clock. The Amiga clock had to be divided by two since it is too fast for the ATmega. The clock division circuitry is why I had to add the second breadboard. Normally, a single 74HC78 (J-K flip-flop) would be sufficient, but I did not have any, so I had to use a D flip-flop and an inverter instead for testing.

At this time, I consider the video circuitry complete. There may be some additional work for supporting different NTSC/PAL modes, but I’ll leave that for later. I’ll start working on the keyboard MCU and circuitry as soon as I receive the parts I’ve ordered.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: