digital Tape Recorder for the KIM-1 (and clones)

Dirk’s modification

[ 994 views ]
In October 2017 I wrote a post with the title “Solid State Tape Device for the (micro)KIM“. Recently one of the makers (Dirk Dral) wanted to adapt the device for use with a genuine KIM-1 and ran into some problems.
His questions triggered me to pickup my microKIM and wonder what I could do to improve the design and the firmware. In the end Dirk came up with an as brilliant as simple modification for the KIM-1 himself but I already made a shortlist of the firmware improvements for version 2.0.

What the first design definitely misses is an easy way to upload and download programs from the SSTD to a computer. So that was put on the shortlist.
An easy way to work with the microKIM is by connecting the microKIM with a TTY cable to your desktop computer and then, a logical next step is to also operate the SSTD with your computer. Using a browser is the obvious choice.

KIM connected to TTY (left) and SSTD-GUI (right)

In the mean time I also designed a 32 kb memory card for the microKIM (see this post) and using both the SSTD ánd the 32kb memory card makes sense. I designed a PCB for the SSTD that could be used directly on the microKIM or in conjunction with the memory card. As firmware is fluid and I was confident that rewriting the firmware would result in a working SSTD I sent the PCB designs to JLCPCB and started to work on the firmware.

Then I received an email from Dirk.
He had experienced errors while writing large programs to de SSTD. As it turned out the SSTD could only (reliable) save short programs. I never noticed that because I only have the (short) programs out of “The First Book of Kim”.

After investigating this I discovered a big design flaw in the original SSTD setup.
The SSTD consists of two processors. An ATtiny85 that extracts the bits out of the pulse-train from the microKIM. The bits (ones and zeroes) are then send to the ESP8266 who (left) shifts them into a byte and then the byte is written to SPIFFS as two ASCII chars (one byte is split into two nibbles and the binary value of these nibbles is converted to ASCII chars [0-9 and A-F]).


Bits arrive at a pace of 1 bit every 7 milli second.

After every 8 bits (approx. 60 milli seconds) two bytes are written to SPIFFS. That goes well for a while but eventually it takes more than 7 milli seconds to write to SPIFFS and then de ESP8266 misses one or more bits. From then on all the bits received are out of sync. To make things worse SPIFFS is depreciated and the replacement LittleFS is faster at reading from flash but slower on writing to flash ..

The solution is elegant and simple: Let the ATtiny combine the bits to chars and send the chars over Serial to the ESP8266. The ESP8266 now have approx. 60 milli seconds to write the bytes (and in the worse case the UART has a buffer so the ESP8266 can catch up later). So far so good.
For the prove of concept I tested the PLL firmware on an Arduino UNO and it worked flawlessly. As the ATtiny85 does not have a hardware UART I used a Software UART as implemented by the great “ATtinyCore” by Spence Konde. Albeit to no avail as the Software Serial implementation is of course interrupt driven .. and so is the detection of bits in the pulse train. And the two do not nicely live next to one another. After consultation with Spence I realised it needs an AVR processor with a hardware UART. The smallest ATtiny I have experience with that has a hardware UART is the ATtiny841. But that comes in a 16 pin package and is not pin compatible with the (8 pin) ATtiny85. So my first PCB design is useless and I have to make a new PCB for the SSTD.
Which I did.

The new and improved 2.0 version of the hardware and firmware (that now is called “digital Tape Recorder” or “dTR”) imbeds a webserver that you can access via your browser (you can also access the dTR with telnet). It presents the same interface and information as the OLED display on the dTR and then some more.

In every slot (program ID in hex) you can save a Program file (with the extension “.hex”), a Description (with the extension “.txt”) an Assembler listing (with the extension “.asm”) and a Paper tape listing in MOS Tech. format (with the extension “.ptp”).

Building the digital Tape Recorder kit

With the help of Dirk Dral the digital Tape Recorder can now also be used with a genuine KIM-1 (because PB7 of U2 is not on any of the extension connectors you do have to solder a wire on the KIM-1 to use the dTR).

The red vertical wire on the first image is PB7 (it’s the blue/green wire on the other images)

The digital Tape Recorder (ADW1710) is a great add-on for the microKIM and for the genuine KIM-1. You can plug it on the microKIM extension connector or you can use it in combination with the 32kb memory card (ADW2101). The memory card plugs in the extension connector and the digital Tape Recorder plugs in to the memory card.

With 32kb extra memory it gives your microKIM all the power you can ask for!!

The Schematic for the digital Tape Recorder

The 2.0 firmware is hosted on github.
Total costs for building this device is approx. € 35,40 (including PCB, OLED display and headers). Be aware: due to the limited space most of the parts are SMD.

This entry was posted in Arduino, Computer, ESP8266, Firmware, Hardware, KiCAD, KIM, Uncategorised, WiFi and tagged , , , , . Bookmark the permalink.

6 Responses to digital Tape Recorder for the KIM-1 (and clones)

  1. Nils Andreas says:

    Just wow.!!11 This is amazing and exactly what I am searching for. sadly my smd solder skills are non existant. I will have to wait until someone offers it as a kit or presoldered.

    • Willem Aandewiel says:

      Hi Nils,

      Nice you like it.
      As a kit you still have to solder 😉
      I can make one “pre soldered” for you if you want. I send you a PM.

  2. Hi Willem!

    I’m a woodworker currently in a maker competition with the theme “iconic movie props”. I am building a Talkboy from the movie Home Alone 2 and would love to get it functional to digitally tape record. Can you help me out??

    Thanks in advance!
    -Justin

    • Willem Aandewiel says:

      Hi Justin,

      What would you like the dTR to do?

      It is not usable for audio recording/playing.

  3. webdoktor says:

    Willem was so kind to build one of this cool devices for me and what shall I say: it’s the perfect add on for any Kim-1, Pal-1, micro-kim or other kim-clone.
    Loading and saving from the KIM-1 on the dTR’s ESP microcontroller works like a charme, the Webinterface intuitive, and the shiny blue LEDisplay gives you all information you need.
    Here is a little video that demonstrates the usage.

    Thank you for the idea, the brilliant implementation and your support in the first days.

    • Willem Aandewiel says:

      The webdokter is too kind!
      He asked me to build a dTR for him because his smd soldering skills are a bit rusty. So I did.
      But than he had to figure out why the device did not work! It seems I did not solder the ATtiny correct on the board (one pin was not connected) and so he had to upgrade his smd soldering skills after all.
      Glad it worked out!

Leave a Reply to Willem Aandewiel Cancel reply

Your email address will not be published. Required fields are marked *

The maximum upload file size: 4 MB. You can upload: image, other. Links to YouTube, Facebook, Twitter and other services inserted in the comment text will be automatically embedded.

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