Sunday, January 30, 2011

Retrochallenge Success!

To recap - my goals for the Retrochallenge 2011 Winter Warmup were:

  • Build a cable to connect the Commodore SFD-1001 drive to the PET 2001-8N.
  • Test the cable and the drive by successfully formatting a disk, saving a program, then re-loading that program into memory.
  • Get some software from the Internet, load it into the PET, then save it to the SFD-1001.
Having done the first two steps, I set out this evening to finish step 3 - getting some bits from the Internet to the PET. And - success!

(With one caveat - I actually created the program that I moved from my PC to the PET/SFD-1001, using VICE. But it could have been a PRG program from anywhere.)

Here are the steps I used to get the program from my PC to the PET, then to the SFD-1001:

Create program in VICE

I typed a small (very!) program into the VICE Commodore PET emulator program, then saved it to a virtual tape file ("TAP" file). It's pretty easy to create and use a virtual tape image in VICE. I'll leave the "how" as an exercise to the reader, but you'll figure it out in less than a minute.

Create a WAV file with an analog C2N-compatible audio image of the program

Next, I used a program called "Audiotap" that converts a virtual TAP file into an audio "WAV" file.

This program prompts you for the *.TAP file, then for the output *.WAV file. It then creates an audio WAV file that reflects the same signal you'd hear as created/used by a real Commodore C2N cassette drive.

Record the WAV file to tape

Now, creating this file and recording it to a cassette deck was pretty easy. Getting it to read on the PET was hard. The audio levels had to be adjusted properly, and I actually had to switch computers once. I was trying to use my laptop for this, but its sound output is too noisy. I eventually switched to my desktop, which has a SoundBlaster Audigy 2 ZS, and this was squeaky clean. Here's the mono cassette deck I used:

Load the program from C2N tape into the PET

Once the WAV file was recorded on the tape, then I moved it to the C2N cassette deck, and attempted to load the program from tape.

As I mentioned, getting the analog levels correct was tricky - but once done, things were looking up!

Save the program to the SFD-1001

With the program successfully in memory, I wasted no time in saving it to the SFD-1001:

Test that it all worked

