ZX80 Cassette interface and drive mechanism

This is the ZX80 cassette interface and drive mechanism page. This page is under construction. Please do not build anything here, until I finish my work.

One of the things that made me decide not to build the PC, was the difficult to find storage system. The storage mechanism of the ZX80/81 is the tape. Ordinary audio tapes and tape players/recorders were used. These can be easily found today very cheap, or you can pull out one from your old tape recorder. Quality of recording and reproduction does not matter and you may use the cheapest tape you can find. Originally, this type of equipment loaded the software from ordinary tapes. I wondered, why should I use the big tapes for this purpose? There is a much smaller and niftier alternative, the micro cassette, which is much cheaper and easier to find than mini-cassette and pico-cassette, so I could use this instead. Stereo recording and playback is not used for this application so the micro-cassette seems fine. Micro cassette recorders can be also found at even lower prices. Again, do not buy an expensive one, just the cheapest you can find as long as it has an audio input and output plug. Personally, I did not want to just use a micro cassette recorder to do the job, I actually wanted to build the thing from scratch. Also, my micro-cassette recorder did not have an audio input plug, so I took out it's mechanical part and I decided to replace its electronics part with another homebrew design.

These cheap portable micro-cassette recorders are all mechanically controlled. If you use them as internal computer drives, attached to the computer box, you have to manually press the play, rec, rewind and stop buttons. So you have to place them in a position in the box where the top buttons can be easily accessed. If you want a tape loading system that is electronically controlled you have to find a micro-cassette drive that uses a motor to control these buttons. This is a very promising Idea as you could control the drive by the press of an electronic switch that is located in any place you like, or you could use software (computer or microcontroller) to control it and do some very sophisticated things like tape indexing. I was looking for such a drive for this and some of my other projects. I could find no portable such drives until I saw these so called micro-cassette transcribers like Sony M-2000. These have tape drives that can be electronically controlled. Their price is much more than ordinary mechanically controlled drives though. The cheapest I could find at the time was $60 including postage, whereas a mechanical drive would cost me $15-$20, but I decided that it would worth it to play around. Until I have a more complete solution for the electronically controlled drive, I will stick with the cheap mechanical one.

Another idea I had was to use an ordinary stereo cassette recorder and use only one channel each time. By switching the tape amplifier between right and left channels I could double the cassette capacity by storing information on the left channel, whereas previously recorded information might have been stored at the right one. This could be implemented using micro-cassette too, if you can find one of these rare stereo micro-cassette recorders. For the time being I will use the cheap mono micro-cassette as the main internal drive, as these tapes are much cheaper than a stereo micro-cassette recorder.

Another idea would be to add an extra audio jack or better two extra audio jacks, in order to add an external audio cassette recorder. This external recorder could be connected to the internal tape amplifier by having it's audio signal attenuated first such as not to load the internal amplifier. A switch could be used to switch between internal and external tape drive. Then you can have the internal mono micro-cassette drive and another external stereo ordinary cassette drive switched to the same amplifier. Another switch could be used to switch between external tape drive right and left channels. But this is just the beginning of the possibilities. You may choose not to include a tape drive at all. Because data is written in audio tones, by adding these external audio jacks you could be able to read and write your programs to any external device, like your computer, your mini disc, etc. The reason for passing all these devices signals (high level and low level signals) from the same internal amplifier (using suitable attenuators) is to compensate for the differences in audio levels from different sources. The very low level signals will especially benefit from this extra amplification.

A more extreme approach would be to use the tape audio to modulate a radio transmitter, so you would be able to transmit the program data wirelessly! Then you could receive transmitted data by recording the audio from a receiver to the tape. This is very fun for a radio amateur like me. And you can do more sophisticated things. There is already an RF transmitter onboard, the TV modulator, so you can use this as an RF signal source for the wireless part. Since it is a harmonics oscillator you may use any of the harmonics for data transfer. Some harmonics are used for the TV signal but the oscillator signals are going as low as 25MHZ or even less dependent on the crystal used, so even shortwave could be used for data transfer, to transfer data in great distances by the addition of a small amplifier and proper RF filtering. The TV modulator has to be modified though to allow not only video, but also audio to pass through the RF. This has the advantage that you can send also your audio through the RF cable to your TV, not only the video. But this is quite tricky in a harmonics oscillator, as the FM audio deviation may be different from the fundamental frequency to it's harmonics. A possible solution would be a combination of a switch and two deviation potentiometers, one for the TV FM and another for the desired data transmitting frequency. The data transmitting frequency deviation could not work simultaneously with the TV FM so this switch is needed to choose one or the other. Alternatively, only one frequency, the TV FM, could be used for data transmission. But in a modified TV modulator, there is also the 5.5MHz FM modulated oscillator, which is modulated by the audio signal. This 5.5MHZ signal could be used for data transmission instead and if this is the case then the transmitted FM will be completely isolated from the TV modulator. Some portion of the 5.5MHz FM modulated signal will be used for the TV modulator and some other for data transmission. Data transmission does not affect the operation of the TV modulator in this case. In this case, when you load a tape to the computer the 5.5MHz modulator will transmit this audio and at the same time this audio is transmitted through the TV modulator to the TV. Thus, you will hear the audio tones on your TV as well during data transmission.  But these are all thoughts and have to be tested practically.

