Texas Instruments MSP430x1xx User Manual page 228

Texas instruments modules and peripherals user's guide
Table of Contents

Advertisement

Timer_A Operation
TAIV Software Example
The following software example shows the recommended use of TAIV and the
handling overhead. The TAIV value is added to the PC to automatically jump
to the appropriate routine.
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:
-
-
-
; Interrupt handler for TACCR0 CCIFG.
CCIFG_0_HND
;
; Interrupt handler for TAIFG, TACCR1 and TACCR2 CCIFG.
TA_HND
TAIFG_HND
CCIFG_2_HND
CCIFG_1_HND
11-18
Timer_A
Capture/compare block TACCR0
Capture/compare blocks TACCR1, TACCR2
Timer overflow TAIFG
...
; Start of handler Interrupt latency
RETI
...
ADD
&TAIV,PC
RETI
JMP
CCIFG_1_HND ; Vector 2: TACCR1
JMP
CCIFG_2_HND ; Vector 4: TACCR2
RETI
RETI
...
RETI
...
RETI
...
RETI
11 cycles
16 cycles
14 cycles
; Interrupt latency
; Add offset to Jump table
; Vector 0: No interrupt
; Vector 6: Reserved
; Vector 8: Reserved
; Vector 10: TAIFG Flag
; Task starts here
; Vector 4: TACCR2
; Task starts here
; Back to main program
; Vector 2: TACCR1
; Task starts here
; Back to main program
Cycles
6
5
6
3
5
2
2
5
5
5
5
5

Advertisement

Table of Contents
loading

Table of Contents