Hardware Reference
In-Depth Information
Due to the discrete nature of a digital system, the A/D conversion result has a quantization
error. The accuracy of an ADC is dictated by the number of bits used to represent the analog
quantity. The more bits used, the smaller the quantization error will be.
All of the A/D converters need a high-reference voltage ( V RH ) and a low-reference voltage
( V RL ) to perform the conversion. The best choice for the reference voltage is the Zener diode due
to its stable breakpoint voltage and low price. By setting the high reference voltage to an appropri-
ate value, the user may, in many cases, eliminate the need for the signal-conditioning circuit.
There are four major A/D conversion algorithms.
Parallel (flash) A/D converter
Slope and double-slope A/D converters
Sigma-delta A/D converters
Successive-approximation A/D converters
The HCS12 microcontroller uses the successive-approximation algorithm to perform the
A/D conversion. All A/D conversion parameters are configured via four ATD control registers:
ATD x CTL2, ATD x CTL3, ATD x CTL4, and ATD x CTL5.
The TC1047A temperature sensor, the IH-3605 humidity sensor, and the ASCX30AN pres-
sure sensor are used as examples to illustrate the A/D conversion process. The TC1047A can mea-
sure a temperature in the range from 240 to 125 o C. The IH-3605 can measure relative humidity
from 0 to 100 percent. The ASCX30AN can measure a pressure in the range from 0 to 30 psi abso-
lute. These three examples demonstrate the need for a good voltage shifting and scaling circuit.
There are applications that require A/D accuracy higher than that provided by the HCS12
microcontrollers. In this situation, the designer has the option of using an external A/D con-
verter with higher precision or selecting a different microcontroller with higher A/D resolution.
Many 8051 variants from Silicon Laboratory, TI, and Analog Devices have much higher A/D
resolutions.
12.10 Exercises
E12.1 Design a circuit that can scale the voltage from the range of 0 mV,100 mV to the range
of 0 V,5 V.
E12.2 Design a circuit that can shift and scale the voltage from the range of 280 mV,160 mV
to the range of 0 V,5 V.
E12.3 Design a circuit that can shift and scale the voltage from the range of 250 mV,75 mV
to the range of 0 V,5 V.
E12.4 Design a circuit that can shift and scale the voltage from the range of 2 V,2.5 V to the
range of 0 V,5 V.
E12.5 Suppose that there is a 10-bit A/D converter with V RL 5 2 V and V RH 5 4 V. Find the corre-
sponding voltage values for the A/D conversion results of 40, 100, 240, 500, 720, 800, and 1000.
E12.6 Suppose that there is a 12-bit A/D converter with V RL 5 1 V and V RH 5 4 V. Find the cor-
responding voltage values for the A/D conversion results of 80, 180, 480, 640, 960, 1600, 2048,
3200, and 4000.
E12.7 Write a few instructions to configure the HCS12 AD0 converter with the following
parameters:
E-clock frequency 5 16 MHz
Channel AN3
Nonscan mode
 
Search WWH ::




Custom Search