Sunday, January 20, 2013

Schematics and Binaries for the USB Datasette

As there seems to be interest for the USB Datasette I would like to publish the schematics and the other stuff you need to operate it. The pictures in this blog are rather low res. Please download the package at the bottom for high res versions.

But first....

Disclaimer and Advises

The device is dc coupled to the PC and there is no galvanic isolation. Also the device is dc coupled to your c64, zx spectrum, tapedeck and datasette. Keep in mind that it's possible to have multiple grounds which leads to ground loops. This might destroy your PC, your c64 and other stuff you loved to connect to it.
If something is destroyed by usage with this device I'm not responsible for it! So use it with your mind and at your own risks.
If you want get sure to have no ground loops don't operate it with a grounded PC. Use it with an ungrounded notebook!
Also there is no windows driver at the moment.....
The board is very old and the schematic was reverse engineered just right now. I don't claim that it's totally correct. It should be though......
For me the system worked with every tape image I've tested. But that doesn't means it works with all of them!

Schematics

To build it you need:

1x PIC18F2450
1x Oscillator 48MHz
1x LED Bar with 10 LEDs (not needed but you see that a transmit is going on)
1x 1 PNP transistor (only if you want to use it with a c64 datasette)

1x 3.5mm Jack Port (if you want to connect it to a normal tape deck)
1x female header with 6 pins (optional)
1x male header with 6 pins (optional)
1x switch
1x USB B Port

and of course a few resistors. Please look inside the sheet to decide which one you need as some could be keeped out if you don't want to use a particular feature. The circuit is very variable and you can modify it as you need for your services. The connections to the spectrum are not part of this schematic. But If you are able to build this you will find the pinout. The most important part is the PIC18F2450 which receives the pulses from your PC and transmits them. Then you need a switch to activate the bootloader (if you use one), the oscillator and the USB B port.
The possible connections are offered using two connectors. I differentiated using the gender of the ports to be sure that nothing is connected wrong.
Speaking for the tape signals both ports are the same.
The first is designed for a connection to a tape device and offers the control of the motor and has an input for the sense signal ("PRESS PLAY ON TAPE").
The second is used for a connection to a computer and has a SENSE OUT to tell a c64 that you have pressed play by starting the driver and a MOTOR IN to tell the driver that the c64 wants data.
The LED bar only has one LED active at a time. This way you need only one resistor at the cathode. The light wanders with a speed that correlates to the pulses per second.

Software and Stuff

Click here to download the package.

You need libusb and the program must either be used with root or you have to give a normal user access to the USB devices. You get a linux executable for 32 bit and 64 bit.
If you have problems using the software, possible suggestions or you have found an image that is not usable with this driver please let me know it. I will try to fix that.

Usage 

After plugging the device in lsusb recognises it as:

Bus 006 Device 055: ID 04d8:00ef Microchip Technology, Inc.

If you just run the driver without any parameter you get this little help.

=== Slamy's USB Datasette Userspace Driver === Build 2013-01-20
slamysdatasette <file>.raw    44100 Hz / Unsigned 8 Bit Raw
slamysdatasette <file>.tap    C64 Tape Image
slamysdatasette <file>.tap    ZX Spectrum Tape Image
slamysdatasette <file>.tzx    ZX Spectrum TZX Image
slamysdatasette test[0|1]     Timing Test
           sim                Simulation
           seek <Nummer>      Seeking to a pulse
           nosound            No sound at result
           nosleep            No 5 seconds wait at the begin

To begin with the error messages are german and english mixed. If enough people are interested in a pure english version it of course will be made.
The simulation reads a tape image completly and tells you how much minutes and seconds the image will take to write. Also this tests wether the drive is able to read the image. First simulate, then write ! ;-)
The nosleep parameter is for the usage with a computer as for the tape deck you need to surpass the part of tape that is plastic and not writable. If you know tapes you know what I mean.
You need to use nosound at the moment. The program wants to play a sound if it has finished the dumping process. But the sound I use at the moment is a piece of music I'm not allowed to upload here. Just place a "turricanwin.wav" inside /usr/share/slamysdatasette/ and it will be played...
Also place "castlevanialose.wav" there which is played in case of an error.
The sounds that I recorded from the games for this purpose are the "Turrican 2 Level 1-1 complete sound" and the sound of dying in "Castlevania" for the NES. Just for you to know :3

So that's it. If you like to build it yourself please leave a comment If you had success or not.

2 comments:

  1. Hi,

    thank you very much for the schematics. I will try to build it myself in the next few weeks :)

    best regards

    Harald

    ReplyDelete
    Replies
    1. Hello Harald,

      but please be careful and always think twice. At the moment I'm waiting for the PCBs I've layouted and instantly found a mistake as Read and Write must be cross switched for the connection to the datasette to match the pinout.

      Of course you can also wait for me as I've ordered a few boards. After I've tested them I maybe will sell these at the cost price.

      Delete