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.
The labs are provided only in object format (i.e
*.s19
files). You can run or single step the
labs; obviously, you can disassemble any lab by
single-stepping it. This makes it possible to
reverse-engineer the lab and re-create a reasonable
facsimile of its original source code. This is strongly
discouraged: it would be very tedious to do; it would be
evident; and the sample labs are slightly different from the
official ones.
All of the labs have been coded so that the first executable instruction is at address 0x6000, the default initial PC value for the simulator.
All of the labs have been coded to run on the raw 6811 hardware simulator. However, some labs (such as ones that set interrupt vectors) are coded differently when they are run under the control of the BUFFALO monitor.
For example, the TOF interrupt vector is defined by the 6811
hardware to be at address 0xFFDE/F
(normally in
ROM). However, the BUFFALO monitor uses Soft
Vectors (in RAM).
Labs that may use features of the BUFFALO monitor are
identified with the BUFFALO
qualifier.
All of the labs (except for Lab1) have been coded using the general pattern of performing global initialzations and then performing the actual requirements of the lab. The most common pattern used is:
org $6000 main: jsr init forever: . ;do the real work jmp forever init: ;do initializtion stuff rts ; RAM global variables org 0x7000 . ;include files #include <stdio.asm> #include "../lib/motors.asm"
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.
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.
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.
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:
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: