Background Debugger

The Motorola Background Debugger is a tool for hardware debugging the 68332 from a PC. On the 68332 side, the software is on the chip, the software for the PC is available free from Motorola.

Install the background debugger on the PC (Windows) and connect the debugger cable on the EyeBot. Then start the debugger:

bd32
The BDM is mainly used for two purposes:


Debugging an Assembly Program

Switch on EyeBot and load a user program, but do not press the "Run" button. On the PC start "bd32", then enter:
stop
The user program is now located at $20000 (hex) and can be viewed with the dis-assemble debugger command:
dasm $20000

Further helpful commands are:

window on
to show all registers, memory contents and debugger commands.

br $20a44
for settting breakpoints at a certain address

s
for single-stepping through the program

For detailed information see debugger description.


Re-Writing the Flash-ROM

Switch on EyeBot and start "bd32" on PC. Then enter debug command
stop
[In case the EyeBot does not stop, you'll have to press the reset button on the board.]
The screen should now show that the board is halted (bottom line of the screen).
Then initialize the 68332 registers:
do mapcs
Now you can use all debugger commands, e.g. breakpoints, single step, memory display and memory modify. The command "window on" allows to see registers, memory contents, and commands all at once.

Flash-ROM (256K)

There are currently two ROM sizes used in the EyeBot; 128K and 1MB. If you have a 1MB version, please refer to the next section.
The flash-ROM is divided into two partitions: a large partition for the RoBIOS operating system and all system routines, and a small partition for the hardware description table (HDT). This allows a separate flashing of the HDT in case new hardware componentes are added or deleted, so the RoBIOS does not need to be changed.

To erase and rewrite the Flash-ROM for RoBIOS:

flash 11111110 robios.hex 0
The file 'robios.hex' will be flashed with offset zero. Currently used is a 29F010 chip, which means 8 segments of 16 kB each. The first string of 8 "1"s or "0" determines how many segments are erased. Depending on program size, you may want to specify a smaller area, e.g. 11110000 for half the flash-ROM (check the assembler output file, not the S-record file).

To erase and rewrite only the Flash-ROM for the HDT, simply download the HDT or:
(xxxx stand for a specific name, e.g. vehi for vehicle)

flash 00000001 hdtxxxx.hex $1c000
If everything worked properly, you should see the type of the F-ROM on the screen (currently: AMD 29F010) and the programming should start (you will be able to see the progress). Depending on the system you are using, this takes a few seconds to a few minutes.

Flash-ROM (1M)

In a system with 1MB of ROM, there is additional space to save up to 3 user programs in ROM. These can be saved and loaded from the "USR"/"ROM" menu. Since the sectors are larger for the 1MB ROM, the addresses for flashing are different.

To erase and rewrite the Flash-ROM for RoBIOS and HDT:
(xxxx stand for a specific name, e.g. vehi for vehicle)

flash 11000000 robios.hex 0
flash 00000000 hdtxxxx.hex $1c000
To update the HDT only, simply download the HDT or:
flash 00110000 hdtxxxx.hex $20000
The HDT will be copied into its original place upon restart of the system. This will erase any user program stored in the first ROM slot.
Thomas Bräunl, 1999