DOC PREVIEW
U of U ECE 3720 - A Command Prompt Shell for the 68HC11 Handout
Pages 4

This preview shows page 1 out of 4 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 4 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 4 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

CS/EE 3720 Handout #2Spring 2006MyersLAB #2: A Command Prompt Shell for the 68HC11Lab writeup is due to your TA at the beginning of your next scheduled lab. Don’t put this off tothe last minute! There is pre-lab work to complete b efore the start of the next lab. NO LATELAB REPORTS WILL BE ACCEPTED.1 Objectives• Learn how to use a couple simulators for the 68hc11.• Gain experience with interrupt handlers and serial interface drivers.• Complete a 68hc11 command prompt shell that will be useful for future labs.2 TasksNote: In order to use lab time efficiently, try to complete as much of Task 4 as possible before thelab.1. Simulate the count a.asm program from Lab 1 using the Wookie simulator.2. Simulate the count a.asm program from Lab 1 using the TExaS simulator.3. Assemble, load, and run the lab2.asm program. Use the oscilloscope to observe characters asthey are echoed.4. Extend the SCI receive interrupt handler in the program lab2.asm to buffer characters. Usecarriage-returns and a max buffer s ize of 16 to terminate commands. Interpret ”U”, ”D”, and”Q” commands to make the LED counter count up, count down, and turn off, respectively.3 Resources (available in lab)• Lab2.asm source code (download source from course website)• The Wookie 68HC11 simulator (download executable from course website)• Hyperterminal (available at http://www.hilgraeve.com/htpe/)• RS232/TTL converter cable (from www.kevinro.com). Available for checkout.• For PCs with D25 serial connectors, a D25-D9 adapter is required.• Bench cable set. Available for checkout.• AS11.exe assembler (download executable from course website)• DL11.exe loader (download executable from course website)• loade1.bat batch file (download batch file from course website)• Test program to count on port A (download source from course website)Students should also bring a diskette for saving work completed during the lab.4 Parts (available for pur chase in lab)Should have your 68HC11 microcontroller circuit from Lab 1 working, since this will be usedextensively in Lab 2.5 ProceduresSee Lab 1 for procedures on using AS11 and DL11.1. Set up the Wookie simulator to run the Count a.asm program.(a) Make sure the Wookie simulator is available on your lab PC. (If not, create a D:\Wookiedirectory and place the executable there.)(b) Using an MS-DOS command prompt, execute the command:”as11 count a.asm -l > count a.lst”to create an .s19 file and a .lst file.(c) Launch the Wookie simulator.(d) On the File menu, select ”Load .s19 File...”. Find and open your ”count a.s19” file. Inthe ”Set HC11 Mode” dialog box that pops up, choose ”Rug Warrior Bootstrap”. Don’tworry about the start address.(e) Click on the ”View Code” button.(f) On the ”Code View” window, click on ”Load LST File”.(g) Find and select the ”count a.lst” file that you created using AS11.(h) In the ”Choose LST File Format” dialog box, select ”AS11M”. Leave the offset as it is.(i) Move and resize the ”Code View” window as necessary.(j) Click on the ”M68HC11 CPU” button. Move the ”MCU” window to a convenient place.(k) In the ”MCU” window, click on PC, and push Modify. Set the PC (program counter)to the address of the first instruction in your program.(l) Press the single-step button (with the picture of the walking man) to step through thecode. The highlighted line in the ”Code View” window should change, and the registersin the ”MCU” window should update appropriately.(m) Experiment with the simulator features. Notice which instructions affect the N, Z, V,and C flags in the CCR (condition code register). Display Port A, and simulate theprogram at full s peed by clicking on the red stoplight button. When single-stepping,how do you get past the long busy wait?2. Use the TExaS simulator to run the Count a.asm program.(a) Insert the CD that comes with the textbook, and watch the movie named README inthe root directory of the CD. This movie is a tutorial of how to use TExaS.(b) If you are working on your own c omputer, then you should next install and upgradeTExaS. To install run setup.exe in the TExaS subdirectory, then follow the link on thecourse website and download the upgrade zip file.(c) Start up the TExaS simulator which should be located under: start → programs → TestExecute and Simulate → microcomputer simulator.(d) Select File → Open, select all files from the list of types, and browse to find where yousaved count a.asm, and open it.(e) Find the line:ldaa #$80And change it to:Go ldx #$80This creates a label for the start of your program.(f) Find the line:ldx #$F000And change it to:ldx #$000FThis will reduce the delay to something shorter otherwise the simulation takes a verylong time.(g) Finally go to the bottom of your file, and add these two lines:org $FFFEfdb GoThis makes your program start at the label Go on reset.(h) Select File → New, then select microcomputer.(i) In the new window, click on registers to see the register values.(j) Select File → New, then select I/O device.(k) While in this new window, select IO → LED.(l) In the new window, enter PA4 through PA7 in the port fields and press OK to createfour LEDs.(m) Go back to your assembly code window, and select Assemble → Assemble.(n) Check the window labeled TheList to make sure that there were no errors.(o) Select Action → Go.(p) Use the Window menu to go look at each window to see what happens during thesimulation.(q) When you are done, select Action → Halt.(r) Continue to play around with the simulator till you are comfortable with it.3. Run and test the lab2.asm program on your 68hc11 circuit.(a) First, launch the Hyperterminal program. Use ”Properties” on the File menu to config-ure this program for:COM1, 9600 bits per second, 8 data bits, no parity, 1 stop bit, no flow control. Under”ASCII Setup” deselect everything except ”Wrap lines that exceed terminal width”.Make sure Hyperterminal is not connected b e fore proceeding with the next step. (Use”Disconnect” on the ”Call” menu, if necessary.)(b) Using AS11 and DL11, as semble and load the lab2.asm program on your 68hc11 circuit.After the program is loaded, you’ll need to disconnect the serial cable in order to bootyour program. Once the program is running (your LEDs on Port A should count),reconnect the serial cable. This process can be simplified by using a DIP switch to controlwhether the RX signal of the 68hc11 is


View Full Document

U of U ECE 3720 - A Command Prompt Shell for the 68HC11 Handout

Course: Ece 3720-
Pages: 4
Download A Command Prompt Shell for the 68HC11 Handout
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view A Command Prompt Shell for the 68HC11 Handout and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view A Command Prompt Shell for the 68HC11 Handout 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?