Texas Instruments MSP430x1xx User Manual
Page 282

Comparator_A in Applications
14-16
14.4.4 Comparator_A Used to Detect a Current or Voltage Level
Comparator_A can be used to detect current or voltage levels if they are below
or above a reference level (shown in Figure 14–12). The reference level can
be selected from the internal reference-voltage generator, or by applying an
external reference level. Application software can poll the CAOUT bit for the
status of the comparator, or use the interrupt flag CAIFG to determine if the
level of the current or voltage source has crossed the comparator threshold.
In Figure 14–12, two external voltages are compared. Application software
can poll the CAOUT bit:
CAOUT = 0: V(signal < V(ref)
CAOUT = 1: V(signal > V(ref)
Figure 14–12. Detect a Voltage Level Using an External Reference Level
_
+
0
1
CAF
Set
CAIFG
τ
∼
2
µ
s
0
1
0
1
0
1
0
1
CA0
CA1
0
1
P2CA0
P2CA1
VCAREF
CARSEL
0
2
1
3
3 2 1 0
CAREF
0.5
×
VCC
0.25
×
VCC
V
Signal
Voltage
V
Reference
Voltage
1
0
CAEX
CAON
VCC
0 V
1
0
CAON
VCC
0 V
1
0
e.g.
Capture
Input of
Timer_A
CAOUT to
External Pin