EECS 373 Lab 4: Interrupts - Answer Sheet

Name and Unique Names

 

 

 

Questions

Attach a screenshot (using camera) of a bouncing switch.

 

 

 

Explain in a few sentences how the synchronization block synchronises the input switch.

 

 

 

Why are we triggering on the negative edge of the Switch, and not the positive?

 

 

 

Explain what exactly these two functions do, and where they are defined. Give the memory address of potential registers that get written or reset, including bit indexes of the bits that get changed.

 

 

 

Pause your debugging session and add a breakpoint to one of the interrupt service routines. Resume the operation and hit one of the switches. Your debugger should stop right at your breakpoint. Inspect the disassembled code. Which registers are used by the interrupt routine? And what does the __attribute__ ((interrupt)) do?

 

 

 

Explain in two sentences why we have a text "Wait For Interrupt" in between every interrupt service routine.

 

 

 

Perform 10 latency measurements. What is the mean time and standard deviation of your measurements?

 

 

 

Perform 10 latency measurements of your new code. What is the mean time and standard deviation of your measurements? Explain the behavior in two sentences.

 

 

 

Explain in a few sentences what the MSS_GPIO_* functions exactly do. Especially, which registers do they modify? What other functions are provided by the MSS_GPIO drivers? List all of them with one sentence per function explaining its purpose.

 

 

 

Run the application you just wrote on your board and connect a serial terminal to the serial port. Push the switch several times. Which of the two interrupts fires first? Compare it to your answer that you just wrote down. Explain in two sentences why this interrupt gets handled before the other one.

 

 

 

Explain in two sentences which specific registers you modified by using NVIC_SetPriority and NVIC_EncodePriority.

 

 

 

Explain the output. What happened? And why is the string the same, even though that we have two different printf functions?

 

 

 

Explain at least two methods on how to avoid this problem.