

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
Solutions to problems from the embedded systems exam 2 held in spring 2006 by macdonald. The problems involve writing polling subroutines, handling interrupts, and initializing pwm peripherals.
Typology: Exams
1 / 3
This page cannot be seen from the preview
Don't miss anything!


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).
clrainca rti_isr: ldaaldab $3000$
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 $