



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Lab; Class: MICRO BASED SYS DES; Subject: ENGINEERING: ELECTRICAL; University: Florida State University; Term: Fall 2004;
Typology: Lab Reports
1 / 6
This page cannot be seen from the preview
Don't miss anything!




In this lab, you will learn how to use THRSIM11 to simulate HC11 programs at home for purposes of homework assignments, projects, and lab assignments, in such a way that they will be able to run on the actual hardware when you bring them into the lab.
See the previous lab assignments.
At the conclusion of this lab session, you should be able to: Configure THRSIM11 to match a particular board configuration. Operate the HC11 processor in emulation under the THRSIM environment. Interact with serial-I/O HC11 programs running under THRSIM11. Assemble, download, and run the Buffalo ROM monitor under THRSIM. Use I/O subroutines built into the Buffalo code. Write a new “Hello World” program using the Buffalo subroutines. Step through and debug a program under THRSIM.
Note! Most of this lab assignment you should complete by yourself or with friends at home, before coming in to the lab. The purpose of the actual in-lab session will be to validate your code—to confirm that it runs on the real hardware in the same way that it runs in simulation at home or at the computer labs. IMPORTANT: Take detailed notes in your lab notebook as you are going through the below process. If something goes wrong, this will help you (or your TA) trace back through your steps and figure out what you did wrong and how to fix it.
d. Compare the window contents with the memory map on p.12 of the CME11E9-EVBU manual. Note that initially, only one RAM (at $0000:01FF) and one ROM ($D000:FFFF) are checked off as “enabled.” e. Recall from the previous labs (or by looking at the original “hello.asm” source code) where our program was originally loaded. Is this region included in the memory that the simulator is presently configured to use? f. Enable a new RAM region that encompasses the entire range of addresses spanned by the 32K RAM chip in U5. (Don’t worry that the HC configuration registers are mapped to the middle of this range. They will automatically take priority.) g. Also, enable a new ROM region that corresponds to the HC11 internal EEPROM. h. Finally, make sure that the LCD is enabled and that it is mapped to the correct location in the Peripheral area. i. Say “OK” and THRSIM11 should start back up.
should see the familiar bytes including the “Hello World” string once it is properly loaded. b. Alternatively, send a “load t” command in the serial transmitter window, then copy and paste the contents of the hello.s19 file. Reset the emulator to regain control.
f. Your program may or may not work the first time. In either case, we are going to step through the program to see exactly what happens. Do the following: i. Stop the simulated processor; reset it if necessary. ii. In the .LST window (Assembly output window) for your program in THRSIM, click on the first executable line. It should get highlighted in grey. iii. Click “Run Until…” (Toolbar, Execute menu, or F4). This should start your program running, except that execution will halt when you get to the selected line. iv. In Buffalo, invoke your program’s start address. v. The simulation should halt with the first line of your program highlighted in green. Now, you can step through your program. vi. Before executing each line, try to anticipate what effect it will have on the registers. Watch the CPU Register window to see if you are right. vii. At some point, you may get tired of single-stepping through the Buffalo internals and decide to return to your code. Select the last line of your code, and do Run Until again. (If you used the right instructions, the Buffalo routines should return to your program.) viii. Hit Run and let things get back to the Buffalo prompt. ix. If your program didn’t work or something happened that you don’t understand, bring your program in to lab and your TA will help you debug it. g. Bring the new .asm program that you created in to lab with you, on electronic media (floppy disk or USB flash drive) as well as on a paper printout.