Viable cassette ideas

346 views
Skip to first unread message

James Taylor

unread,
Mar 11, 2021, 9:42:18 PM3/11/21
to RC2014-Z80
Hello all!

Early this week I got my hands on and built a Zed Pro. It's everything I was hoping it would be and just itching for projects. :)

It seems like the idea of a cassette interface card has gotten thrown around a number of times over the years, but I imagine the demand has been so low that even when they're successfully made, no one sells them.


Well, I want to give making one a try, because I like tapes. And so the descent down the rabbit hole begins.

Here's the rough outline in my head so far:

2. Make an external clock for the dual clock module that runs around 19.2 kHz for a baud rate close to 300 bps.
3. Interface that with the second serial port on the dual serial card.
4. Connect the cassette interface to the second serial port.
5. Send and receive files with the cassette recorder, using PIP on the CP/M side with PUN and PTR.


... But I have to wonder if that's barking up the right tree. 

Maybe there is a better way, maybe it won't work as described. Since I'm just taking my first steps into CP/M and interfacing with cassettes (though not into software and retrocomputing more generally), it is hard to know. Research is turning up enough information that it is hard to know what is "right".

Any pointers would be greatly appreciated.

With best regards,
James

Mark T

unread,
Mar 12, 2021, 2:19:11 PM3/12/21
to RC2014-Z80
Interesting idea to try and run a cassette interface from cpm, but I don’t think anyone ever used cassettes once they had a floppy system that could run cpm.

You might want to take a look at some of the magazines from about 1977 to 1979, I have a list of references to interesting cassette interfaces, if I can find it again I’ll add to this thread.

I would split cassette interfaces into three main groups.

Recording tones using an ordinary cassette recorder. This could use different frequencies for 0 and 1, tone or no tone for 0 or 1, or long or short burst for 0 or 1. The early CUTS or Kansas city format would be in this category.

Recording digital data direct to the tape, most common example would be the commodore pet/c64 datasette, though this still used a mechanical switch for read and write.  There was also the phillips MDCR but it was almost as cheap to get a floppy drive.

Then there is the Tarbell cassette interface that recorded digital data using an ordinary analog cassette recorder, using pulses with FM coding, similar to early floppy drives, and recovering this through the audio output of the cassette player.

There are a few cassette deck mechanisms available from ebay for car cassette replacement that might be interesting to allow digital tape control. Auto reverse decks are available that might allow random read/write of blocks of data, though these don’t usually include an erase head.

I’m still trying to construct a digital cassette deck. Plan is to drive the cassette only from the spools, no capstan. Separate motor for each spool with a pwm motor control sensing the voltage of both motors for a constant sum of the voltage of both motors. Then using an auto reverse cassette head to read or write data to four separate tracks. This would need to use an FM digital type coding system to try and eliminate some of the timing variation due to a lack of a capstan. It might not need an erase head if saturation recording is used. It might even be possible to read data from the tape in both directions. There will be lots of problems to solve, should be quite fun.

Alan Cox

unread,
Mar 12, 2021, 9:13:45 PM3/12/21
to rc201...@googlegroups.com
On Fri, 12 Mar 2021 at 19:19, Mark T <mark...@gmail.com> wrote:
Interesting idea to try and run a cassette interface from cpm, but I don’t think anyone ever used cassettes once they had a floppy system that could run cpm.

The Epson PX-4 series systems could use the dictaphone style tape with CP/M. Floppy drives at the time were simply too bulky for a portable.

It's possible to bridge between a tape deck (or sound card ;)) and digital I/O with fairly simple logic. The ZX spectrum is little more than a few passives and a zener diode but could do 1500 bps to an ordinary tape deck by default and if the tape was bulk mastered properly nearer 3000bps.

A fancier tape to 5v design can be found here:


The rest of the logic is fairly simple. You generate a burst of fixed tone, then square waves at two frequencies whose primary component is within tape audio range. On read back you latch on the fixed tone then when it changes you measure the length of the 1 and 0 ranges.

It was possible to get much higher data rates with a digital tape interface. The reel to reel ones also combined that with more complex encoding schemes such as 4bit GCR. In theory some of that might work on a tape deck but would probably be quite tricky code.

Alan

James Taylor

unread,
Mar 12, 2021, 10:33:05 PM3/12/21
to RC2014-Z80
From what I can tell, you're correct about cassette storage falling out of favor by the time of floppies with CP/M. The exceptions are few, and CP/M's interface is for a paper tape reader. But of course, lacking a paper tape punch and wanting to try out a cassette module, the idea would be to make the machine think it's talking to a paper tape punch (or any other slow serial device, really). 

