The purpose of this lab is to write a few assembly language programs and test them on the simulator and on your EVBU.
Pre-Lab
Make sure you have the programs clearly thought out and written down before you come to lab. You should put all your code starting at memory location 0x0100. You are encouraged to bring the programs in on disk.
The Lab
As in last week's lab you will write some programs in assembly language and run the programs on the HC11 simulator and the EVBU. There are several problems when running programs on the simulator. One is that the BUFFALO code present in the EVBU is not on the simulator. Another is that RAM and registers always contain values on the EVBU, but do not do so unless initialized in the simulator. We can fix these problems by loading BUFFALO into the simulator and initializing RAM and registers. The following tells you how to do that.
net use e: \\ timor\pclibThis will mount a disk which contains an S19 file of BUFFALO. (The disk is already mounted on computers running Windows 3.1).
cd e:\ee308
script e:ee308.scrto load BUFFALO and initialize RAM and registers.
Write and run the following programs:
Test your program both on the simulator and the EVBU. Report what happens to port B when you run this program on the simulator. Check that the port B lines are being asserted on your EVBU. (Use a logic probe to verify that the Port B lines are toggling.)
Check that your program works both on the simulator and the EVBU. Us the following data for your test:
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F |
000 | 00 | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 0A | 0B | 0C | 0D | 0E | 0F |
001 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 1A | 1B | 1C | 1D | 1E | 1F |
Test your program on the simulator and the EVBU.
Loading Programs into EEPROM
You can load programs into the on-chip EEPROM. When loaded in EEPROM your program will remain on your HC11 even after turning off power. Before loading your program into EEPROM, you must re-assemble it after instructing the assembler to start your code at address 0xB600.
The details of how to download your program into EEPROM are given in the Universal Evaluation Board User's Manual in Section 4.4.2. Basically, you will use BUFFALO to change the baud rate of the HC11 to 300 baud; then you will change the baud rate of your Windows Terminal to 300 baud, and download your program to the HC11. After your program is downloaded, you can change the baud rate of your Terminal back to 9600, and reset or power cycle your HC11 to restore 9600 baud communications. (Make sure BUFFALO confirms that your program has been downloaded before you reset your HC11.)
After the code is in the EEPROM, you can run it in one of two ways -- 1) From BUFFALO, set the program counter to 0xB600 and `g` (or `g B600`); or 2) Move jumper J2 from MONITOR to EEPROM, and reset or power-cycle the EVBU. (Note that if you run your program using method 2, you cannot easily re-enter BUFFALO to check the results of your program. We will use method 2 in later labs where we won't need to re-enter BUFFALO after running a program.)