• Please review our updated Terms and Rules here

IBM PC Cassette interface

supervinx

Member
Joined
Oct 10, 2007
Messages
16
Someone knows the pinout of the cassette interface of an IBM PC 5150 ?
Which cassette recorders can be used ?
Thanks
 
Someone knows the pinout of the cassette interface of an IBM PC 5150 ?

Yes, I've got documentation (including how to modify it to act as a low voltage switch from Cassette BASIC commands), but it will take a little while to dig out if nobody comes up with it on the Net...
 
Yes, I've got documentation (including how to modify it to act as a low voltage switch from Cassette BASIC commands), but it will take a little while to dig out if nobody comes up with it on the Net...
Since I don't own (obviously ...) the original tape recorder, I'd like to know if some aftermarket model can be adapted (like the Commodores' ones, easy to find everywhere ...)
---
BTW I've found the pinout of the 5150 tape interface, and it looks very similar to the TRS-80 (I don't know if voltage levels are the same ...) ...
 
Last edited:
As far as I know, there was not an official IBM cassette recorder... you simply bought a generic one. I alwas assumed the cable to be a standard DIN-style lead as used on most audio equipment in the '80s...
 
P4

P4

Note that P4 on the motherboard controls the voltage level on the DATA OUT line.
C-A for high level or C-M for the low level. Low level is about 10% of the high level.
 
Thread necromancy...

I've done a bit of research into how Cassette BASIC on the 5150 stores its files, and written up what I've found at http://fileformats.archiveteam.org/wiki/IBM_PC_data_cassette .

What I also discovered is that the timings are close enough to those used by the ZX Spectrum that the .TZX archiving format designed for Spectrum tapes can also be used to store 5150 BASIC programs. This is obviously far more convenient than .WAV; a 9k BASIC program occupies 1293k in WAV format, but 9k in TZX format.

If you've got a cassette-equipped 5150 or PCjr to hand, you can find a sample .TZX here . PlayTZX can be used to play it through your soundcard.

Creating the .TZX isn't quite as straightforward; I had to add a trailer block by hand to avoid load errors. The process I used (having captured the output from the 5150's MIC connector as a .WAV) was:

Code:
sox haunt.wav -b 8 haunt.voc
voc2tzx haunt.voc haunt.tzx
Then create the 20-byte trailer block in a hex editor:
Code:
11 9E 07 C1  46 6E A8 4F  00 9E 00 8B  0C 01 00 00
01 00 00 00
Append it to the file:
Code:
copy /b haunt.tzx+trailer.bin hauntx.tzx
And check that it will load on the 5150:
Code:
LOAD "CAS1:" (on the 5150)
playtzx hauntx.tzx (on the PC)
 
As far as I know, there was not an official IBM cassette recorder... you simply bought a generic one. I alwas assumed the cable to be a standard DIN-style lead as used on most audio equipment in the '80s...


You are indeed correct in one respect. There was no "Official" cassette deck. Plus, there is no real difference between tape recorders as almost all of them have the same control for pause and play, and the audio in/out are all the same. Once you have a cable set that works with one cassette deck, then you pretty much have them all. I am using an old Radio Shack cassette tape machine on one of my 5150's, and on the other, I'm using a Sony.

There is an issue with using Commodore equipment though. Commodore made their tape units specifically for use with their own computers. By making an interface that works with Commodore, you have just made one that is incompatible with the PC to standard cassette recorders.
 
I've often wanted to try the cassette interface. I have heard conflicting reports on whether it can be accessed through DOS or not.

Most people say no, but I remember reading somewhere in an IBM manual a while ago that calling it via CAS1: in disk basic should work. I might be wrong, though. If I can find the reference again, I'll post it.

I don't have a cable for mine (yet :)) so I can't test this.

Bobby.
 
I've often wanted to try the cassette interface. I have heard conflicting reports on whether it can be accessed through DOS or not.

Most people say no, but I remember reading somewhere in an IBM manual a while ago that calling it via CAS1: in disk basic should work. I might be wrong, though. If I can find the reference again, I'll post it.

I can definitely say that using CAS1: in Disk BASIC works, because that's what I used to transfer my test program from disk to tape (well, to a .WAV file, but as far as the 5150 was concerned it was tape).
 
BIOS INT 15 functions 0 to 3 were intended to access the cassette tape. Very minimalist. Return codes differ between PC and PCJr. With lots of work, someone could make a third application for the IBM PC that uses cassette tape. (After Cassette Basic and Diagnostic)

The cassette portion of the IBM PC BIOS is listed on pages A74 - A80. The timing loops look like they will fail with higher clocks, V20, or CPU accelerator.
 
Last edited:
Hey there Bobby!

Yes, you can access the cassette port via DOS, and more importantly, BASIC, and I believe some other languages. Don't hold me to that last part though. I know I've seen someone use CP/M to access the port for loading and saving program code and data. But for the life of me, I don't know how. Basic loaded through DOS has some commands that can access the port too.. But again, I just don't know the code. Whenever I know I'll be writing a new programme that I know I'll want to keep, I typically load BASIC via ROM which is built into the machine. I guess I should look it up in my own manuals. The only bad thing is that I don't have any manuals for BASICA, Extended BASIC, or any of the other flavors compatible with IBM 5150 machines.

