Audio storage of programs

Using, learning, programming and modding the Gigatron and anything related.
Forum rules
Be nice.
Post Reply
Posts: 16
Joined: 22 Jun 2018, 14:12

Audio storage of programs

Post by tocksin » 28 Aug 2018, 19:43

With the creation of BASIC, I'm thinking of ways to store and load programs. I'd like to be independent of another computer. I think the best medium is something we have on hand these days - our smart phones. We could do what retrocomputers did and use audio medium to store and load programs. We have the means to store a program by connecting the audio output to the microphone input an hitting record on the phone. Then it's a simple toggling of the audio output in a defined way to encode the data. I think commodore did long and short pulses for zero and one or something.

Loading it back might be a little more difficult. I think commodore read it back by looking at it as a single data input and measuring the timing. I'm thinking the serial data input on the DB9 could be used for this. The only problem is that it only latches with HSYNC, so that might be too slow, but since we can define the output, we could make it slow enough to tolerate a slow readback. And I'm thinking there are low signal levels coming out of the phone even at high volume, but we could put an opamp in front to boost the signal or even overdrive it so we get square pulses. This could solve storing and load programs with maybe one opamp.

Anyone have experience with old tape drives? I do not - just what I've read on the internet.

Posts: 20
Joined: 14 May 2018, 05:46

Re: Audio storage of programs

Post by HGMuller » 18 Sep 2018, 18:20

In the eighties I developed my own 6809-based computer. It also used audio tapes as storage medium, before I developed the controller card for a floppy disk. I had developed my own encoding system, which recorder at 1 KB/sec: the signal changed polarity 8000 times/sec ('clock transitions'), and for 1 bits only there was another polarity change between the clock transitions. So 1 bits were a full cycle of an 8kHz square wave, while 0 bits were a half cycle of a 4kHz square wave. The 8 kHz was well within the bandwidth of audio tape recorders.

The signals were generated by timing loops, flipping the polarity of an output line at the required times, and that output was basically directly fed into the recorder. (There was a resistive divider to get the voltage in the right range.) For input I used an op-amp with a little bit of positive ac feedback, to give it some hysteresis, and some positive feedback for dc to make sure it would always shift its threshold so the output had 50% dutycycle. This connected to a bit of an input port. A program was monitoring that input bit, counting the approximate time interval between transitions to classify them as short or long, and combining them to bits and bytes. The data was stored in blocks of 1KB, with some sync pattern at the start of each block, and a checksum appended to it. It was all pretty simple and minimalistic, but it worked like a charm.

The tapes were difficult to transfer between recoders, however; the magnetic head really needed to have the exact same orientation to not lose the high frequencies. But this was very easy to hear. I had drilled a hole in my tape deck so that I could access the head-adjustment screw with a screw driver from the outside, and when I got a tape from someone else I adjusted the head such that it sounded most crisp.

Something like this:

Code: Select all

                                | |
                                | | R4
         C1                     | |
 from   | |     1/4 LM324        |
 tape --| |--+----+    +----+----+
 deck   | |  |    |    |    |    |
             |    |    |    |   +-+
            +-+  _|____|_  +-+  | |
            | |  \-    +/  | |  | | R3
         R1 | |   \    /   | |  | |
            | |    \  /    | |  +-+
            +-+     \/  R2 +-+   |
             |      |       |   GND
             |      |       |           to
             +------+-------+---------> input 
where R1*C1 is about 100 msec, R3/R4 such that the voltage at the + input is in the center of the sensitivity range of the op-amp (forgot what that was, probably 2V), and R2 about 100 times larger than R3 and R4 in parallel (to get a 50mV hysteresis, which is good for a 500 mV input signal. which a tapedeck typically delivers).

Post Reply