Saturday, August 3, 2024

Atari XC12 FSK Decoder

     I have a bit of a fascination with tape storage interfaces. They're just an interesting junction between analog and digital. How do you make a computer talk to a cassette? It turns out there are many answers to that question, but here's a quick look at one.

    The Atari "Program Recorder" is a line of cassette storage devices made for their 8-bit range of computers. The last of the line was the XC12 from 1986. It stores data using frequency shift keying that we looked at previously. The two tones required are generated by the computer, but they're decoded by the XC12. How though?

Normalizing

    First the signal is normalized (brought to a consistent volume) by an op-amp with diodes in the feedback path. This is actually a clipping amplifier, as used in distortion pedals.

XC12 Clipper

more reading here

Decoding

    The core of FSK decoding is discerning between the two tones used. In this case we're using 5,327 Hz and 3,995 Hz. Atari took the very analog approach of separating the tones with bandpass filters. The high tone will pass more through the top filter, and less through the bottom filter. The opposite for the low tone. This isn't particularly responsive, nor precise.


    The two filters then feed simple diode-capacitor envelope followers. The idea is to extract the amplitude of each signal, rather than the tones themselves. A good deal of the tone still spills though tough.

XC12 filters

Comparing

    An op-amp setup as a simple comparator is the trick to countering the slop of the filters. We use it to test what filter has a higher amplitude, and the winner dictates the logic level of the output. This means that the output of the filters + envelope followers can get away with being quite messy, so long as the correct one is higher than the other.

    

Cleaning

    Unfortunately, the comparator alone isn't enough to scrub the noise from the filters. They change amplitude rather slowly, meaning they'll sluggishly cross over each other while jittering around. This puts the wrong signal at the higher amplitude, and the comparator will momentarily give the wrong result. A lowpass filter is used to remove these glitches from the comparator's output. Finally a transistor buffers the digital output.



Simulating

    It's always interesting seeing these circuits in action, so I recreated it in falstad. Link here

    For input two oscillators, a clock, and a digital switch are used to generate a signal that toggles between 5,327 Hz and 3,995 Hz. This gets squashed by the clipping circuit and sent to the filters.
    We can see the output of the envelope followers slowly ramping up and down as the frequency changes. We can also see how much of the tones end up in what should be the envelope of each signal.
    Finally we get a square wave out that tracks the original clock used to switched the tones.



No comments:

Post a Comment