242 8. ANALOG PERIPHERALS
changes ’smoothly’ over time. So is the intensity of sun light, wind speed, air temperature, the rate
of a bird ﬂapping its wings, and the speed of your car. On the contrary, digital signals can have a
ﬁnite number of values over time. For a binary signal, the value is either one or zero, nothing else.
Computers use binary numbers to interact with the analog world, they must have the capability to
accept and generate analog signals, which is the topic of this chapter.
From the beginning of the computer age, researchers have pursued ways to make computers interface
with the world. You may have seen old Hollywood movies where robots are communicating with
humans. Do you remember hearing a choppy, digital sound whenever a robot spoke? As computer
technologies advanced, it became easier to interact with computers. The very popular iPhone
is a good example of developing a digital system that allows a human user to easily interact with a
computer. Initially, the single primary way to communicate with computers was the use of a keyboard.
It is now fairly common to encounter a wide variety of transducers (microphone, speakers, touch
screens, joysticks, voice sensors, etc.) that allow us to command computers and receive feedback from
them. So how do these interfaces work?
To convert an analog signal to a digital form, one must ﬁrst capture the signal at a particular
time (sample), ﬁnd the analog signal value (quantize), and represent it (encode) before it is sent to
a digital system. An analog-to-digital converter’s job is to perform these three tasks. Depending on
how fast we can sample and how many bits are used to ﬁnd and represent an analog value, the quality
and accuracy of representation of analog signals vary, which we study in this chapter.
Once a signal is processed, the processed signal may need to be sent back to the analog world.
The digital-to-analog converter performs this task. A simple example is to amplify your voice using
a microphone using a digital system. Your voice is ﬁrst converted into its corresponding digital
representation, its volume is ampliﬁed, and the resulting signals are converted back to analog forms
using a digital-to-analog converter. We present the processes involved in both conversions and how
those conversions are performed in the MSP430 microcontroller next.
8.3 ANALOG-TO-DIGITAL CONVERSION
Before a computer can process any physical signals, those signals must ﬁrst be converted to their
corresponding digital forms. Figure 8.1 shows an example of an analog signal. Notice that for a
given time, tx, the signal can hold any value along the y axis. So, how do analog signals such as
the one shown in the ﬁgure get converted into digital signals? The analog-to-digital conversion
process consists of the three separate sub-processes previously discussed: sampling, quantization,