About the samples labs

Some of the labs used in ELE 538 have been made available in object code format. This allows me to verify that the labs work under the simulator; it also allows you to verify that it is possible to make the labs work!

To try out a lab, click on the Labs (object code) button (in the File menu). Load the lab you want, and click Run, Step or Trace in the Toolbar.

General remarks about the included labs

Lab 1 (simple multiplication)

This lab is very simple: it multiples 2 8-bit unsigned numbers located at addresses 0x7000 and 0x7001 and places the 16-bit unsigned product at location 0x7002/3.

This lab works directly on the pure simulator or under the control of the BUFFALO monitor.

Lab 2 (LCD display and byte-ascii conversion)

This lab implements the following pseudo-code:

      p = 3
      q = 4
      tenths = 50
      while(true) {
          sum = p + q
          displayLCD(p " + " q " = " sum) //p, q and ans displayed in Hex
          increment p
          increment q
          wait tenths/10 seconds  //i.e. default 5 seconds
     }

The values of p and q are stored at locations 0x7000 and 0x7001 respectively. The delay time "tenths" is stored at 0x7002.

Lab 3 (Battery and Bumper displays)

This lab uses the Analog-Digital subsystem to measure the battery voltage and the bow and stern bumper states continuously on the LCD display.

The format of the LCD display is:


Bow: * Stern: *
Battery: ~# . @

        Where:
                * = 'Y' (hit), 'N' (not hit) or '?' (invalid voltage)
                ~ = Battery tens of volts
                # = Battery volts
                @ = Battery tenths of volts

Using the simulator's graphical user interface, the user can change the battery voltage with the Channel 1 slider on the ADC window. The bumper states can be changed either by using the ADC sliders (Channel 3 for Bow; Channel 4 for Stern) or by clicking on the bumper state buttons in the Robot window.

Lab 4 (Motor control, 6811 Timer and TOF interrupts)

This lab controls the state (on or off) and direction (forward or reverse) of the two eeBot motors. The lab is organized into 3 parts. At all times the LCD display indicates the current status of the motors and the lab part being executed in the following format:

Port: *  Star: *
PART ?
Where:
* = 'F' (On-FWD), 'R' (On-REV) or '-' (OFF)
? ='1' OR '2' or '3'

In Part 1 the motors are initiazed as OFF. After a software delay loop of 2 seconds, both motors are turn ON in the FWD direction. After an additional software delay of 5 seconds, the starboard motor is set to the REV direction. Finally, after an additional 3 seconds, both motors are turned OFF.

Part 2 simply waits until any bumper is hit. Users click either Robot bumper button (or modify the appropriate ADC analog voltage) to continue to Part 3.

Part 3 changes motor states/directions using TOF interrupt driven alarms. The behavior is much like Part 1 (although the sequence of states differs); the big difference is that interrupts are used to perform timing.

The sequence of states in Part 3 is:

  1. After 3 seconds, both motors ON FWD.
  2. After 2 seconds, both motors ON REV.
  3. After 4 seconds, Starboard ON-FWD, Port ON-REV
  4. After 5 second, Starboard ON-FWD, Port OFF
  5. After 2 second, both motors OFF

Last modified: Tue Nov 26 13:33:22 Eastern Standard Time 2002