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

This preview shows page 1 out of 3 pages.

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

Unformatted text preview:

CS/EE 3720 Handout #2Spring 2004MyersLAB #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 before the start of the next lab. NO LATELAB REPORTS WILL BE ACCEPTED.1 Objectives• Learn how to use a simple simulator 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 3 as possible before thelab.1. Simulate the count a.asm program from Lab 1 using the Wookie simulator.2. Assemble, load, and run the lab2.asm program. Use the oscilloscope to observe characters asthey are echoed.3. Extend the SCI receive interrupt handler in the program lab2.asm to buffer characters. Usecarriage-returns and a max buffer size 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)• load e1.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 purchase 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 cre ated 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 speed by clicking on the red s toplight button. When single-stepping,how do you get past the long busy wait?2. 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 before proceeding with the next step. (Use”Disconnect” on the ”Call” menu, if necessary.)(b) Using AS11 and DL11, as se mble 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 connected. The TX signal can be p ermanentlyconnected to the serial cable, since it won’t affect the boot behavior.(c) Using Hyperterminal, type some characters. This should force the program to openCOM1, transmit the characters, and display any received characters. If you’ve set upHyperterminal program as recommended, your typed characters will not be echoed byHyperterminal directly; they will only be displayed if they are echoed by the device atthe the other end of the serial cable. In fact, the lab2.asm program does echo characters,so you should see characters displayed as you type.(d) Using both channels of the oscilloscope, probe the RxD and TxD signals on the 68hc11.Observe the delay between the characters received by the 68hc11 and the echoed char-acters. Type the numbers 0 through 9, and notice how the pattern on the oscilloscopechanges.3. Extend the SCI receive interrupt handler in the program lab2.asm to buffer characters andinterpret commands.(a) Study the lab2.asm code carefully to make sure you understand how the transmit buffercommand works. Note that it is interrupt-driven, and contains no busy waits.(b) Copy the lab2.asm program to a new ”shell.asm” file. Add code where you see the word”Pending” (and modify code if necessary) to implement the following requirements:i. The shell will accept commands of up to 16 characters.ii. Commands are terminated by a carriage-return.iii. A 17th transmitted character will terminate the command as if it were a carriage-return.iv. The ”Q” command will cause the LEDs to turn off until a ”U” or ”D” command isreceived.v. The ”U” command will cause the LEDs to count up.vi. The ”D” command will cause the LEDs to count down.vii. A command s tarting with ”Q”, ”U”, or ”D” may be treated as a ”Q”, ”U”, or ”D”command, respectively.viii. Any command


View Full Document

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

Course: Ece 3720-
Pages: 3
Download A Command Prompt Shell for the 68HC11
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 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 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?