Timer_B Operation
16-19
Timer_B
TBIV, Interrupt Handler Examples
The following software example shows the recommended use of TBIV and the
handling overhead. The TBIV value is added to the PC to automatically jump
to the appropriate routine.
The numbers at the right margin show the necessary CPU clock 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 CCR0
11 cycles
-
Capture/compare blocks CCR1 to CCR6
16 cycles
-
Timer overflow TBIFG
14 cycles
The following software example shows the recommended use of TBIV for
Timer_B3.
; Interrupt handler for TBCCR0 CCIFG.
Cycles
CCIFG_0_HND
...
; Start of handler Interrupt latency
6
RETI
5
; Interrupt handler for TBIFG, TBCCR1 and TBCCR2 CCIFG.
TB_HND
...
; Interrupt latency
6
ADD
&TBIV,PC
; Add offset to Jump table
3
RETI
; Vector 0: No interrupt
5
JMP
CCIFG_1_HND
; Vector 2: Module 1
2
JMP
CCIFG_2_HND
; Vector 4: Module 2
2
RETI
; Vector 6
RETI
; Vector 8
RETI
; Vector 10
RETI
; Vector 12
TBIFG_HND
; Vector 14: TIMOV Flag
...
; Task starts here
RETI
5
CCIFG_2_HND
; Vector 4: Module 2
...
; Task starts here
RETI
; Back to main program
5
; The Module 1 handler shows a way to look if any other
; interrupt is pending: 5 cycles have to be spent, but
; 9 cycles may be saved if another interrupt is pending
CCIFG_1_HND
; Vector 6: Module 3
...
; Task starts here
JMP
TB_HND
; Look for pending ints
2
Содержание MSP430x4xx Family
Страница 1: ...MSP430x4xx Family 2007 Mixed Signal Products User s Guide SLAU056G ...
Страница 2: ......
Страница 6: ...vi ...
Страница 114: ...3 76 RISC 16 Bit CPU ...
Страница 304: ...5 20 FLL Clock Module ...
Страница 340: ...7 8 Supply Voltage Supervisor ...
Страница 348: ...8 8 16 Bit Hardware Multiplier ...
Страница 372: ...9 24 32 Bit Hardware Multiplier ...
Страница 400: ...10 28 DMA Controller ...
Страница 428: ...13 10 Basic Timer1 ...
Страница 466: ...15 24 Timer_A ...
Страница 522: ...17 30 USART Peripheral Interface UART Mode ...
Страница 544: ...18 22 USART Peripheral Interface SPI Mode ...
Страница 672: ...23 12 Comparator_A ...
Страница 692: ...24 20 LCD Controller ...
Страница 746: ...26 28 ADC12 ...