
Timer_A Operation
11.2.6.2.1 TAxIV Software Example
The following software example shows the recommended use of
and the handling overhead. The
TAxIV value is added to the PC to automatically jump to the appropriate routine. The example assumes a
single instantiation of the largest timer configuration available.
The numbers at the right margin show the necessary CPU cycles for each instruction. The software
overhead for different interrupt sources includes interrupt latency and return-from-interrupt cycles, but not
the task handling itself. The latencies are:
•
Capture/compare block TA0CCR0: 11 cycles
•
Capture/compare blocks TA0CCR1, TA0CCR2, TA0CCR3, TA0CCR4, TA0CCR5, TA0CCR6:
16 cycles
•
Timer overflow TA0IFG: 14 cycles
; Interrupt handler for TA0CCR0 CCIFG.
Cycles
CCIFG_0_HND
;
...
; Start of handler Interrupt latency
6
RETI
5
; Interrupt handler for TA0IFG, TA0CCR1 through TA0CCR6 CCIFG.
TA0_HND
...
; Interrupt latency
6
ADD
&TA0IV,PC
; Add offset to Jump table
3
RETI
; Vector
0: No interrupt
5
JMP
CCIFG_1_HND
; Vector
2: TA0CCR1
2
JMP
CCIFG_2_HND
; Vector
4: TA0CCR2
2
JMP
CCIFG_3_HND
; Vector
6: TA0CCR3
2
JMP
CCIFG_4_HND
; Vector
8: TA0CCR4
2
JMP
CCIFG_5_HND
; Vector 10: TA0CCR5
2
JMP
CCIFG_6_HND
; Vector 12: TA0CCR6
2
TA0IFG_HND
; Vector 14: TA0IFG Flag
...
; Task starts here
RETI
5
CCIFG_6_HND
; Vector 12: TA0CCR6
...
; Task starts here
RETI
; Back to main program
5
CCIFG_5_HND
; Vector 10: TA0CCR5
...
; Task starts here
RETI
; Back to main program
5
CCIFG_4_HND
; Vector 8: TA0CCR4
...
; Task starts here
RETI
; Back to main program
5
CCIFG_3_HND
; Vector 6: TA0CCR3
...
; Task starts here
RETI
; Back to main program
5
CCIFG_2_HND
; Vector 4: TA0CCR2
...
; Task starts here
RETI
; Back to main program
5
CCIFG_1_HND
; Vector 2: TA0CCR1
...
; Task starts here
RETI
; Back to main program
5
348
Timer_A
SLAU272C – May 2011 – Revised November 2013
Copyright © 2011–2013, Texas Instruments Incorporated