Proper Cassettes For Your FPGA Retrocomputer

You can tell the age of someone in our community with a simple question: what were the first removable data storage media you used? Punched cards for the venerable, cassettes for the middle-aged, floppies for the thirtysomethings, Flash cards for the twentysomethings, and maybe even “What’s a removable storage medium?” for the kids brought up on cloud services.  Even with refreshed interest in retrocomputing the cassette hasn’t made a comeback, but maybe that owes something to the hardware. Createing a cassette interface for an FPGA is a task that’s often overlooked, and that’s a project [zpekic] has tackled.

Cassette data recordings are frequency shift keyed, with the 0 and 1 of the binary information represented by different tones. An expected solution to detect these might be to use a Fourier transform, but instead he opts for a simpler solution of counting zero crossings and timing their interval. The resulting stream of data is fed into a UART from which the data itself can be reconstructed. All this is implemented on a Mercury FPGA board which contains a Xilinx Spartan 3A FPGA, but it’s a technique that could be used on other devices too.

So your FPGA retrocomputer deserves an authentic cassette interface, and now it can have one. We’d be especially impressed if all this 2020s wizardry could produce a more stable chuntey field, but we guess that might take a bit more work.

As a final aside, the project is dedicated to the memory of the pioneering Yugoslavian broadcaster [Zoran Modli], whose innovative 1980s radio show featured broadcasts of tape software for the computers of the time including our Hackaday colleague [Voja Antonić]’s Galaksija. Broadcasting software over the radio? That’s a cool hack.