Yet another idea I had, was to add sound to the zx80/81, as this would be much fun when playing games on it! This does not go through the logic (there are some projects out there for this) but through the loading mechanism. Let me explain this, taking as an example an ordinary 60 minutes micro-cassette with a game written on it. I am quite sure the game only consumes a small amount of the tape at its beginning. All the rest of the tape can be used for other programs, but since the tape roll mechanism is not good for finding the beginning of each program (it is like trying to find the beginning of a song on a tape), practically I think each tape contains just one program, or two, one on each side. When you want to load the program again you just have to roll back the tape at the beginning which is much easier than searching for this program. Assuming this, all the rest of the tape can be used for adding music. The scenario goes like this: Roll back the tape from the beginning. When prompted by the computer, load the game. When the game is loaded, press a relevant switch to guide the audio not to the computer but to the external audio jack. Then you will play the game enjoying your favorite music.

The tape that contains the game must be recorded like this: Record the data of the game and then leave a few seconds of unrecorded tape. Then record your favorite music on the rest of the tape. Easy isn't it? This audio mechanism is not produced digitally by the computer but it is like playing a game and listening to music with two different machines. This is just a way to have one machine doing both by recording your tapes accordingly. The advantage is that the result is the same as playing a game that includes it's own music, the game and the music are included on the same tape. Another advantage is that you do not consume the one and only expansion port of the zx80/81 so you can use it to add more memory for your games. If you are like me, you may want to write your own music for the game you have created. This mechanism does not require any effort to embed it in the software, the music is independent of the game but it is yet contained in the same tape. Of course this music is not interactive with the game anymore but the advantage of this is that it does not consume any CPU or RAM resources from the system at all.

I was looking for a single chip magnetic tape head amplifier circuit and I found the Dick Smith System 80 computer amplifier with a single LM324. Click the image below for a larger version. The level meter circuit (from C9 and to the left) can be omitted, as it is of no real use here. I also removed the erase head circuit because my recorder included a erasing head with a permanent magnet, which did not require any voltage applied to it. If your recorder has an active erasing head you may keep this circuit.

The motor of my micro-cassette recorder required 40mA at 1.2v to work at normal speed. I found the motor speed quite critical to voltage variations, so I have decided to drive it with a LM317L to provide a relatively stable output voltage with a wide range of input voltages. I will post this simple schematic soon.

Paul Farrow was very kind to provide me some information from the web about the ZX80/ZX81 cassette file format. This information is very useful and I present it below.

ZX81 Cassette File Structure
x seconds    your voice, saying "filename" (optional)
x seconds    video noise
5 seconds    silence
1-127 bytes  filename (bit7 set in last char)
LEN bytes    data, loaded to address 4009h, LEN=(4014h)-4009h.
1 pulse      video retrace signal (only if display was enabled)
x seconds    silence / video noise

The data field contains the system area, the basic program, the video memory, and VARS area.

ZX80 Cassette File Structure
x seconds    your voice, saying "filename" (optional)
x seconds    video noise
5 seconds    silence
LEN bytes    data, loaded to address 4000h, LEN=(400Ah)-4000h.
x seconds    silence / video noise

ZX80 files do not have filenames, and video memory is not included in the file.

File End
For both ZX80 and ZX81 the file end is calculated as shown above. In either case, the last byte of a (clean) file should be 80h (ie. the last byte of the VARS area), not followed by any further signals except eventually video noise.

Bits and Bytes
Each byte consists of 8 bits (MSB first) without any start and stop bits, directly followed by the next byte. A "0" bit consists of four high pulses, a "1" bit of nine pulses, either one followed by a silence period.
  0:  /\/\/\/\________
  1:  /\/\/\/\/\/\/\/\/\________

Each pulse is split into a 150us High period, and 150us Low period. The duration of the silence between each bit is 1300us. The baud rate is thus 400 bps (for a "0" filled area) down to 250 bps (for a "1" filled area). Average medium transfer rate is approx. 307 bps (38 bytes/sec) for files that contain 50% of "0" and "1" bits each.