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 TCB peripheral
that was configured in Ex
Find the vector number and name that correspond to the TCB CAPT
interrupt. x TCBINT
Refer to datasheet Section Interrupt Vector Mapping on p
Find the corresponding vector definition in "iotnh This will
look like vect and should correspond to the vector number
identified in step TCBINTvect VECTOR
Declare an ISR using the ISR macro syntax, where
is the vector definition identified in step
If the stopwatch is currently counting, increment the "elapsedtime"
variable by Ensure that this variable does not exceed the value
which represents s iexFF s
Update the segment display to reflect the value of "elapsedtime".
Acknowledge that the interrupt has been handled by clearing the CAPT
bit in the TCBINTFLAGS register.
Refer to datasheet Section Interrupt Flags on p for
information on how to clear this bit.
NOTE: You may use displayhex to display a number in hexadecimal on
the segment display. This function accepts an unsigned bit integer.
NOTE: As this interrupt is invoked every th of a second, the value in
"elapsedtime" will not represent a count of ths of a second.
You will need to use the following relationship to display the correct
value on the segment display:
second second
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
