I've been on a major trawl for information about the signal characteristics of audio cassette tapes and their players. There's still a few being made, so obtaining one to modify for experimental purposes is not out of the question.
This revealed, among other things, a fundamental difference between a cassette player intended for audio use (as was often connected to a BBC Micro or ZX Spectrum), and one specifically customised for data storage (as was supplied for use with a C64). In essence, you can get a much crisper square wave signal and much simpler recording electronics if you forego all the subtlety of getting a good-quality audio signal - and working with EFM signals is likely to be more sensitive to edge timing than the average CUTS-like format.
But the C64 Datasette electronics also seem a bit inadequate to the task, as they're only designed to reliably reproduce falling edges of a signal - they're evidently also designed around a 1980s quad op-amp, long obsolete and with very underwhelming intrinsic performance. I simulated it in LTspice, after some tribulations, and discovered that it was so fragile that, at low enough input levels, the output Schmitt trigger could end up responding to the rebound from the read pulse, rather than the pulse itself, and this resulted in the square wave output having the opposite polarity to that intended!
The process of tape recording followed by playback results in a differentiated version of the recorded signal showing up at the read head. It's easy enough to lay down a square wave by just driving the record head with logic voltage through a suitable matching impedance; what is then read back is, however, a train of pulses at the edges. To turn that back into a square wave requires an integrating pre-amplifier, which the Datasette doesn't have; instead they have apparently just grafted a Schmitt trigger stage onto the end of an audio amplifier chain. Implementing the correct approach around a modern quad op-amp seems to produce more reliable results - at least in simulation - with sufficient timing accuracy to recover the EFM signal I have in mind. There are likely to be confounding factors I haven't encountered yet, but until I have real hardware to play with, I'm adequately satisfied.
It'd be great to rig up the tape transport so that it can autonomously engage and retract the heads, and seek forward and backward, under computer control. It's something that 1980s micros didn't have, but which was quite normal on bigger computers. But since tape transports have a lot of dependence on mechanical components and the hi-fi units with "logic controlled" transports are still fetching relatively high prices on the second-hand market, that's an idea which might have to wait. Still, one option would be to remove the latch from the "piano keys" assembly and drive the latter with servos.
On the digital side, I've also been sketching out ideas for how to build the clock recovery and sampling logic needed to work with EFM. Importantly, I think I can use the same logic for both floppy and tape, just with a different input pre-conditioning stage for each, and an extra 64-stage clock divider before the tape side. I may also leave in a way to sample the raw transition intervals, as in the original design idea, and just not plan for that to be the primary method of interfacing.
I've been looking into FEC as well, as encountering errors on magnetic media will eventually be inevitable. That'll be software, not hardware, and I expect that recovering from an error will be a relatively slow (but infrequent) operation. Hamming codes look easy, but not very powerful. Convolution codes are powerful and relatively easy to understand, but very costly in overhead and need to be decoded even when there aren't any errors to correct. Reed-Solomon is much more powerful, but wading through the maths involved is giving me a headache. The tutorial I'm reading now is a NASA document…
|