250 8. ANALOG PERIPHERALS
Digital input value
switches are closed (1)
and which switches
remain open (0).
Figure 8.5: A sample 4-bit digital to analog converter. A digital input governs the positions of the
switches, which determine whether or not their corresponding voltage values with respect to the reference
voltage output values should contribute to the converter output value. The output of the converter is
typically connected to a low pass ﬁlter before being used to remove any sharp edges resulting from
switching from discrete voltage outputs of the converter.
(Comparator_B) and a successive approximation converter (ADC10 or ADC12). We describe each
in this section.
The comparator is the simplest form of the ADC converter in the MSP430 microcontroller. It
compares an input analog value to another analog value. The comparison voltage may be a reference
voltage, or it can be set to another external analog input signal. The comparator outputs either a
logic 1 or 0. Figure 8.6 (a) shows a simpliﬁed version of the comparator, called Comparator_B.
It compares two inputs, V
, and outputs 1 if V
. Figure 8.6 (b)
shows the block diagram of the Comparator_B. The inputs V
can be either an external
signal or an internal reference voltage. A programmer can choose the input V
as a signal connected
to one of pins CB0, CB1,.., and CB15 using the CBIPSEL bits (bits 3-0) in the Comparator_B
Control Register 0 (CBCTL0). Or input V
can be mapped to a reference voltage, which can be a
fraction of different levels of voltages including: 1.5V, 2.0V, and 2.5V. The selection of the reference