I really appreciate the overview of cassette systems. It's quite a stunning number of ideas to accomplish the same task. I've been thinking the best thing to do is start as simple as possible, in spite of any limitations that may have. If it works, then it may be worth doing something more sophisticated, particularly if that means greater tolerance for noise and other issues. In the meantime, there's some fruitful research to be done from those leads.

Those magazine references would be fantastic, if you can find them! Thanks in advance. 

James Taylor

unread,
Mar 12, 2021, 10:44:00 PM3/12/21
to RC2014-Z80
It's possible to bridge between a tape deck (or sound card ;)) and digital I/O with fairly simple logic. The ZX spectrum is little more than a few passives and a zener diode but could do 1500 bps to an ordinary tape deck by default and if the tape was bulk mastered properly nearer 3000bps. 

Not speeds I'd complain about, that's for certain. And without worrying about a UART, too.

A fancier tape to 5v design can be found here:


The rest of the logic is fairly simple. You generate a burst of fixed tone, then square waves at two frequencies whose primary component is within tape audio range. On read back you latch on the fixed tone then when it changes you measure the length of the 1 and 0 ranges.

Oooh, now there's an idea. Doesn't look like it would be too hard to modify for use with the RC2014. Thank you! 

Alan Cox

unread,
Mar 13, 2021, 10:48:37 AM3/13/21
to rc201...@googlegroups.com
On Sat, 13 Mar 2021 at 03:33, James Taylor <virtual...@gmail.com> wrote:
From what I can tell, you're correct about cassette storage falling out of favor by the time of floppies with CP/M. The exceptions are few, and CP/M's interface is for a paper tape reader. But of course, lacking a paper tape punch and wanting to try out a cassette module, the idea would be to make the machine think it's talking to a paper tape punch (or any other slow serial device, really).

The CP/M ones also generally used the tape drive as a drive letter not as a punch. The PX-4 controls the tape drive to work as a disk, and the Yugoslavian CP/M port for hacked ZX Spectrum used the ZX microdrive (one of the endless loop tape devices of the time) as a disk drive. They were part of the brief period where floppy disk drives were pricey and very power hungry. There were a lot of other similar efforts (wafadrive, exatron stringy floppy etc) at the time and some of them worked very well (eventually... in the case of the Microdrive) and occupied a niche in affordability and speed.

Alan

James Taylor

unread,
Mar 14, 2021, 11:16:59 PM3/14/21
to RC2014-Z80
Not to add one question on top of another, but I thought I'd give something a try to test how I plan to have this work.

First, sending data over the second serial line at 115200 baud:

1. Check jumpers.
2. Issue "screen /dev/ttyUSB0 115200" on the PC (second USB adapter).
3. Issue "PIP PUN:=NUL:,J:FIZZBUZZ.PAS,EOF:,NUL:" on the RC2014 (had to have a file, and everyone loves Pascal!).
4. Check the PC.

That worked splendidly and got all the file contents.


Now for something a little different. 

Rather than creating a module just for testing, I figured I would send send a roughly 19 kHZ signal through into the external clock header on the Dual Clock module. For this I used an Arduino Mega and a quick sketch using delayMicroseconds() - it's not any more sophisticated than the example "Blink" program. It's also not exactly 19.2 kHz like I would want (the library requires you to supply an unsigned int), the frequency setting on my multimeter can read up to 20 kHz. I got 19.5, which should give an effective rate of ~305 baud. Not too bad.

And after that:

1. Hook up the clock signal.
2. Check jumpers (second port set to "external", the last pair of pins).
3. See that Arduino is up and running.
4. Issue "screen /dev/ttyUSB0 300" on the PC.
5. Issue "PIP PUN:=NUL:,J:FIZZBUZZ.PAS,EOF:,NUL:" on the RC2014
6. Check the PC.

Aaaaand... garbage characters. I tried a few different baud values for "screen". The only one that works is 115200, and it works even if the external clock is connected and selected. Huh.

I've got the Arduino signal going to pin 5 on that header, starting from ground and going to the right. That should be correct.


It acts like it's ignoring that clock signal altogether. What am I not doing right?

Mark T

unread,
Mar 15, 2021, 9:07:14 PM3/15/21
to RC2014-Z80

