Texas Instruments MSP430x1xx User Manual
Page 211

Timer_B Registers
11-35
Timer_B
Table 11–9. Capture/Compare Control Register Capture Mode
Bit
Value
Capture Mode
Description
0
Disabled
The capture mode is disabled.
1
Pos. Edge
Capture is done with rising edge.
2
Neg. Edge
Capture is done with falling edge.
3
Both Edges
Capture is done with both rising and falling edges.
Note:
Simultaneous Capture and Capture Mode Selection
Captures must not be performed simultaneously with switching from
compare to capture mode. Otherwise, the result in the capture/compare reg-
ister will be unpredictable.
The recommended instruction flow is:
1) Modify the control register to switch from compare to capture.
2) Capture
For example:
BIS #CAP,&CCTL2
; Select capture with register CCR2
XOR #CCIS1,&CCTL2
; Software capture:
CCIS0 = 0
;
Capture mode = 3
11.6.4 Timer_B Interrupt Vector Register
Two interrupt vectors are associated with the 16-bit Timer_B module:
-
CCR0 interrupt vector (highest priority)
-
TBIV interrupt vector for flags CCIFG1–CCIFGx and TBIFG.
11.6.4.1 CCR0 Interrupt Vector
The interrupt flag associated with capture/compare register CCR0, as shown
in Figure 11–30, is set if the timer value is equal to the compare register value.
Figure 11–30.Capture/Compare Interrupt Flag
D
Q
Reset
Set
CCIE0
Timer Clock
CAP
EQ0
TBCL0 = Timer
Capture
IRQ, Interrupt_Service_Requested
IRACC, Interrupt_Request_Accepted
Capture/compare register 0 has the highest Timer_B interrupt priority, and
uses its own interrupt vector.