O'Reilly logo

Microcontroller Programming and Interfacing Texas Instruments MSP430 by Daniel J. Pack, Steven F. Barrett

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

242 8. ANALOG PERIPHERALS
changes ’smoothly’ over time. So is the intensity of sun light, wind speed, air temperature, the rate
of a bird flapping its wings, and the speed of your car. On the contrary, digital signals can have a
finite 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.
8.2 BACKGROUND
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
TM
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 first capture the signal at a particular
time (sample), find 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 find 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 first converted into its corresponding digital
representation, its volume is amplified, 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 first 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 figure get converted into digital signals? The analog-to-digital conversion
process consists of the three separate sub-processes previously discussed: sampling, quantization,
and encoding.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required