With the program safely moved from the PC to the PET to the SFD-1001, I then did a cold-start (just to make sure there's nothing up my sleeves), and loaded the program back from disk:

Voila! Bits moved successfully from the PC realm to the PET via good ol' cassette tape, then tucked safely away on disk.

The future

As I've been reading up on moving programs between the PC and the PET, I've found that there are several options, all of which are better and more sophisticated than the cassette tape proxy method that I just performed. I'll be looking into these, perhaps building some more hardware, and then will blog with future results.

But for now, I will bask in the bright light of Retrochallenge success!

Saturday, January 22, 2011

RC 2011 Winter Warmup photos

As promised, here are some photos of my Retrochallenge 2011 Winter Warmup project. You click on the pictures to get a bigger version.

First, let's start with a photo of the PET 2001-8N, SFD-1001 disk drive, and handy 5.25" disk holder (containing a DS/DD disk!):

Here's a close-up of the PET:

Here is the SFD-1001 IEEE-488 drive. Notice the DIP switch on the lower right-hand side - this is the "hacked" device select that I talked about earlier:

Here is the drive side of the cable I made. Note that it's a 24-pin Amphenol connector - smaller than Centronics-style printer plug, but similar in appearance:

Here are a couple of pics of the PET side of the cable (this is the side I soldered). A bit ugly, but functional - and I got good solder joints. I think I'm doing better with my soldering these days. Note that it's the same type of connector as the PET (and later) user port:

This is the SFD-1001 formatting the disk:

And here is the result - notice the 4133 BLOCKS FREE - that's slightly over 1 MB. Read it and weep.

OK, here's where I chain two programs together, while not losing the variables in-between. There are two programs on the disk, creatively named PROGRAM1 and PROGRAM2. I've got screen shots; however, the first screen shot is pretty fuzzy, so here's the code...


10 A=1001
20 A$="SFD1001":A$=A$+""

Hey, on line 20, what am I doing with the A$=A$+""? Why add a null string to another string? Here's a summary - When Commodore BASIC sees a new string defined like A$="HELLO", it leaves the string storage right in the BASIC program. Why move it and take up more space? Pretty efficient - except when you chain to another program, that line number is gone, and so is your string. So you need to do something to Commodore BASIC to make the string "dynamic" - stored in variable memory, rather than right in the BASIC program. Adding a null string is one way to convince the string to be "dynamic".

For a better and more lengthy explanation, see Jim Butterfield's 5 part series on this topic, as provided to me by Nathan (thanks Nathan!). (Links at the end of this blog post.)



Pretty simple, right? Line 70 of PROGRAM1 loads PROGRAM2 from disk, and it starts running, printing the variables to prove they made it! Here are the screen shots, including the program running:



Running PROGRAM1, which chains to PROGRAM2 - Drum roll please!


OK, here are the links to the Jim Butterfield articles if you'd like to read up.

Loading And Linking Commodore Programs by Jim Butterfield (Part 1,) Part 2, Part 3, Part 4, Part 5.

My next posting, perhaps later this weekend, will be a first shot at getting bits from the Intarwebs into the PET, and onto the SFD-1001! Stay tuned!

As a side note, my cat Stormie decided to upstage my retro hobby today. When she wants attention, she's pretty persistent. From one PET to another...

Tuesday, January 18, 2011

Episode #139 - covers my Retrochallenge 2011 Winter Warmup entry

Be sure to check out Episode #139 of the Retrobits Podcast, which I devote to the SFD-1001 drive, IEEE-488, and my Retrochallenge 2011 Winter Warmup entry!


  • The SFD-1001 drive and cable are functional and working well.
  • I've been able to "chain" two BASIC programs together to make a more "complex" program; however, string variables may not be preserved when loading one program from another. More research required.
  • My proposed first-pass method to move a program from the Internet to the SFD-1001 involves using an emulator to create a TAP (virtual cassette tape) file of the desired program, using another utility to turn that TAP file into a WAV file, recording the WAV to a cassette tape, then loading that program from that tape onto the PET 2001 using the C2N cassette deck. Finally, the program will be stored from the PET to the SFD-1001. Whew! Morse code goes faster!
Another week and a half to finish! Hoping for a success!

Saturday, January 8, 2011

Retrochallenge Step 1 COMPLETE (pics to come)

Hi all,

I successfully soldered up a cable, hooked up the PET 2001-8N and the SFD-1001, then proceeded to format a disk. Saved a BASIC program and loaded it back up - worked like a charm!

Retrochallenge Step 1 COMPLETE.

One speed bump - my SFD-1001 has a homebrew-added DIP socket on the front (lower-right side). I thought it might be a device select, but was assured it wasn't. Well, it was. When the drive refused to talk, I traced the wires back to the drive internals, and found that it had been hacked into the chip sockets where the device select is set. Hooked up a jumper, and blammo, drive working!

I have LOTS of free blocks. This drive stores 1 MB per floppy (!). Now I've got somewhere to put all the programs - ever made - and then some - for my 8K PET :-) Guess I'd better start writing some of my own programs!

Pics (and video?) to come...

Monday, January 3, 2011

Retrochallenge 2011 Winter Warmup!

I'm getting started on my Retrochallenge Winter Warmup 2011 project! Here is the description and some more details...

A while back, a friend gave me a PET 2001-8N. It's in really nice condition. The -8N means 8K of RAM (and a standard sized keyboard), so it's not a powerhouse - but it is among the first models of computers produced by Commodore. I have the accompanying tape drive - a C2N Datasette. But I have to admit, I've wanted a disk drive.

My PET is not the first model produced by Commodore - that honor would go to the smaller keyboard PET 2001 with the built-in datasette. (This is, of course, if you don't count the KIM-1 SBC, which was produced by MOS Technology prior to the Commodore acquisition.) However, my 2001-8N does have the correct ROMs to support a disk drive. So when the opportunity came up to get an SFD-1001, I jumped at the chance. It needed about $30 worth of repairs, but now it's up and running, and refurbished.

The SFD-1001 is an interesting device. It can store 1 MB on a single floppy disk. It is supposed to use "quad density" media, but even back in the day, this was pretty rare and expensive. So people figured out that you could use standard double-density media, and it would mostly work. That's what I plan to do. The SFD-1001 looks much like a standard Commodore 1541, but it has an IEEE-488 interface. And, as it turns out, I don't have an IEEE-488 cable. I could buy one, but I already have the pieces, so I'm going to try building one. Which brings me to my project:

Step 1: Build the cable

The PET user port is the same style connection as the VIC-20/C64/C128 user port. The pinouts are not all the same, but the flat-edge connector style is identical. As it turns out, the IEEE-488 connection on the PET is also the same style connector - it just has the flat-edge "notch" at a different location. If you're using a non-keyed connector, you can use a user-port connector for the PET side of the cable. I have a solder-style user-port connector, so I'm set on that end.

The other side of the cable is more of a problem. The disk drive end of the cable requires a male 24-pin Amphenol plug. I do have one; however, I'm going to have to harvest it from a non-working IEEE-488 adapter for the C64. It is a difficult decision to "snip" this cable from the adapter; however, the adapter is broken, and I don't have the facilities or inclination to fix it. So, the Amphenol connector and attached ribbon cable will be "re-purposed".

I have to sketch out the pinouts for both sides of the cable, then get out my wire strippers, soldering iron, multimeter, and make it happen.

Here's the rest (details coming in later posts):

Step 2: Test the cable by formatting a disk, then saving/loading a program.

Step 3: Get some software from the Internet, get it to the PET, then get it on the disk drive.

Step 4: (Extra credit) Figure out if it's possible to "chain" BASIC programs, so that an 8K PET can run some programs that are slightly more sophisticated.

Off I go! Pictures to come shortly!