ESP8266 as a Tape Drive

1976 was the year the Apple I was released, one of several computers based on the MOS 6502 chip. MOS itself released the KIM-1 (Keyboard Input Monitor) initially to demonstrate the power of the chip. The single board computer had two connectors on it, one of which could be used for a tape recorder for long-term storage. When [Willem Aandewiel] went to the Apple Museum Nederland in 2016, he saw one and felt nostalgic for his youth. He was able to get a replica, the microKIM, and build it but he wanted to use new technology to interface with this old technology, so he decided to use an ESP8266 as a solid state tape recorder.

One of the reasons the KIM-1 was so popular when it was released was that there was lots of documentation available. [Willem] used this documentation to figure out how the KIM-1 saves data to the recording device. An ATTiny85 is used to decode the pulse stream that the KIM-1 sends when saving because the timing was too tight to both “listen” and decode the bits as well as convert and store them. For loading programs, the data can be sent digitally as 1’s and 0’s to the KIM-1. This means that the ATTiny is only used for decoding and doesn’t have to re-encode the data.  Because of this, saving is slow, but loading is very quick.

To complete the project, [Willem] added four buttons, one each for rewind, record, play and fast-forward, and a screen so you can see which program is currently selected and can go from one program to another. As a nice throwback touch, record and play have to be pressed at the same time when saving. For more 6502 projects, check out this 6502 based DIY computer, or this 6502 built from discrete parts.

24 thoughts on “ESP8266 as a Tape Drive

        1. Yah, you probably don’t want one of the real early ones that saved at low bitrate so they could cram 20 tracks in 32 Megabytes. Think there was some later ones you could record in FLAC.

    1. ADTPro can do this for old Apples, in addition to bootstrapping over serial. There are relatively cheaply available hardware floppy emulators for C64, Atari ST, Apple ][ and older Mac, and even PC style floppy. And of course there are various emulators and converters for SCSI.

  1. Wat? ” because the timing was too tight to both “listen” and decode the bits as well as convert and store them.” .. couldn’t do what any 1mhz or so 8 bit can do in reverse to load off tape??? I can’t imagine their RAM is much faster than modern flash.

    1. Haha, yeah, tape loading was done completely in software on these platforms. That said, it’s one thing to know it’s possible and entirely another to actually get a particular implementation to work. Sometimes it’s a lot easier to go for the less elegant solution and then revisit it later if the motivation is available.

        1. Now that I think about it, you can get away with a comparator on the input side instead of an ADC, and a buffer and resistor divider on the output. To decode, software only has to look at the same bit in each sample and throw away the rest, and to encode software needs to fill the entire sample with all 1s or all 0s. Basically a 1-bit non-oversampled ADC and DAC.

          1. The cassette interface on these systems tended to be very simple. You’re correct–most just used a simple comparator which is why they can be very picky about the input level. The cassette interface on my old Heathkit H-88 was a little more sophisticated in that the FSK was decoded in hardware, but that too was quite simple. The protocol was to record one cycle of the low frequency for 0 and two cycles of the high frequency (which was twice the frequency of the low) for 1. On load it would detect a rising edge and clock the input after a fixed period with a flip-flop. With careful selection of the delay, the input would be low when the signal was a cycle of one frequency and high when the signal was the other frequency.

        2. I don’t see how this would be better than using an ATtiny. It would be harder to implement and the codec chip is most likely harder to come by, needs set up, more expensive than a micro that you probably have in your junk bin anyway.

          A bare comparator on i2s bus.. well.. that would probably work and it would definitely count as a hack ;)

  2. The KIM-1 had a serial I/O, actually an output for use with a Teletype machine if I remember properly.

    So make a paper tape machine, that grabs the serial data and stores to memory, no need to decide and encode tones.

    Cassette tapes were fine for saving files (I did it for five years), but the moment I got a floppy drive, summer of 1984, I never saved to tape after that. I have nostalgia for my KIM-1 and my OSI Superboard, but I have no nostalgia for cassette tapes.

    Michael

      1. The mind boggles at how cheap things became. I paid bout $500 in 1984 for a floppy drive, a controller, a case and power supply. And then spent fifty dollars on a box of ten floppy drives.

        Now floppy drives have no value, but they did become cheap, and then there were so many around that you didn’t need to buy new.

        It was late 1993 when I hot my first hard drive (80 megs), again hundreds of dollars, and now infinitely cheaper with infinitely higher capacity. There was all that talk of solid state drives, but they always trailed, the memory not cheap enough and the programs always getting larger. I have a bunch of USB flash drives that I’m not really using, and together I spent less on them than on that first floppy drive.

        “Kids today don’t know how hard it used to be”.

        Michael

  3. The whole idear of the Solid State Tape device is to keep (bring back) the old feeling I had using my KIM-1. The ESP might be fast enough to do the coding and decoding but it also had to write the bits to the file system. So to let the cheap ATtiny do the decoding the ESP has more than enough time to save the stream and show progress on the display. And YES, you could use a real cassette recorder but not on the microKim (it lacks the hardware for the tape interface). Last but not least: I can record all available KIM software on the ESP (and then some more), including a description of the program and info of the starting address.
    But most important: it is a fun project!
    Willem Aandewiel

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

w

Connecting to %s