

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 1, 2, and 3 from the embedded systems exam 2 held in spring 2008 by macdonald. Problem 1 involves writing a subroutine to initiate an 8-bit single conversion sequence on channel 7 and transfer the result to a memory location. Problem 2 deals with writing an interrupt service routine (isr) for the result transfer. Problem 3 requires writing a subroutine to initialize the pwm peripheral with two active channels and disabled others.
Typology: Exams
1 / 3
This page cannot be seen from the preview
Don't miss anything!


Student Name:______________________________ Student ID: _______________ Problem 1 Write a subroutine that will initiate an 8-bit single conversion sequence on channel 7, wait for the results to become valid (through polling) and then transfer theresult(s) into the location(s) at $2000.
Assume that the ATD is already powered-up (no need to enable core), that interrupts are disabled, that timing related input to the core is correct and that the precision is set correctly as well (i.e. 8 or 10 bits). Hint: Can be done in 4 instructions including RTS.
Student Name:_______________________________ Student ID: _______________ Problem 2
rti_isr: ldaa $ coma inca
rti
Table 1 Location Prior toCOMA in main codeAfter STAA Just Prior toRTI Just afterRTI reg A $ reg B $ reg D reg X $ reg Y $ Mem $2000 $ Mem $2001 $ Mem $3000 $ Mem $3001 $