In our Group Project Task3, we went through the source code of tmr-ints.c (blinking LED). The most difficult part of Task3 is the concept of the interrupt. Again, you play the role of the instructor of CPSC440. You need to write an essay to explain the concept of interrupt using the example of tmr-ints.c in such a way that your students can learn the concept from you. In your essay, you also assume that there are some questions from your students (see below for the questions). You need to respond to those questions at the end of your essay.
In our Group Project Task3, we went through the source code of tmr-ints.c (blinking LED). The most difficult part of Task3 is the concept of the interrupt. Again, you play the role of the instructor of CPSC440. You need to write an essay to explain the concept of interrupt using the example of tmr-ints.c in such a way that your students can learn the concept from you. In your essay, you also assume that there are some questions from your students (see below for the questions). You need to respond to those questions at the end of your essay.
FAQ:
- It seems to me that LDR instruction is important. Should I pay more attention to it?
Yes. You should. The link provided above has a very important sentence at the bottom of the page, as shown below:
”For word loads, Rt can be the PC. A load to the PC causes a branch to the address loaded.”
2. I am not the instructor of CPSC440, and it is hard for me to play that role. I need some help. May I have some hints?
The key is the transfer of control that eventually reaches void tmr0_isr(void), located at line 59 of tmr-ints.c. The chain of what happens starts from the timer 0 and goes the following way:
Timer0 (counting of the timer hardware reaches 0) -> Table of Exception Vectors -> void irq(void), Line 53 of isr.c -> if (tmr_isr_funcs[0] != 0) { (tmr_isr_funcs[0])(); }, Line 64 of isr.c -> eventually void tmr0_isr(void), Line 59 of tmr-ints.c
During the same time, the while (1) in the main program of tmr_ints.c still runs continuously.
In this problem, we assume there are questions from students. What are the questions? The questions asked by your students are:
- “Is this stuff you taught (i.e., a hardware event that triggers the execution of a software function while the main part of the program still runs continuously) related to the Event-Driven
Programming ?” - “I heard the callback function quite often but didn’t quite understand it. Does this stuff you taught related to the callback function?”
You need to google the terms (even driven program and callback) first and answer yes or no to the questions. Again, you play the role of a professor. After your yes answer, you need to help your students connect the concept we learned in Task 3 to the concept of event-driven programming (and callback). If your answer is no, you need to explain why they are not related).
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images