7 Solved Questions on Microprocessor and Digital System | ECE 331, Study notes of Electrical and Electronics Engineering

prep 9 Material Type: Notes; Professor: Mahapatra; Class: Microprocessors & Digital Sys; Subject: Electrical & Computer Egr; University: Michigan State University; Term: Fall 2015;

Typology: Study notes

2015/2016

Uploaded on 01/11/2016

joshlynnkern
joshlynnkern 🇺🇸

11 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
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
pf2

Partial preview of the text

Download 7 Solved Questions on Microprocessor and Digital System | ECE 331 and more Study notes Electrical and Electronics Engineering in PDF only on Docsity!

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

p. 2

  1. What is an interrupt vector? Where is it stored and what is stored there? Interrupt vectors are a block of addresses assigned in ROM. Each vector stores the ROM address where program execution should begin (jump to) when a given exception occurs.
  2. When an interrupt occurs, how does the KL25Z controller indicate which interrupt source is being serviced? In other words, how could you check, during debug, what interrupt occurred? The best way would be to look at the ISR_NUMBER bits of the PSR (program status register), which is an 8-bit code that specifics the currently active exception. You could also check the address of program execution from the PC and determine which handler or ISR routine was currently being executed by comparing the PC address to interrupt vector addresses.
  3. How would an ASM program implement a global disable of all peripheral interrupt sources? The CPSID I instruction will disable all maskable peripheral interrupt sources.
  4. What is the function of the Nested Vectored Interrupt Controller within the ARM controller? The NVIC manages tasks during Handler mode including automated interrupt actions such as preserving the CPU state, negotiating interrupt priority, and tail-chaining of multiple interrupt sources.