



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
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Material Type: Notes; Professor: Giurgiutiu; Class: MICROCNTROLLRS MECH ENGR; Subject: Mechanical Engineering; University: University of South Carolina - Columbia; Term: Unknown 1989;
Typology: Study notes
1 / 5
This page cannot be seen from the preview
Don't miss anything!
a) Load REGBAS in reg. X b) Initialize BAUD= c) Initialize 8-bit word d) Initialize TE and RE Wait for the reception of a keystroke e) check if RDRF is set by loading SCSR into accA and AND with mask for RDRF, % You are here when reception data reg. is full f) Load SCDR into accB g) Store accB through Port B h) Branch back to (e) i) SWI
a) Press the RUN button. The program should loop on LABEL1 and exit the loop when the condition RDRF=1 is satisfy. This condition is checked with the mask %00100000. The mask is applied on the value found in SCSR. When bit 5 in SCSR is set, the mask senses it and the condition for exiting the loop is satisfied. b) Type the character T in the serial transmitter window and press Send. The character is sent to the MCU. The MCU takes a few laps to sense it. When the MCU senses it, the RDRF gets set, and the ‘check RDRF’ loop is exited. c) When the ‘check RDRF’ loop is exited, the program gets to the line LDAB SCDR,X This line is a breakpoint. At this moment, the screen looks like this:
e) Step again. The content of accB is stored in PORTB. Your screen looks like this: Note that the ASCII code for T, i.e., $54, appears in PORTB. f) Switch again to auto run. The program loops now again on LABEL1. Press again the send button in the serial transmitter. The character T is sent again, and after a few laps the program exits the loop and gets to the LDAB SCDR,X breakpoint. g) Run again automatically. Change the character in the serial transmitter to A. You will notice that the corresponding ASCII code, $41, appear in SCDR, and then, after manual steps, gets loaded in accB and stored in PORTB. WHAT YOU HAVE LEARNED In this example, you have learned: The use of serial communication interface (SCI) for reception The reception of a character through SCI New words and notations: RDRF, ASCII code.
EMCH 367 Fundamentals of Microcontrollers qkd4cw-818910-3288344-o-20example-sci-recept- doc.doc