Video clips
Hardware projects

The Datassettes

Four Commodore 1530 Datassettes get together to sing a barbershop classic.

Tape storage

The humble Datassette is a cheap digital tape recorder for Commodore home computers. It's slow and unreliable—loading a simple game can take many minutes and sometimes the loading procedure breaks down halfway with an error message, at which point you have to do the whole thing over again. But the device was affordable and the audio cassettes used as storage media were even cheaper, so it was a popular choice for people just starting out with computers.

It works like this: During recording, the tape head creates a small but strong magnetic field while the tape is moving past it at a constant speed. When current passes through the tape head in one direction, the magnetic particles on the tape orient themselves one way, and when current passes in the other direction they orient themselves the other way. During playback no current is driven through the tape head. Instead, as the tape moves, its particles create a weak magnetic field around the tape head. When there's a change in this field—because the particles on the tape are suddenly oriented the other way—a small spike of electric current is induced in the tape head. This spike is sensed and amplified. Thus, the time between polarity swaps during recording corresponds to the time between spikes during playback, and this series of timestamps is used to encode information.

Sound generation

From the above it is clear that the Datassette contains a signal amplifier that can drive current one way or the other through the tape head. But that's very similar to how you would drive a loudspeaker to generate simple square-wave tones. By soldering a couple of wires to the amplifier outputs on the circuit board, I could listen in on the signal that would otherwise be written to tape.

Note that the amplifier output isn't directly connected to the tape head. It is routed via a mechanical switch that is controlled by the Record button. In other words, while the amplifier is always active, its output is mostly left unconnected, and no current is driven through the tape head. As you can see in the video, none of the buttons on the Datassette are pressed down, so the full power of the amplifier is available for driving the speaker.

The Commodore 64 transmits a simple binary on/off signal to control the polarity of the amplifier output. This creates a problem: When we're not playing a tone, the amplifier emits a constant voltage that would push the speaker cone continuously in one direction. This would damage the speaker in the long run, and the customary way of protecting against this is to connect a capacitor in series with the speaker. The capacitor should be relatively large to allow bass frequencies to pass, but it needs to be able to withstand a constant voltage in either direction. Normal electrolytic capacitors are polarized and can't endure a constant voltage in the wrong direction; they overheat and explode. I didn't have a large non-polarized capacitor at hand so I used an old trick: Two 10 µF electrolytic capacitors (visible in the picture) are connected back-to-back, i.e. anode-to-anode or cathode-to-cathode. A constant voltage will charge the correctly-oriented capacitor quickly, so the other capacitor is only exposed to a negative voltage for a brief moment, which is fine. Meanwhile, alternating current can pass through both capacitors. If you use this approach, please be careful and double-check the polarities. The Datassette delivers a relatively weak 5 V TTL signal and my caps are rated for 63 V, but I was still careful to protect eyes and ears when applying power for the first time.

On the software side, I use a timer interrupt to run a piece of code that toggles the output signal. The rate of the timer interrupt determines the pitch of the sound.

Door action

The door or lid of the Datassette is a purely mechanical affair. A small thing-on-a-spring (see picture) keeps the door stable in either a fully-open or fully-closed position, and the Eject button physically pushes the door open from the inside via a mechanical linkage.

I removed the thing-on-a-spring and installed a rubber band to keep the door shut. Then I attached a servo—a kind of motor-and-gearbox module that's typically used in RC cars to steer the front wheels—with double-sided tape. The servo turns an arm that pushes the door open much like the original mechanism.

I had to disconnect the DC motor of the Datassette to make the servo fit. There's a separate 6 V power rail from the Commodore 64 for driving the motor, which came in handy for powering the servo.

The servo also needs to know the desired arm position, and this is communicated by a simple pulse-width-encoded signal. In other words we need to connect a data line from the C64 to the Datassette. But now we have a problem: The only output on the tape connector is the Cassette Write line, and we're already using that for sound generation. However, it just so happens that the signals on the tape connector are wired to bidirectional input/output pins inside the C64. We can repurpose the Cassette Sense line, which normally tells the C64 whether any of the Datassette buttons are pressed, as an output.

Final thoughts

This hack involved cutting a few wires and soldering some new ones inside the Datassette. All of the changes can be reversed and I'm keeping the original parts in a safe place. On the other hand, I have three more Datassettes just sitting on a shelf; they came bundled with second-hand C64s that I've collected over the years.

While Datassettes still have a practical use in salvaging data from old tapes, they are in most respects relics of the past. Unlike floppy-disk drives that are actively used by retrocomputing enthusiasts to this day, most Datassette units have reached their end-of-line—destined to sit and collect dust until they're eventually carried off to some unglamorous electronics recycling facility.

This one decided to be a rock star for a while first.

Posted Friday 13-Oct-2023 09:45

Discuss this page

Disclaimer: I am not responsible for what people (other than myself) write in the forums. Please report any abuse, such as insults, slander, spam and illegal material, and I will take appropriate actions. Don't feed the trolls.

Jag tar inget ansvar för det som skrivs i forumet, förutom mina egna inlägg. Vänligen rapportera alla inlägg som bryter mot reglerna, så ska jag se vad jag kan göra. Som regelbrott räknas till exempel förolämpningar, förtal, spam och olagligt material. Mata inte trålarna.

Anonymous
Mon 16-Oct-2023 11:24
In the sidebar under "Featured pages" where it links to this post, please list it with the link text "Datassettes", to be in line with links to other posts whose title starts with "The", such as https://linusakesson.net/games/the-impossible-bottle/index.php https://linusakesson.net/sixtyforgan/index.php https://linusakesson.net/music/paulimba/index.php .
lft
Linus Åkesson
Mon 16-Oct-2023 12:21
Fixed. Thanks!