
p. 1
ECE 331 Preparation Exercise 9 Solutions
Please refer to Module 8 course notes to answer the following questions.
1. Five synchronization methods were covered in class, Blind cycle, Busy-wait, Interrupt, Periodic polling, and
DMA. Which of these best matches the characteristics below.
a) useful for tasks that need interrupt but no interrupt source exists
Periodic polling
b) is most wasteful of processor resources
Blind cycle
c) transfers data from peripheral device without any software assistance
DMA
d) generates a break in software execution
Interrupt
e) checks flag to determine when a task is complete
Busy-wait
2. Reset, Fault, Non-maskable interrupt (NMI), and Interrupt are general types of exceptions. Which of these
best matches the characteristics below. Some answers may be used more than once.
a) provides asynchronous communication with peripheral devices
Interrupt
b) associated with errors discovered while a program is executing
Fault
c) can be disabled and assigned priority
Interrupt
d) forces program execution to restart from beginning of code
Reset
e) has highest priority other than Reset
NMI
3. List the 7 steps of the hardwired exception processing implemented by the KL25Z. As you list these, make
sure you understand what each of them does. The purpose of this problem is to encourage you to study
this element of microcontroller operation, not just to keep you busy copying information from the course
notes.
1. Finish current instruction
2. Push CPU registers onto stack
3. Switch to handler/privileged mode
4. Load PC with address of exception handler
5. Load LR with EXC_RETURN code
6. Load IPSR with exception number
7. Start executing code in exception handler