Docsity

Embedded Systems Exam 2 - Spring 2006 - Problem Solutions, Exams of Microprocessors

Toggle sidebar
bg1
EE3376 โ€“ Embedded Systems - Spring 2006 - Exam 2 โ€“ MacDonald โ€“ Page 1
Student Name:______________________________ Student ID: _______________
Problem 1
A multi purpose sensor is connected to the HCS12 through an SCI port and
repeatedly (1 time every 5 seconds) sends two bytes of data to the microprocessor:
1) temperature (unsigned byte), and 2) humidity (unsigned byte).
Write a polling subroutine that will wait for each byte to arrive and store the values
in locations $2000 and $2001 respectively.
Assume the circuit is initialized and is working correctly to interface with the sensor
(i.e. correct baud rate, parity, etc.).
pf3

Partial preview of the text

Download Embedded Systems Exam 2 - Spring 2006 - Problem Solutions and more Exams Microprocessors in PDF only on Docsity!

Student Name:______________________________ Student ID: _______________ Problem 1 A multi purpose sensor is connected to the HCS12 through an SCI port and repeatedly (1 time every 5 seconds) sends two bytes of data to the microprocessor:1) temperature (unsigned byte), and 2) humidity (unsigned byte).

Write a polling subroutine that will wait for each byte to arrive and store the values in locations $2000 and $2001 respectively. Assume the circuit is initialized and is working correctly to interface with the sensor (i.e. correct baud rate, parity, etc.).

Student Name:_______________________________ Student ID: _______________ Problem 2 A section of the main program is running shown below and is in the middle of executing the inx instruction when a RTI periodic interrupt occurs.shown in below as well. Fill out the table describing register and memory values at The ISR is different points throughout the sequence. (Hint: create your own intermediate columns).

MAIN CODE ISR

clrainca rti_isr: ldaaldab $3000$

inx IRQ occurs here mul

ldy $2000 std $ rti Table 1 Location Prior toCLRA Just Prior toRTI Just afterLDY reg A $ reg B $ reg D reg X $ reg Y $ Mem $2000 $ Mem $2001 $ Mem $3000 $ Mem $3001 $