Processor and Software Architecture

    Snuffy's microcontroller is a Motorola  68HC912B32. This is a good mid range capability chip with enough memory, throughput and I/O to build a competent firefighting robot.  The particular implementation I used is the Adapt912 board made by Technological Arts in Toronto. .

    The software is a simple executive operating on the real time interrupt at 61 iterations per second.  All control software is executed at this rate.  The executive is a kind of macro interpreter.  The macro instructions are coded as a numeric table of about 200 entries, each of which has 7 numbers.      The executive determines whether the last mode has completed.  If so,  it reads the next entry from the table and assigns several variables which determine what mode will be executed next and various parameters to control the mode.

For example, a table entry might be:

0,    1,    250,    50,    800,    0x00,    0;    (in 'C')

The first '0' is a label allowing other macro instructions to branch to this line
The '1' is the operating mode to proceed forward tracking to the center of a hallway.
The '250' is the maximum speed to use during this mode (25 ips)
The '50' is the speed to be traveling at the end of the mode (5 ips)
The '800' is the distance to travel before ending the mode (80 inches)
The '0x00' is 8 option bits which modify the way the mode operates (e.g.  turn when right wall ends if near the '800' distance.
The final '0' is a branch to a label which may be called optionally by the mode at completion.

Upon setting up the new mode, the executive sets the mode status to 'not done' and calls the proper mode using a switch statement. 

From now on,  the executive continues to call the same mode until the status is set to done.

The operating code occupied approximately 22KB of Flash memory. 

There were about 200 variables which were almost all 'word' length (2 bytes) using about 400 bytes of RAM.

Maximum throughput usage was about 75%.