ES333 Tut5
ES333 Tut5
ES333 Tut5
Tutorial - 5
Tutorial on Interrupts
12.4.2019
Reference Manual:
http://infocenter.arm.com/help/topic/com.arm.doc.dui0497a/DUI0497A_cortex_m0_r0p0
_generic_ug.pdf
1. Mention the function of Wakeup Interrupt Controller and how does it affect how
interrupts are handled in ARM.
2. Compare level and pulse (or edge) sensitive interrupts. What are the issues with level-
sensitive interrupts?
3. When does an interrupt become “pending?”
4. Interrupt processing happens in the following steps:
5. What happens if the (asynchronous) interrupt occurs when LDM (or MULS) instruction
was being executed?
6. What value is stored in the LR register when the processor enters in to the handler
mode?
7. We would like to configure a KL25Z MCU so that if interrupts IRQ0, IRQ10 and
IRQ31 are requested simultaneously, the CPU responds by servicing IRQ10 first, then
IRQ0, and finally IRQ31. Write the C code using CMSIS functions to configure the
MCU.
8. We wish to enable IRQ13 but disable IRQ24. What value needs to be loaded into which
register bits, and what is the CMSIS code call to accomplish the same?
9. Consider the code below. The code below clears the status flags for all bits in Port D’s
interrupt status flag register. Under what circumstances might this lead to incorrect
system operation.
void PORTD_IRQHandler(void) {
// Read switches
10. [To be submitted online, will be graded] Consider the schematic shown below.
Write a code which executes an ISR when the switch is pressed. In the main program
all the LED blinks together, but in ISR LEDs follow a pattern: R-> G-> B . Write
both main and ISR.