Question: Q3 Provide code that implements an interrupt service routine every 20 milliseconds using timer 1. You may assume that the microcontroller is using a 40MHz

Q3 Provide code that implements an interrupt service routine every 20 milliseconds using timer 1. You may assume that the microcontroller is using a 40MHz SYS_FREQ and that PB_DIV=2. Provide comments to explain what each line does. Your ISR need only clear the interrupt flag and set a variable called tick_flag that has already been declared and initialised to zero. Provide code that initialises the timer and interrupt systems. The ISR has a function prototype of type:

void __ISR(_TIMER_1_VECTOR, ipl2) yourhandler(void);

should be used to contain the code for your interrupt service routine.

Provide code for an interrupt service routine and an initialisation routine that allows use of timer2 and timer 3 to provide a 5 second interrupt.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!