It all started simply enough: I came up with the idea of using my retrotech timelapse camera kit to do a timelapse of the upcoming Phoenix Type-In. Well, when you come up with these ideas, the first thing you do is check your kit and get it ready. Thus began the adventure…
I pulled the Timelapse Kit out of the closet where I had stored it some months ago, and I expected the batteries in the TRS-80 Model 100 to be dead. They were. No big deal, I changed them. Then I booted it up to find that it had sat long enough without power that the memory had cleared, wiping the resident TL.BA program that I use as an intervalometer. “No Problem” thought I, “I have a backup right here on my PC.
Well, in order to transfer the file from my PC to the Model 100, I need a null-modem cable (you remember them, right?) and a PC with an RS-232 port. I can whip up an old PC from parts in minutes that will suit, but for some reason I couldn’t find my Null Modem Cable.
Ergh. No way to transfer the file then. Well, I guess I’ll just rewrite the timelapse program. No Problemo – it’s like 20 lines of BASIC. I dusted off the Model 100’s BASIC reference manual and set to work. About halfway into it, I discovered that the Model 100’s Backspace key had stopped working… and I discovered that by not being able to delete a typo. Ergh…
Ok, that’s gonna be a problem, but I can power through it. I have my Model 200 that I can use instead. Now I just have to figure out how to get what I’d already typed from the 100 to the 200. At first I considered trying to use the PDD drives I have, but they’ve been fritzy for decades and I don’t really trust them. That left me with the old CCR-81 Cassette Drive.
It was then that I got the bright idea of trying to use a Digital Audio Recorder to transfer the files rather than the Cassette Drive. After all (I reasoned), a digital audio file will probably have better data fidelity than a 30 year old tape recorder with dry belts and a God-knows-how-old cassette tape, right?
So I gave it a try. I happen to have picked up an iKey Audio M3 at Deseret a week or two ago for $10 (smokin’ deal – still in the box!), and it can be set to record 44k Mono WAV files. After a few tries (the TRS-80 is a little deaf, and needs the sound levels just about as high as they’ll go for both recording and playback), I found I could save the files from the Model 100 to the M3 recorder and load them into the Model 200 for editing. YAY! :D
I then happily finished the timelapse program, tested it on the Model 200 and then saved it to the M3 and loaded it to the Model 100. Mission accomplished!
And then I realized that I had a digital representation of my program as an audio file on an SD card I could read on my PC. Hmmn… I wonder if anyone has written some sort of converter to read an audio file of a saved program on cassette and turn it back into ASCII? That would be a handy way of transferring files from my Model 100/200 to the PC, wouldn’t it?
It turns out that someone has… *sort of*… At least they have for the TRS-80 Model I/III/4. Completely different machines, different processor and OS, but just maybe they use the same format for recording data to tape? Might as well give it a try and see what happens… I downloaded the utilities for converting Model I/III/4 WAV files to CAS (a format used to load the programs into emulators), and to convert from CAS to Hexidecimal Text.
My first attempt wouldn’t load because the M3 recorder records a WAV file that isn’t Microsoft 16-Bit PCM format, so the first thing to do is convert it to that format. I loaded the WAV file into the Free Audacity audio editor and simply “exported” it to the proper format.
Once in the right WAV format, the file imported into WAV2CAS just fine, and I could immediately see that even though the program didn’t understand the audio file’s data headers, it could read the file and could show the HEX and ASCII contents. I couldn’t select or copy that text though. First I needed to “Save” each chunk of the packet as a separate CAS file. I did so, exporting all chunks except the first one, which contained garbage headers.
The next step is to fire up the PLAYCAS program and load each of the CAS files into it, then right-click the title bar to get the menu where you can “save text”, which finally exports the data to a plain ASCII text file.
Well, OK. Not really plain ASCII. What you get is a bunch of text files that contain the data in a HEX column and an ASCII column. This is not really what you want in the end, so here’s how to get the plain text. First, open up all the text files in a text editor (I use Notepad++) and copy/paste them all together in order. What you get looks like this:
Delete the headers and use the “Regular Expression” search/replace function to get rid of the ASCII column. All you want is the HEX column. Copy that entire HEX column and go to a HEX to ASCII converter site and paste the HEX code into the “convert” box.
What you’ll get in return is the ASCII text with some garbage characters at the beginning and ends of the chunks. Just cut out these garbage characters, and what’s left is your text file!
and here it is:
10 CLS:PRINT”Canon PS600 Timelapse”
20 PRINT”2014 – T. Munk – munk.org”
30 PRINT:INPUT”Seconds Between Shots”;D
200 INPUT “#Exposures to Shoot”;A:O=A
300 CLS:PRINT”Timelapse Program:”
310 PRINT”At”;D;”Second Intervals.”
350 PRINT:INPUT”Press <ENTER> To Begin”;G$
390 IF G$ = “” THEN 400 ELSE 10
400 CLS:MOTOR ON:FOR Z = 1 TO 25:NEXT Z
410 MOTOR OFF:A=A-1
413 PRINT”*** TRS-80 Timelapse ***”
414 PRINT “<SHIFT><BREAK> To Quit.”
420 FOR X=1 TO A STEP 1
430 FOR E=1 TO B STEP 1
440 NEXT E
450 MOTOR ON:FOR Z=1 TO 25:NEXT Z:MOTOR OFF
490 NEXT X
1000 PRINT@162,”Ended Shoot. “
Oh, and in case you want to hear what this data file sounds like in the language of the TRS-80’s Cassette Save format, listen to this WAV file. (set your volume low first, for Jebus sakes, the TRS-80 sings one screetchy song!)
Alternately, you can use the above WAV file to load this program directly into your own Model 100/102/200!
25 CommentsAdd a Comment
This reminds me of the Timex Sinclair 1000 that I used to play with. We’d transfer cassette tape files over the phone lines, using a Radio Shack battery-powered audio amp, as a makeshift modem. Fun stuff.
Yeah, I got a little obsessed about it after catching up on the new AMC series “Halt and Catch Fire”. The little Model 100 shows up in enough scenes that II started thinking about it a lot. Unlike Mad Men where Selectric II’s pop up in 1959, ten full years before they actually existed, The Model 100 did in fact exist and was sold in the show’s current 1983 (it had been introduced just a few months before Comdex ’83).
After playing around last night, I suspect that it’d be trivial to convert the cassette-save WAV files directly to plain ASCII if only I understood what the Model I/III/4 utilities were doing. It seems that the data format is the same, but the utilities just don’t grok the header bits and the handshake bits in-between the data chunks, and so can’t link the chunks together. If I understood how the format worked and knew a dang thing about Windows programming, I’d do it myself. :D
I understood none of these but it sure sounds impressive. (:
Well, it’s all Greek to me!
Man, oh, man! Does that ever take me back! It’s great to see where we came from and get some feeling for how we got here. Kudos, Ted, for remembering it and having the guts to try to make it work with old gear. This kind of project isn’t exactly easy even with modern tools but there’s an advantage with the primitive tools in that they both forced and made possible an understanding of the low-level processes you were working with. Great example. Thanks.
I agree. One of the many things I love about the Trash-80 is the fact that the technical reference manual is only a couple hundred pages long and describes in fine detail every memory address and instruction set and how each function controls each specific IC. Heck the addressable memory map for the Model 100 fits on a single page in the manual. It’s the closest I’ve come to an understanding of how software operates on hardware at the very lowest level in a computer, only possible because it’s such a simple and comprehensible system.
Oh and after some research, it appears to me that the base carrier format of the audio is probably AFSK, which I think is also used in HAM packet-radio data transmission. It just uses frequency shifting to represent digital 1’s and 0’s as waveforms. If this is so, it would explain why the Model 1/3/4 CAS converter has no problem decrypting the plain text in the file and only chokes on the flow-control codes and headers. I have an idea about maybe writing an analyzer/decryptor in PHP, assuming I can find a library that can analyze waveforms in an audio file. Then it’d just be a matter of converting the waveforms to binary, then to ASCII and stripping out the high-ASCII headers and control codes as extraneous noise.
Good Jebus, this rabbit hole is deep…
Well, to analyze the waveforms, while you’re waiting for Goodwill to give you an oscilloscope next week, what about opening it in one of those music editing apps that are all over the net these days? At least might give you some ideas about the structure.
Wow. I worked a number of roundabout ways doing various things in my earlier days with old tech, but nothing as magnificently confusing as what you did here, and I even understand most of what you said. XD
You bring back a lot of memories from the late 70s early 80s. Weren’t computers fun way back then?
still fun, if you do it right! :D
Wow that really takes me back. This is why I like hanging out with you. I tend to just do these as thought experiments but you actually haul out the gear and DO them.
Very clever and super interesting. Thanks for documenting.
Thanks for sharing that WAV!! I needed to hear that sound again.
What do you add to the WAV file in the header to get WAV2CAS to open it?
well, the audio files have some kind of flow control codes that I eventually stripped out with the text editor once I got that far. To get the WAV file into WAV2CAS, I just had to make sure the WAV file was Microsoft 16-Bit PCM format (I used Audacity to convert it).
Maybe that’s the key, that I don’t need to add anything, just strip it out? Do you have an example you might be able to send me? My e-mail is abby dot r dot adams at gmail dot com. Thanks so much.
Yep, getting the WAV file into WAV2CAS simply was a matter of saving the WAV file in a format that the program would accept (16 Bit PCM). Once in WAV2CAS, you just follow the instructions above (export to CAS, then into PLAYCAS to export to ASCII text). Once you have the ASCII textfile(s) of the HEX and ASCII, that’s when you strip out the control codes. They’re represented in the text as weird boxes with 4 characters in them and you can just select and cut in your text editor. chop out all except the HEX column, then use a HEX2ASCII converter on the web to convert it to plain text.
If you need an audio file to practice on, here’s the one from this project:
When I open this file in WAV2CAS, it opens and let’s me save to CAS to but it says “bad”. Do you know why that would be?
nah, it did the same to me (you can see it in one of the screenshots above – the file gets named “file 2(bad).hi.txt”) I just ignored it. it might be some comment on how the program couldn’t properly figure out the flow control codes, but it made no difference in the end.
I must be doing something wrong along the way because even with the audio file above, when I follow the process outlined above with the sample audio file, I don’t end up with much hex code and barely any text when I convert it the ASCII. This is it –> TL ªEUªS*Uªå
Could I see the CAS file created from the sample file to see if that is where I’m having the issue?
I see the sample audio file is pulled up in the WAV2CAS screenshot but when I do the same on my end, it doesn’t look anything like that…hmmmm…
Now I’m seeing it…for some reason, I have to select “file 2” from the drop-down. Not sure why…but I think I have it figured out. Thanks!
ahh, excellent! I assume from your username that you’re the sort that is interested in pulling info from old obsolete data tapes as more than a casual interest. Let us know if you find a better way to do this sort of thing. This is admittedly an obtuse hack born of an afternoon’s whimsy to get old computer gear working again, but it’s a hack because I couldn’t find an easier, more modern software package that did a similar task. Seems like there would be *something* out there that people use to do pull legible data from old analog data tapes.
It would be nice to make a YouTube video showing how to save and load files onto a TRS 80 Model 100. Showing step by step instructions on connecting digital .WAV recorder to M100. Plus show how to connect cassette cord from the M100 to the digital .WAV recorder.
ok, here you go, Duane: https://www.youtube.com/watch?v=exdiQdjioyQ