Question: Declare an interrupt service routine ( ISR ) for the TCB 1 peripheral that was configured in Ex 7 . 0 . 1 . Find

Declare an interrupt service routine (ISR) for the TCB1 peripheral
that was configured in Ex 7.0.
1. Find the vector number and name that correspond to the TCB1 CAPT
interrupt. //250x32 TCB1_INT
Refer to datasheet Section 8.2 Interrupt Vector Mapping on p.63.
2. Find the corresponding vector definition in "iotn1626.h". This will
look like *_vect and should correspond to the vector number
identified in step 1. TCB1_INT_vect _VECTOR(25)
3. Declare an ISR using the ISR() macro syntax, where
is the vector definition identified in step 2.
4. If the stopwatch is currently counting, increment the "elapsed_time"
variable by 1. Ensure that this variable does not exceed the value
which represents 15.9375 s (i.e.,0xFF *1/16 s).
5. Update the 7-segment display to reflect the value of "elapsed_time".
6. Acknowledge that the interrupt has been handled by clearing the CAPT
bit in the TCB1.INTFLAGS register.
Refer to datasheet Section 22.5.5 Interrupt Flags on p.260 for
information on how to clear this bit.
NOTE: You may use display_hex() to display a number in hexadecimal on
the 7-segment display. This function accepts an unsigned 8-bit integer.
NOTE: As this interrupt is invoked every 64th of a second, the value in
"elapsed_time" will not represent a count of 16ths of a second.
You will need to use the following relationship to display the correct
value on the 7-segment display:
1/16 second =4*1/64 second

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!