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

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

Pre 2010

Uploaded on 08/19/2009

koofers-user-3fp
koofers-user-3fp 🇺🇸

10 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
EE3376 – Embedded Systems - Spring 2008 - Exam 2 – MacDonald – Page 1
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 the
result(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.
pf3

Partial preview of the text

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

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

MAIN CODE ISR

rti_isr: ldaa $ coma inca

staa $3000 RTI IRQ occurs here staa $

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 $