If someone has the code we're looking for, can you add it to this thread please. Enquiring minds would like to know... And, if someone just happens to have code for other OS's to access the cassette port, can you post that as well please?

As always; Thanks everyone.

I've often wanted to try the cassette interface. I have heard conflicting reports on whether it can be accessed through DOS or not.

Most people say no, but I remember reading somewhere in an IBM manual a while ago that calling it via CAS1: in disk basic should work. I might be wrong, though. If I can find the reference again, I'll post it.

I don't have a cable for mine (yet :)) so I can't test this.

Bobby.
 
Isn't the hardware for the cassette port just a digitally controlled rele switch and a pair of amplified I/O lines on the 8253 timer? I mean, such an interface can be used to quite a bit of different things, like Peer to Peer file or general data transfer, digital control of some external device (for ex. automatic light-switch), etc...
 
Isn't the hardware for the cassette port just a digitally controlled rele switch and a pair of amplified I/O lines on the 8253 timer? I mean, such an interface can be used to quite a bit of different things, like Peer to Peer file or general data transfer, digital control of some external device (for ex. automatic light-switch), etc...

I was thinking about that a while back. There are some major drawbacks though. The first of which is speed. Sure, one could connect the audio to a line in jack on a newer PC, but the speed is tremendously slow. Imagine what it takes to load or save a simple 4K programme. I seem to remember taking something like 5 minutes. With audio tape, I would expect that kind of speed, but when connected to another computer, I'm sure one could configure a LAN adapter to communicate with a more modern network. TCP/IP stacks being what they are, and setting netbui, speeds will be much faster, and more reliable.

Nowdays, I use either 3.5" 1.44 MB floppy by the use of a MicroSolutions Back Pack drive, and, since I have an XT-CF Lite installed in one of my 5150's, I can transfer programs, and data way faster and more reliably that way too.

Just my 2 cents worth.
 
I was thinking about that a while back. There are some major drawbacks though. The first of which is speed. Sure, one could connect the audio to a line in jack on a newer PC, but the speed is tremendously slow. Imagine what it takes to load or save a simple 4K programme. I seem to remember taking something like 5 minutes.

The speed is approximately 1500 bits / sec (all zeroes would be 2000 bits/sec, all ones 1000 bits/sec). I found a 10k program took about a minute to save in the default (tokenised) form. Saving in ASCII is much slower, because each 255-byte chunk of the listing is written as a separate record on the tape.

Obviously one could improve performance by directly bit-banging the port rather than using the ROM BIOS (just like a turboloader on a Spectrum) but I would still expect LapLink over a serial/parallel port to win hands down. To my way of thinking, what makes the cassette port unique is that it's the only mass storage device supported by the built-in ROM BASIC.
 
If anyone interested two years ago i wrote two simple command-line tools: First WAV2CAS. Can try recover data from your tapes. For example, if you converted IBM_PC_Diagnostic_Cassete from mp3 to 8 bit unsigned PCM WAV file and enter
Code:
wav2cas.exe IBM_PC_Diagnostics_Cassette.wav diagn.cas
you got basic loader for IBM diagn tools.

Second tools, CAS2WAV . May convert you basic or other file to WAV file, then can be played from iPod or other music player directly in IBM PC / PcJr.

Source code included in archives.

Remark: this tools are written for soviet PC-clone named Poisk PC, not for original PcJr. But cassette tape format are fully compatible, plus-minus (maybe some differences with files type in header).
 
Last edited:
I've recently created a new release of my tapefile manipulation programs, taptools. The development version 1.1.0 can now create and manipulate tape files in TZX or PZX formats with IBM 5150 timings and headers.

This means, for example, it's possible to start with an ASCII listing and get it into the 5150 by doing this:
Code:
mkibmtap -n orient.tzx -a orient.bas
playtzx orient.tzx
or turn it into a .WAV with
Code:
mkibmtap -fpzxi -n orient.pzx -a orient.bas
pzx2wav orient.pzx > orient.wav

(The file I used to test was orient.bas by David H. Ahl).
 
YThere is an issue with using Commodore equipment though. Commodore made their tape units specifically for use with their own computers. By making an interface that works with Commodore, you have just made one that is incompatible with the PC to standard cassette recorders.

There were a few units like that. such as Coleco ADAM--digital, not analog, and, ISTR using 2 tracks; one for clock, the other for data.
 
Last edited:
Remark: this tools are written for soviet PC-clone named Poisk PC, not for original PcJr. But cassette tape format are fully compatible, plus-minus (maybe some differences with files type in header).
There was a clone that had a cassette port? :eek: Did they use the IBM roms to get cassette basic?
 
Yes, this clone have cassette port. In BIOS present small "monitor" program, so if no FDD or HDD controller present "monitor" asked filename, then if you type, for example, BASIC and press Enter, starting loading BASIC from cassette tape. BIOS still 8kb long, and have not build in BASIC. For this clone exist some games (paratrooper, etc), loading from tapes directly in memory and then "monitor" transfers control to them.
 
Back
Top