Hero-1 Robot: Online Assembly to Machine Language Converter!
Hey all -- if you are fortunate enough to own a Heathkit Hero-1, I've written a simple online application that converts mneumonic assembly language for the MC6808 (and the Hero-1 interpreted "Robot Language"!) to ready-to-enter machine language opcodes. I am not fortunate enough to have serial capability on my Hero-1, so I have to hand-enter all the hex code.
The converter has all the instructions built-in, along with many, many pre-defined constants specific to the Hero-1: all ROM subroutine addresses (INCH, OUTBYT, OUTHEX, etc), all port addresses (e.g. light/sound sensor), all the speech phonemes, data addresses such as motor positions and sonar hits, etc. It even includes ready-to-use "bitmaps" for outputting characters to the led segment display. Of course, all interpreted "robot language" opcodes are implemented as well. The only items I still need to add are the addresses for pre-defined speech strings in ROM -- I'll be getting to those in the next several days.
The nice thing about the converter is that it lets you write Hero-1 code with constants, labels, ORG statements for organizing RAM, evaluated constants, etc. Relative branches are calculated automatically to labels which is very convenient.
It's lightly optimized as well -- if you load an accumulator from an address <= $FF, the compiler will use the direct instruction if it's available. Likewise for inserting one or two arguments depending on instruction and value of the argument.
In any case, if you are interested, give it a whirl. There is a sample program that comes up by default if you want to see what the generated code looks like.
(FYI -- I'm currently interfacing an SX into my Hero-1 to handle IR communication with all my other 'bots -- I wrote this utillity because I was sick of writing machine language and always looking up the addresses of ROM subroutines and the like.)
Try it out here: 1uffakind.com/apptoys/onlinecompilers/MC6800
The converter has all the instructions built-in, along with many, many pre-defined constants specific to the Hero-1: all ROM subroutine addresses (INCH, OUTBYT, OUTHEX, etc), all port addresses (e.g. light/sound sensor), all the speech phonemes, data addresses such as motor positions and sonar hits, etc. It even includes ready-to-use "bitmaps" for outputting characters to the led segment display. Of course, all interpreted "robot language" opcodes are implemented as well. The only items I still need to add are the addresses for pre-defined speech strings in ROM -- I'll be getting to those in the next several days.
The nice thing about the converter is that it lets you write Hero-1 code with constants, labels, ORG statements for organizing RAM, evaluated constants, etc. Relative branches are calculated automatically to labels which is very convenient.
It's lightly optimized as well -- if you load an accumulator from an address <= $FF, the compiler will use the direct instruction if it's available. Likewise for inserting one or two arguments depending on instruction and value of the argument.
In any case, if you are interested, give it a whirl. There is a sample program that comes up by default if you want to see what the generated code looks like.
(FYI -- I'm currently interfacing an SX into my Hero-1 to handle IR communication with all my other 'bots -- I wrote this utillity because I was sick of writing machine language and always looking up the addresses of ROM subroutines and the like.)
Try it out here: 1uffakind.com/apptoys/onlinecompilers/MC6800
Comments
Robert
You and I have discussed upgrading my Hero-1 to add serial capability; I've always been interested in this possibility but $$ is always a problem and I've been reluctant to mess too much with the I/O and CPU boards on my 'bot as everything just gets more fragile each year.
Adding a Serial (or USB connection) is pretty easy since it just plugs into the breadboard on the head. The only concern is that it requires the memory expansion board with the 4Mhz crystal.
Robert
Yeah, that's the part I'm not sure I want to do
If you could email me the assembler, that would be awesome.
Now here's a totally crazy idea that would allow you to automatically download code to a Hero without modifying the Hero hardware. Build an automated key press machine! It would receives and buffer a stream of bytes, then push the buttons on the keypad to store the values into the Hero.
However, as Robert mentioned there is a serial interface and ROM chip avail. for being able to download code direct. I may not go that route due to time and $$ and fragility of the platform. However, I have toyed with the idea of loading up an EEPROM with the code and letting the SX act as an I2C peripheral for pulling bytecode down to the Hero-1. This would mean I would only have to load up a short bootloader into the Hero-1 that would read the SX and fill up it's own addresses w/the program.
For the Hero-1, there is a tape-in/tape-out interface, so it's not like I enter the program in every time -- I record the audio to a digital audio file on my laptop and just play it back when I want to load up the 'bot. It's kind of funny and old school in a way.
http://1uffakind.com/DesignMediaArtRobotics.php?p=14
If Hero used a regular motor I could see that helping it go straight, but I thought the Hero uses stepper motors which can go straight without encoders.
It was also just the "style" or preference most of the time -- a "steered" vehicle with a single drive wheel and two fixed free-axle wheels. The drive wheel turns +/- 90 degrees so you can more or less turn in a circle. The Hero-1 uses a stepper motor for turning the drive wheel, along with mechanical limit switches for homing the stepper. My own Hero-1 main code has the wheel "self" home and reset its internal stepper motor position register every 10 minutes or so -- a hard knock or bump in the road can throw the steering stepper off pretty quickly.
I would say the only thing I like about it is that the motion you can get while turning the drive wheel while moving forward or back is aesthetically pleasing -- it's fluid in a mechanical way that differential steering needs very careful -- and perhaps unnatural -- coding to achieve.
But that's academic, really. Even many years after introduction, the Hero-1 is a delightful platform. It's old-fashioned, but like a classic Cadillac or Olds 98. Everything may be a bit behind the times, but the attention to detail and approach is amazing and it's appointed with every luxurious peripheral you can imagine. And when folks see it they all stop and look
I think it's probably something to do with the fact that it's almost R2-D2 sized and shaped... it's like what lay folks want a "robot" to look like.