53 thoughts on “Proper Cassettes For Your FPGA Retrocomputer

    1. That took me back!

      Someone will shoot me if I’m wrong but I don’t think the US had teletext: it was a set of 40×25 text pages broadcast during the frame flyback time of analog TV signals, and mainly used for news. You would dial in the page number you wanted on the TV remote and wait for that page’s turn to be transmitted. (Later TV sets seemed to buffer all the pages so it was instant.)

      1. Used for advertising too – I’ve purchased a few holidays through Teletext, back in the olden days. There used to be literally dozens of travel agents advertising on there; as you mention, if you missed their details you had to wait until that page came round again.

      2. If anything like that was tried in the US no doubt it came out 4 years after it was released in Japan, 2 years after Europe. It was only available on cable and via a super expensive addon package offered only in the big cities. And no doubt there were only about 1.5 tv models which supported it and they were something like triple the price of an otherwise comparable tv without that ability.

        And it probably only existed for a year because it hardly had any customers for the obvious reasons above.

        I don’t remember this happening, but that’s pretty much how things go here.

    2. The BBC’s The Computer Programme (or a successor) broadcast software by means of a flashing square on the screen. I think it must have been intended for the BBC Computer to run, with its idiosyncratic Basic interpreter.

    3. In 1984, there was a radio program called Softcast which aired on KXA 770 AM Seattle. It broadcast BASIC programs and games. KXA at that time broadcast off a rooftop T-wire antenna (obsolete by 1930, but still going on KXA in 1984) and in spite of the T-wire and AM signal, it actually worked surprisingly well and a nice blend of vintage and state of the art tech for its time.

  1. Just wondering out loud.

    If a modem can send 56kbps(33kbps?) over a limited bandwidth phone line, I’d imagine a good cassette deck could do much better, x2 for stereo. If one could do say 128kbps x 2, that would be 256kbps, good enough for MP3, Ogg, Opus streaming from tape? Enough to DSP encode a SPDIF signal?

    Frequency response of a good tape is up to 20khz. Phone line is about 3.4khz.

    1. phone line has no wow, no flutter and no problems with unaligned heads. The good tapes are able of 20KHz… but the frequency response isn’t entirely flat. Then there is the simple fact that the tape deck shown in this article most likely can’t handle the tapes that have the perfect boradband and noisless response… blabla tapes might get damaged (wrinkled, eating) blabla… etc.

      But you are right, with modern means the overall tape data speed should be able to go way higher then in “the good old days”. In the end it all comes down to reliability, do you want a tape that maybe loads your file in 1 second instead of 10 but only does so only once (during verify)… but doesn’t load any more 1 year later when you tapedeck broke down and you bought a new (second hand) one with slighly different characteristics. Or do you want a tape that loads ten times slower but works every time in every deck (fortunately, that’s what the chosen in the “good old days”).

      When I bought my first disk drive (1541 and Final Cartridge III to speed things up), I never looked at tapes again. Strangely though that I now seem to like them for nostalgia reasons.

      1. For the use @abeowitz seems to be implying that might not matter. All those failed attempts loading software from a casette at a higher bitrate probably get most of the bits right. But it only takes one bit error to wreck a set of instructions (ok, a bit more if they implemented some sort of CRC) so that’s why your verify step failed. For playing audio (or video) who cares? The error might not even be audible and even if it is it might still be better than a standard analog recording.

    2. what your wondering about has already been done back in the 90’s. Philips DCC used PASC coded audio at 384k/sec. granted they used 9! heads per half of tape instead of 2. you could use regular type II tapes with some modification.

      1. But now we have much better codecs and also digital signalprocessing possibilities. Probably we can do something similar now with standard stereo tape heads. My dream is really having my old tape deck and a tiny box in between the RCA leads and voila have digital audio on tape.

        1. I remember when I would have gladly traded all my cassettes and players for a DVD player even if that DVD player somehow only played with equal sound quality to analog cassette. The difference was random access. Being able to pick any track and play it was way better than fastforward/rewind.

          1. Sure thing that the random access is a benefit. And if I only would look at what is most accessible and easiest to handle I would probably just have the music in flash memory and play it back from there. But I think this will still never beat having music on a media that you can touch and put into your player, while having the media being recordable (in contrast to vinyl) and relatively cheap. If there were 64MB (not Gigabyte) SD cards that I can get for a dollar each or so, that would change things, but these small SD cards tend to just disappear and you can get nothing cheaper right now than like just under 10 bucks for a huge SD card.

          2. or use tapes as singles,
            record the song, then a repeating message to turn over or flip side,
            then on the other side a message to wait for the start of the song,
            and then the song itself again.

            bonus points for shortening the tape length to only fit the song once on each side.

            this brings you the THEORETICAL convienence of a 8-track,
            with the reliability(cough; useability) of a modern cassette.

            the advantage is you can get players free and the motor consumes
            less power then most CD players (execpt portable discmans… expensive)
            dis-advantage is you can NOT let the tapes get wet before inserting,
            the heads will rust and ruin all your precious tapes.

            ive had tapes ruined by rusty heads.

  2. The first media I used were indeed punched cards and C64 – “datasette” cassettes in something like 1982. A few months later I could afford my first own storage device: The 1541 floppy drive.

  3. At some point i had the idea for a FPGA video game console which stores the configuration bitstreams on VHS and uses the video signal directly in the games. But that would be years of development in an absolute development hell just for a novelty.

    BTW: “An expected solution to detect these might be to use a Fourier transform” -bad idea.

      1. The higher rate of 325kBps is enough for some highly compressed but very reasonable quality 1080p video. And that device definitely isn’t the cutting edge of what’s possible. Just for the fun of it, I had the idea of a gadget that would record and play back HD video on VHS tapes using an unmodified or lightly modified VCR. Looks like it’s possible…

  4. There are many possibilities to stoer data in cassette form and there is room for exploration there… what about squeezing the most out of a cassette tape? 8 channel tape heads? 56K modem juice recorded (QPCM encoded data should do the trick)? SDR tricks to store and read data streams at low frequency? So much fun to who has the time…

    1. Yes. I briefly got started on this ending up with pretty reliable 9600 bits per second on each one of the stereo channels as a first start: https://m.youtube.com/watch?v=IJ5VDKV9qbw
      Unfortunately the tape deck broke down and I wasn’t really motivated anymore to continue this on my own (developing in a team is much more fun). I believe that with better error correction coding plus modulation scheme you should be able to push this mich higher. Idea behind my project was to be able to store digital music using a standard tape deck and have a tiny circuit just in between the RCA analog output leads that would convert between digital encoded audio on tape. 32kbit/s could have been enough for some stereo HE-AAC v2 encoded music to begin with. If anyone is interested to work on this let me know.

    2. Hey there!

      Some time ago I started trying this with my tape deck. I got to 9600bps per channel pretty reliably (https://www.youtube.com/watch?v=FkQzJ6LRdTA). Unfortunately my tape deck broke then and I also didn’t really want to continue with this project on my own. I know a lot could have still be done with better modulation and error correction coding. My ultimate goal was to store digital music compressed with HE-AAC v2 at at least 32kbit/s on this normal cassette deck and have a small component between the tape deck’s analog RCA jacks and the amplifier that would convert the digitally stored music back to an analog signal.
      If anybody is interested please check out this: https://github.com/bjoelkrug78/datacassette
      Would love to continue with this. Maybe this can be realized best with an ESP32 and some audio DAC.

      Cheers,
      Berni

    3. Early attempts to record modems using encodings other than simple FSK did not work well. The distortions in a phone line and a tape recording are different.
      The Tarbell cassette interface for S100 computers used biphase encoding like early digital tape drives, but it didn’t work well when run through the audio circuits of a typical tape recorder. It pretty much died out about the time JC Penney stopped selling the one tape recorder that worked well with it.

  5. Starting in 1972? onward my storage ranged in best guess order: PDP-8/I Magnetic core, Punch paper tape, Reel to reel mag tape, Rotating Drum memory, Punch cards, insertible disk cartridges, HP 9830 tape cartridges, Olivetti A6 mag cards, 8″ Floppies, 1702A EPROMs, CDC Falcon drives, , 5-1/4″ Floppies, 3-1/2 Stiffies, Zip disks, Zip “Pocket Zip” micro disks, Zip Jaz drives, and other such ilk.
    Most novel was using a PDP 8-E with link tape as backup for an Apple ][.
    This is only my reminiscing about pre-optical storage.

    What a long strange trip its been.

  6. I think the first removable media I played with was CD.. Floppies were well on the way out and flash yet to really take off… I’ve used Floppies, but pretty sure it was the CD that was first.

    Always wanted to get a reel to reel tape just because its cool to watch, the fact tape is cheap and stores lots if you have modern heads etc is just a cool bonus. Though having full backup images of every system cheaply, its actually got a point.

  7. I definitely remember loading Choplifter with a tape many times. That said, I still muck around with retrocomputing and it is definitely an eye opener to remember the hurdles we used to have to clear to even have a running computer and if not, figure it out without a robust wiki or pdf schematics. I am not really sure what is the major issue here. .wav files work fine, are easy to store, and do not degrade. Heck they can even be cleaned up to provide less errors and more data integrity. Some of the easiest to copy tape loading interfaces will come from the late 80s Yamaha synths. As far as it meshing with his FPGA build, I am not really sure what the holdup is. Just some simple call functions and syncing and a dump to memory are necessary. Oh well I wish them luck so that future generations can listen for the tone and load :)

  8. “You can tell the age of someone in our community with a simple question: what were the first removable data storage media you used? Punched cards for the venerable, cassettes for the middle-aged, floppies for the thirtysomethings”

    Yay! I’m not middle aged!

    And I’m back in my 30s again! I can’t wait to start feeling 10 years younger. Thanks Jenny!

    Oh wait. Or are you saying I’m not in your community. *sob*

  9. Casettes (MSX-1) were my first storage media too, though it didn’t take long to replace them with floppies on an MSX-2, single sided at first, then double sided. Still have the tapes and floppies. Everything is now digitized, scanned cleaned and indexed a few years ago before it deteriorates beyond saving :) It was nice to see one of my first ever programs I’ve written in basic again.
    Writing my own decoding routines was great too, to decode the tapes and also floppies with my own software and hardware interface for the floppies.

  10. When I made a modem, I only needed about 200bps so I used the most naive amplitude-shift keying, just a carrier that is on or off. The demodulator was just an R/C filter, made it look like a regular logic-level serial link to the PIC12 that had to decode it. It would probably stretch my filter design skills (iow, I’d have to google it), but I have the idea for FSK I’d just use a pair of R/C filters and maybe a comparator between their outputs if the filter performance was insufficient.

    I still remember Torvalds’ rant against softmodems in the late 90s :P

    1. Wow, were those horrible to try and support. If I recall they’d try and pass the things off with no real indication that you were buying a soundcard that was informed how to be a modem in software.

      200bps is reasonable. 56k compressed not so much.

    2. 20 years ago I wrote a V23 soft-modem in PIC 16xxx assembler. I also coded up DTMF transmit and receive ( and US payphone nickel tones) in PIC assembler.

      The project was to prove that a simple dial-out device based around an $0.50 PIC 16Fxxx could send messages to another PIC over the POTS.

      My Boss at the time was obsessed with cost reduction, and would not pay for a V23 modem IC as the whole product would have a BOM of about $1. So I had to work out the code to generate DTMF and V23 modem tones in PIC assembler – and get them sufficiently pure and frequency accurate to pass the FCC test requirements.

      Much of these POTS techniques have been lost as ancient history.

  11. In addition to punched cards and paper tape, there were also magnetically coated cards (0.5″ x 3″) used to store programs on an HP-65 hand-held LED-display calculator. And for some mini-computers there were magnetically-coated aluminum disks the size and thickness of a 78-rpm phonograph record in a removable hard shell enclosure.

  12. I started with punch paper tape on a teletype tied to a time share on the local General Electric factory mainframe. Later it was cassette tape on a TRS 80 model 1. I did get to see the last NCR accounting system using CRAM (Card Random Access Memory – magnetic cards ) that wrote data to a 50 bit hard drive platter 1/2 inch thick turning at 300 rpm. To update the account balances it would “read data” from a magstripe on the back of a large ledger sheet inserted into the large printer/adding machine, print the new balance on the ledger and then rewrite the data on the magstripe and the eject the sheet.

  13. I worked on early grocery store scanning systems (Kroger) where the main computer was booted from a digital cassette (TEAC). After tape boot the main program would load from the 20 meg hard drive (12 inch platters) into 12 meg of memory. All data was simultaneously sent to an identical processor/hard drive combination so if the primary failed a switch was thrown (communication reroute) and the secondary was booted from it’s cassette to assume the primary’s role of running the store.

  14. I have used cassette tapes quite a bit when I was young; I’ve lost program, too. They could have been more reliable if they used both tracks like multi-track recorders used, offset the data, and used error correction, such as forward error correction.

  15. Anybody remember the aspirationally-named Exabyte tape drives? A few GB on a little 8mm video tape. Sandwiched between the TK50 and the LTO eras.
    Horrible reliability. I ended up calling them write-only tapes, because you couldn’t depend on reading them again…

  16. Umm, the first removable media I used? I guess it was half-inch 7-track tape. Probably with an IBM model 729 tape drive. For some reason I don’t think of punch cards as “removable storage medium” though of course I used them before I was permitted to use something as advanced as tape. And, yes, you can tell my age by that.

  17. Jenny,

    In the summer of 1984, my college friend and I both had ZX81s, and his room was about 50 feet away across the courtyard of the hall of residence.

    One ZX81 had its “MIC” output connected to an illegal FM wireless bug, and the other had its “EAR” input connected to the headphone socket of a FM “Ghetto Blaster” – tuned to the top end of the FM broadcast band.

    In effect a simple wireless link between the two machines.

    (Students at Bangor were no newcomers to illegal broadcasting – we had a pirate station running every Rag Week.)

    As a quick proof of concept, the sending end was put in an endless SAVE loop, by putting a SAVE statement at the end of the BASIC listing, followed by a GOTO 10.

    The receiving machine was primed with the usual LOAD statement.

    Using the cassette interface in this manner was proven to be a viable means of transferring a BASIC listing from one machine to another.

    I built most of my own wireless bugs, having reverse engineered a few commercial ones. Testing the range involved placing a ticking watch next to the microphone and then taking a walk with an FM receiver, until you could no longer hear the mechanical ticking, the best had about half a mile line of site range.

    In more recent times, I built SAW resonator 433MHz data links and super-regenerative receivers. Range testing often took me quarter of a mile from my home.

  18. Zero-crossings is a simple, but naive method for demodulating FSK. It will have problems in the presence of noise. An FFT would be overkill and not as effective as two bandpass filters. I would use FIR filters but for this application you could probably use IIR.

    FSK is not a spectrally-efficient scheme. You’d probably want to use QAM. You need to set the baud rate to the highest possible depending on the frequency response of the tape, and then, depending on the SNR, which is probably pretty high, you can increase the number of points in the constellation to get the max data rate. A long Reed-Solomon code for error correction would probably work well in the presence of burst errors caused by scratches. Since a tape can’t really can’t encode low frequencies you have to make sure you have a scrambler or you could use a differential encoding scheme.

    I know; coherent demodulation is probably overkill for this project.

    Now this makes me wonder what format is used in data center backup tapes. Maybe something similar.

    I never had to use tapes myself. What a pain.

  19. Well in 1973 in High School my first storage medium (actually input medium) was penciling in bubble cards with Fortran statements in my computer class. Then in Engineering in College I used punched cards to input to the IBM 370, boxes and boxes of them. Misery was tripping and spilling out your cards with your 1500 card program! That’s why people drew a wide black diagonal band on the edge of the cards to help if they got mixed up. Other really worried folks numbered their cards.

    Then it was paper tape on a PDP8. In my final year I built a single board computer based on the 1802. I built a TTY 20 ma interface to a ASR35 Teletype and a cassette interface. Then 5.25 inch floppy disks on my Apple II+ clone followed by the hard case floppies and CDs on the IBM Aptiva PC that I won on a radio contest. After that we’re into the “modern” period with flash drives and the cloud.

    I am planning to build a little display for my grandkids (a few of which are technically oriented) showing computer memory through the decades. I obtained a Russian core memory from eBay to show the earlier period. But no mercury delay line or CRT storage as of yet! :-)

  20. Still looking for people to bring some love to the Pano-Logic Gen 2’s.

    Something along the lines of throwing on a dedicate FTDI bus master to manage the 4 ports without having to pay for a IP core,

    maybe something of having it handle trucked signal analysis with a cluster of 12 similar processors?

    Heck even make it into an uncrackable 10Mbit firewall that uses a Risc-V A emulation but with insane assembly instruction names.

    I have plenty of clear tape, 2 working light scribe CD writers, bunch of sealed light scribable CDs and an itch to make, design, develop my own Qbit quantum computer. One that isn’t behind a fortress or controlled by a 3rd party management engine. And would probably need a trunked array of interconnected FPGAS to recieve and analyze the data.

    Ah well, getting stuck on details I didn’t understand was always something that held me back. Lost in the reeds always caused me lose sight of the forest.

    https://github.com/tomverbeure/panologic-g2

    http://daveland.us/pano-logic-g2-reverse-engineering/

    Anyway the OpenHardware and OpenCores has a huge library of opened IP cores. Even if the good IP cores have been squirreled away it still means one could use other asic chips to add on and enhance its capabilities.

    BTW why didn’t see or say anything the Snapdragon Samsung chip had opened up their MALI GPU designs for hobbyists?

    What will happen with Xilinx now that AMD has gotten a hold of it? Arm Holdings was swallowed by NVIDIA. An easy way to kill future competition of a lower power and smarter OpenCL/OpenML clusterable GPU cores one can see obviously.

    Ah well… what a life.

  21. I always wondered if it could be possible to do cartrige interface for FPGA like MISTer, or connect old drives like Amstrad 3″, or even classic amiga or atari 3,5″. That would be awesome.

Leave a Reply to Jan SteinmanCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.