

AN10187
Low-cost A/D-Conversion with
Philips LPC Microcontrollers
Torsten Eggers, Thomas Schmidt
2002 Oct 04
INTEGRATED CIRCUITS
ABSTRACT
Microcontrollers with on–chip A/D–converters may not be the first
choice for extremely cost–sensitive applications. Philips’ LPC family
of microcontrollers covers the range from the lowest cost end up to
parts with integrated ADC.
This application note shows how the lowest cost parts can take
advantage of LPC features to measure analog signals even with
high–resolution.
Philips Semiconductors Application note
AN10187
Low-cost A/D-Conversion with Philips LPC
Microcontrollers
2
2002 Oct 04
INTRODUCTION
To process continuously varying data with digital computers, analog
values have to be converted to digital quantities. Analog-to-digital
converters (ADC) work according to different principles, varying in
characteristics, effort and costs.
There are microcontrollers with integrated ADC offering 10-bit and
higher resolution, but the required chip-area and thorough testing to
guarantee the desired accuracy add to the cost of such devices.
Philips’ LPC microcontroller families P87LPC76x and P89LPC900
cover a broad range of integrated peripherals including ADCs. This
application note describes two methods to implement ADC functions
even with the lowest-cost parts not having an integrated ADC.
SIGMA-DELTA PRINCIPLE
The Sigma-Delta (Σ∆) principle is becoming more and more
important for high-resolution ADCs and is proven in many
applications.
Its major advantage is that predominantly digital signal processing is
used, which also allows it to be integrated into digital ICs.
According to the Nyquist criterion, a signal to be converted must be
sampled at a rate of at least twice its maximum frequency. A
Σ∆-converter samples at a much higher frequency to decrease the
quantization noise. This oversampling reduces the requirements for
the sample and hold circuitry and analog anti-aliasing filter, which in
many cases can be just an RC-element.
Figure 1.
Figure 1 shows a block diagram of a first-order delta modulator in its
basic form. It consists of an integrator, a clocked comparator, and a
single-bit digital-to-analog converter (DAC). The analog input signal
Ain is summed with the output of the DAC of the feedback loop. The
sum is then integrated and quantized by a comparator, which
functions as a one-bit quantizer. This digital signal is converted back
to analog using a one-bit DAC and fed back to the input’s summing
junction.
The density of digital “1s” at the modulator’s output Dout is
proportional to the analog input value. This bit stream is then
digitally filtered and decimated to a result in a binary format by a
decimation filter .
DUAL-SLOPE PRINCIPLE
Another approach for a low-cost ADC is to transform the voltage
measurement into a time measurement. Microcontrollers are usually
synchronized to a stable clock of an oscillator. This allows precise
time measurements by software or on-chip timers/counters.
Figure 2.
The block diagram of Figure 2 shows a single-slope converter. The
input of an integrator stage is switched from “0” to the analog input
voltage (Ain). The output value of the integrator is compared to a
known reference voltage (V ref). The time it takes for the integrator to
reach the trip point of the comparator is proportional to the analog
input voltage.
In real implementations of this single-slope principle the accuracy
suffers from non-perfect components of the integrator (e.g.
RC-tolerances, leakage currents) and comparator (offset voltage). A
dual-slope converter compensates many of these effects by also
counting the time it takes for the integrator to reach the “0” level
again. The second slope starts when the trip point of the comparator
is reached and the input switch is toggled from Ain to Gnd.
LOW -COST ADC WITH PHILIPS LPC
MICROCONTROLLER FAMILY
The following features of the LPC microcontroller family particularly
support the implementation of low-cost ADCs. All parts have:
One or two on-chip analog comparators. Selectable input and
output options allow the use of the comparators in different
configurations.
Two 16-bit counter / timers.
Programmable port configuration options
Quasi bi-directional
Open drain
Push-pull
High impedance input.
Sigma-Delta ADC
Using the LPC comparators and the push-pull output capabilities, a
simple Sigma Delta ADC can be built up with a minimum of external
components. These blocks are used to balance switched current
pulses. The pulses charge or discharge a capacitor to a voltage
equal to the input voltage Vin. The LPC keeps track of the number of