Wednesday, January 2, 2013

Slamy's USB Datasette

Let's have a look at the USB Datasette I've made about 2 years ago if I remember correctly. The purpose of this device is the writeback of legacy tape images to real tapes.
The device itself
The device is constructed using some stripboard and a PIC 18F2450. The nice thing about this PIC is that it has a complete USB device controller that has a lot more features than your average "ftdi to uart"-solution.

A linux driver was built which is able to read spectrum (.TZX and .TAP), c64 (.TAP) and cpc (.CDT) tape images. It interprets the images and extracts the pulses that are used to encode the data. The length of these pulses are transfered to the pic using libusb and interrupt transfers. The program inside the microcontroller puts these inside a fifo and gives the resulting signal to the output.
The whole kit
The device offers three connectors as seen in the first picture above.

The  left pin header next to the oscillator is used to connect to a tape
device. First a cable for the c64 datasette and then one that can be used for the internal drive of a zx spectrum +2A.

The female connector right next to it is used for a connection to a computer itself. It can be used for connecting a c64 and the internal header inside the +2A. The driver is also capable of stopping the playing process if the c64 disables the motor signal. In this case it operates as a tape emulator.

The last connector is your average line out but with reduced volume as it has to be connected the mic port of an tape recorder used for external connection to the cpc and the spectrum.

Let's have a look at some example photos.

Connected to a tape recorder

Connected to a C64c

Connected to a C64 datasette

Connected to a ZX Spectrum +2A and it's internal drive
A few words to the last picture: The Spectrum +2A doesn't offer the possibility to connect an external tape recorder like it was done with the 48k and the 128k. There exists a hack. But its a destructive one so i didn't used it. I've built myself a cable to extend the internal tape header to move it to the outside of the spectrum. This way I can connect the mainboard to the internal tape drive or an external source without opening it. Look at the photo as you can see both connectors hanging out.

Also as you can see there is a selfbuilt kempston interface as the "sinclair joystick ports" are pretty unusable if you don't own... sinclair joysticks ....
also the most games can handle kempston joysticks.

So this was everything I wanted to tell about this device, i guess. It took a few weeks to develop as a lot effort went into the linux driver. I don't know if its possible to port it to windows. The driver was written mainly in ANSI C so the only problem might be the part interfacing with libusb.

It's a very useful device and I've managed to write a few games using it. Of course these are official versions with copy protection and unmodified. I remember one game that my driver couldn't handle. It was a .CDT image with raw audio data inside. But that only happened once and an image like this is not very common.


  1. This looks very nice!

    But please can you post a schematic diagram with all parts and also the driver?


    1. It's nice that someone is interested. Please wait a little bit. The next post will be about the schematics and the stuff you need.

  2. And where is this new post including circuit and firmware?

    1. Hey there. Thank you for you comment. Sorry for my late answer. January 2013 i've made a post about that.

  3. And where is this new post including circuit and firmware?

    1. I've also eagle design files for etched PCB. I upload them if you need them.

    2. If you could, please upload it and please give us some link to it. It would be really great. Or maybe you have some PCB's to sell them?

    3. Hello Mariusz. Thanks for your interest.
      I have in fact two remaining PCBs for selling.
      As they were done at PCBpool they were quite expensive.
      I would give away a PCB (without components!) for 20€. One costed 30€ but i at least get rid of the remaining....

      But if this is too expensive for you reply again please.
      I will post the files then for you to etch yourself.