Due: Oct. 28, 2008
Write a program to take single byte input data in the range of $00…$0F and print the corresponding character on the serial port. Print only one character from 0….F. In order to accomplish this, you have to include a routine to convert the input byte into the corresponding ASCII code.
Include that routine into the keypad scan routine such that (the ASCII code representing) the key that is pressed get’s printed on the serial port.
Page 85 of DBug12Manual.pdf contains DBug 12 functions ($EE84, $EE86, $EE9C) that we can use for purposes of getting and putting characters over serial I/O.
Page 400 of 9S12DP256 Processor.pdf discusses serial interface details.
Page 406 of 9S12DP256 Processor.pdf gives the data format diagram.
RDRF is basically the indicator when data is available on the serial interface.
****************************************************************************** ************************* Put Character to Serial **************************** ****************************************************************************** PChar: BRCLR SCI0SR1, $80, Pchar ; loop until transmit data register STAB SCI0DRL ; Send Character RTS ; Return from subroutine ****************************************************************************** ************************ Get Character From Serial *************************** ****************************************************************************** GChar: BRCLR SCI0SR1, $20, GChar ; Loop until receive data register LDAB SCI0DRL ; Receive Character RTS ; Return from subroutine
| Attachment | Size |
|---|---|
| ASCII DBug12.asm | 2.86 KB |
| EE 3362 HW5 _ PROJ2.doc | 23.5 KB |
Comments
Post new comment