Not Dead Yet

Connection from the C64 User Port to the XBee via a level shifter from Adafruit. The top rail of the breadboard is 3.3V, the bottom is 5V.

You may have guessed from the lack of recent updates that something has gone terribly wrong – and you’d be right. Disaster struck when I threw my back out in a catastrophic shopping accident (I tripped while getting out of the car). I spent some time flat out on the couch, comforted only by painkillers and season 4 of the X-Files. I may or may not have been visited by the men in black. Once I was back on my feet, I didn’t want to follow up a day sitting at a desk at work with a night sitting at a desk working on my Retrochallenge project. I am a bit of a wuss that way.

But I’m feeling much better now, and though I’m very nearly out of time I’m not quite ready to give up. Moreover, I haven’t been at a complete standstill. Let me quickly catch you up with the latest, most of this accomplished before I hurt myself.

First off, I’ve completed and tested the XBee interface for the Commodore 64 User Port. There’s really hardly anything to this – it’s just a matter of hooking the right lines up to the XBee’s transmit and receive pins. The only tricky part is the voltage level shift from 5V (C64) to 3.3V (XBee). For the logic lines, I’m using a little logic converter breakout board from Adafruit – the same as I used for the SD Card hooked up to my Project:65 computer.

I also needed a 3.3V voltage regulator for the supply, but I was Absolutely Certain (TM) that I had one of those in my box of components. Of course I was wrong. Sparkfun got the part to me very quickly, but for a few days I actually had an Arduino hanging off the edge of the board just so I could use its 3.3V output.

The robot with XBee Shield and XBee in place. There are a series of status LEDs in the lower-left corner of the red board.

Meanwhile, the other XBee went into the XBee Shield which was attached to the top of the robot. The XBee Shield has a convenient switch that changes the connection from the Arduino’s hardware serial port (digital pins 0 and 1) to pins 2 and 3. This way I can use the software serial library to send and receive data from the XBee, and leave the computer with the Arduino IDE conneced to the hardware serial port. That means I don’t have to disconnect anything to reprogram the Arduino.

I’ve been able to do some preliminary communications tests and things are mostly working – the C64 is receiving what the robot transmits and vice versa. Mostly. I’m seeing occasional glitches, mostly incorrect characters received on the C64 side. My guess is that this is due to the bitbanged serial port implementation on the Commodore. I actually got a really interesting comment on one of my earlier posts about this project, including a pointer to some improved RS-232 routines. I intended to check them out, but with the clock running down I may save that for later. I think for now the glitches are rare enough that I’ll be okay.

Robot status display on the C64. I’m not an artist, so, uh, use your imagination.

Finally, I’ve got some software prepared on the C64 side. This is a really great example of the tragic state of my artistic skills filtered through C64 PETSCII graphics characters, but it should get the job done. My intention is to show a top-down view of the robot and use highlighting to display the direction of movement, and the state of feedback on the front sensors.

So that’s where I’m at – almost out of time, but with most of the pieces in place. If I can get them all talking to each other, it’s just possible I’ll get something to work before the end of the month.