This is the list of references that I made while I was looking into digital recording to cassettes. There were a lot of other cassette interface articles over the same period of time in the magazines, but these were the ones I found interesting for digital recording, rather than recording analogue tones. I also included reference to the Elector floppy interface as an example of hardware encoding and decoding, though at the speeds possible on cassette it may be better to use bit banging methods.

Technical References Computer Peripherals at Nanyang Technological University, Singapore

http://www.lintech.org/comp-per/

Chapter 7: Magnetic Recording Fundamentals

 

Magazine references BYTE Vol 00-01 1975-09 The Worlds Greatest Toy

https://worldradiohistory.com/Archive-Byte/70s/Byte-1975-09.pdf

SERIAL INTERFACE – Page 22

BYTE Vol 00-07 1976-03 Cassette Interfaces

https://worldradiohistory.com/Archive-Byte/70s/Byte-1976-03.pdf

THE COMPLEAT TAPE CASSETTE INTERFACE – Page 10

MAGNETIC RECORDING FOR COMPUTERS – Page 18

DIGITAL DATA ON CASSETTE RECORDERS – Page 40

BYTE Vol 02-01 1977-01 Hash Tables and Interrupts

https://worldradiohistory.com/Archive-Byte/70s/Byte-1977-01.pdf

SATURATION RECORDING’s NOT THAT HARD – Page 34

Details a method of saturation recording using standard cassette tape head. This article describes using two 74125 gates in push-pull configuration to drive positive or negative current to saturate the flux on the tape in either direction. 74125 gates are disabled for reading from the cassette; this simplifies switching between read and write.

As saturation recording is used, an erase head and tape bias circuit are not required.

Read data recovery has a two stage pre-amplifier, followed by two separate comparators to detect positive and negative flux transmissions, followed by a 7474 used as a set/reset latch to recover the data from the tape.

The article proposes recording an NRZ data stream, with start and stop bits, with a bit banged approach.

BYTE Vol 06-04 1981-04 Future Computers

https://worldradiohistory.com/Archive-Byte/80s/Byte-1981-04.pdf

Digital Minicassette Controller – Page 66

This describes a Braemer CM-600 Mini-DEK transport, very similar to the TEK Data unit that I once had.

Elektor 91 - 1982-11

https://worldradiohistory.com/UK/Elektor/80s/Elektor-1982-11.pdf

Floppy disk interface for the junior – Page 11-42

This project uses a 6850 and discrete logic to interface to a single density floppy disk for the Elektor Junior computer. It includes a method of coding and decoding FM data using discrete logic, though it uses 74LS123 for the timing in data and clock recovery.

Elektor-1984-01

https://worldradiohistory.com/UK/Elektor/80s/Elektor-1984-01.pdf

Digital Cassette Recorder – Page 1-29

This is a modification of a standard cassette recorder to improve use with a computer.

Elektor-1984-05

https://worldradiohistory.com/UK/Elektor/80s/Elektor-1984-05.pdf

Digital Cassette Recorder Revisited – Page 5-59

Elektor-1984-09

https://worldradiohistory.com/UK/Elektor/80s/Elektor-1984-09.pdf

Digital Cassette Recorder with the ZX81 – Page 9-35

ETI-1980-10

https://worldradiohistory.com/UK/Electronics-Today-UK/80s/ETI-1980-10-80.pdf

Cassette Interface – Page 63

This project uses differential phase modulation with a standard audio cassette recorder. Timing for clock generation and recovery uses a 16 x clock.

ETI-1984-09

https://worldradiohistory.com/UK/Electronics-Today-UK/80s/Electronics-Today-1984-09.pdf

Digital Cassette Deck – Page 27

Interface to a solenoid operated cassette mechanism.

 



James Taylor

unread,
Mar 23, 2021, 12:24:21 AM3/23/21
to rc201...@googlegroups.com
You're a gentleman and a scholar, Mark. I will make good use of these resources. Sorry for the late reply!

--
You received this message because you are subscribed to a topic in the Google Groups "RC2014-Z80" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rc2014-z80/Y5iGvJkke3c/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rc2014-z80+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rc2014-z80/520635a6-7817-4530-b73e-2dcda9662fd2n%40googlegroups.com.

Mark T

unread,
Mar 23, 2021, 9:49:48 AM3/23/21
to RC2014-Z80
Hi James, no problem. I’d be very interested in any progress you are able to make.

Mark

Reply all
Reply to author
Forward
0 new messages