3183 views|0 replies

1782

Posts

0

Resources
The OP
 

Principle and Application of Embedded Analog-to-Digital Converter [Copy link]

Principle and Application of Embedded Analog-to-Digital Converter
Release date: 2006-07-13 Views: 17 Author: Sun Xiaobo Xin Jianguo Source: Foreign Electronic Measurement Technology

Luxurious MCU development system 498 yuan
For stable video output:
S3C2410 ARM9 development board 780 yuan
DSP5402 learning development board II 200 yuan

Summer discount:
S3C44B0 development board ( standard version) 350 yuan

MCU Ethernet development board 180 yuan
DSP5402 Learning Development Board II 200 yuan
LABTOOL-48UXP 2800 yuan

Abstract : This paper explains in detail the principle of analog-to-digital converter and some main factors that affect the conversion accuracy of analog-to-digital converter. It also analyzes and introduces in detail the A/D converter embedded in the microcontroller chip, and uses AT90S8535 as a specific application example to analyze how to improve the converter accuracy.

Keywords : A/D converter; successive comparison; sample and hold; electromagnetic interference

Introduction : In the data acquisition system, the analog-to-digital converter is a crucial link. The accuracy of the analog-to-digital converter and the cost of the system directly affect the practicality of the system. Therefore, how to improve the accuracy of the analog-to-digital converter and reduce the cost of the system is the standard for measuring whether the system has practical application value.

Generally speaking, if we want to improve the accuracy of the analog-to-digital converter, it is bound to increase the cost. This requires us to reasonably design the analog-to-digital converter according to the specific accuracy requirements to meet the specific requirements and reduce the cost of the system. In situations where the accuracy requirements are not very high, we often use the A/D converter embedded in the microcontroller chip to achieve analog-to-digital conversion to reduce the cost of the system, but this also raises other problems: whether the embedded analog-to-digital converter has the required accuracy, how to interface with the measurement circuit if it exceeds the measurement range, and how to reduce the electromagnetic interference of the microcontroller to improve the accuracy of the embedded analog-to-digital converter. This requires us to take different measures to improve the accuracy of the embedded analog-to-digital converter.

1. Accuracy and resolution . The accuracy and resolution of ADC are two different concepts. Accuracy refers to the deviation between the actual value and the theoretical value of the converter; resolution refers to the minimum change value of the analog signal that the converter can distinguish. The resolution of ADC depends on the number of bits. Generally speaking, the higher the resolution, the higher the accuracy. However, there are many factors that affect the accuracy of the converter. ADC with high resolution does not necessarily have high accuracy. Accuracy is the total error caused by the combined factors of offset error, gain error, integral linear error, differential linear error, temperature drift, etc. Since the quantization error is caused by the analog input in the process of quantization and rounding, the resolution directly affects the size of the quantization error. The quantization error is a principle error that is only related to the resolution and has nothing to do with the amplitude of the signal and the sampling rate. It can only be reduced but not completely eliminated. It can only be controlled within a certain range, generally within the range of ±1/2LSB .

1.1 Offset Error

Offset error refers to the maximum difference voltage between the code midpoint of digital 0 in the actual analog-to-digital conversion curve and the code midpoint of digital 0 in the ideal conversion curve. This difference voltage is called offset voltage, which is generally expressed as a percentage of the full-scale voltage value. At a certain temperature, most converters can reduce the offset error to close to zero by adjusting the external circuit, but when the temperature changes, the offset voltage will appear again, which is mainly caused by input offset voltage and temperature drift. Generally speaking, it is very difficult to compensate for this error when the temperature changes greatly.

1.2 Gain Error

Gain error is the difference between the actual analog input voltage and the ideal analog input voltage when the converter outputs all "1". It causes the transfer characteristic curve to deviate from the ideal characteristic curve by a certain angle around the origin of the coordinate system. That is, the gain error represents the deviation between the actual slope of the analog-to-digital conversion characteristic curve and the ideal slope. Its value is generally expressed as a percentage of the full scale.

The relationship for the ideal transfer function of the ADC is

(1)

Where Un is the standard analog voltage without quantization. Due to the existence of gain error, equation (1) becomes

(2)

K in the formula is the gain error factor. When K=1, there is no gain error. When K>1, the slope of the transfer characteristic curve becomes larger, the steps become narrower, and the digital output is in the full "1" state before the input analog signal reaches the full scale value. When K<1, the slope of the transfer characteristic curve becomes smaller, the steps become wider, and the digital output has not yet reached the full "1" state output when the input analog signal exceeds the full scale value.

At a certain temperature, K=1 can be adjusted by external circuits, thus eliminating the gain error.

1.3 Linearity error

Linearity error, also known as integral linearity error, refers to the difference between the actual transmission curve and the ideal transmission curve in the absence of offset error and gain error. Linearity error is generally no greater than 1/2LSB. Because linearity error is caused by the change of ADC characteristics with the input signal amplitude, linearity error cannot be compensated, and the value of linearity error will increase with the increase of temperature.

1.4 Differential linearity error

Differential linearity error refers to the maximum deviation between the actual code width and the ideal code width. It is expressed in LSB and is also often expressed in terms of no missing code resolution.

Due to changes in time and temperature, the power supply may change to a certain extent, which may sometimes be the main reason affecting the ADC accuracy. Therefore, in situations where the requirements are relatively high, the stability of the power supply must be guaranteed so that its changes with temperature and time are within the allowable range. However, in general situations, its impact on the system can often be ignored.

2. The structure of embedded analog-to-digital converter and the reasons affecting conversion and their elimination methods

The so-called embedded analog-to-digital converter refers to the integration of analog multiplexers, sample-and-hold, A/D conversion, and microcontrollers on a single chip. Successive approximation is often used for A/D conversion. The analog input signal is generally non-negative unipolar, and the voltage range of the input signal is 0~AV REF . The A/D converter has an independent analog power supply and reference voltage.

In practical applications, since the output resistance of the input signal is different, if the output resistance is too large, the actual measured voltage division will be too small, causing the measured value to be smaller than the actual value; or because the input signal is a bipolar analog signal, it cannot be directly connected to the embedded microcontroller, and special measures must be taken to convert the bipolar analog signal into a non-negative unipolar signal that can be directly measured; and if the input signal amplitude is too large, so that it exceeds the reference voltage, it is also necessary to introduce a voltage reduction link to make the input voltage lower than the reference voltage, and so on. The above influences are analyzed one by one below.

2.1 Effect of analog input signal impedance on sampling

The sampling process is the process of charging the sampling capacitor and tracking the input analog signal voltage. Since the sampling circuit has analog multiplexer impedance, sampling switch impedance and input signal source impedance, its conversion time is affected by the analog multiplexer impedance, sampling switch impedance and input signal source impedance. The greater the impedance of the analog multiplexer and the input signal source, the longer the conversion time.

The equivalent circuit of the input terminal of the successive approximation A/D is shown in the figure below:

V S

R IN

R

C SH

V S

Among them, R IN is the input analog signal internal resistance, VS is the input analog voltage signal, R SH is the equivalent resistance of the analog multiplexer and the sampling switch, and V SH is the charging voltage of the sampling capacitor. It can be seen from the equivalent circuit that the larger the input analog signal internal resistance, the longer the sampling capacitor charging time. Therefore, for occasions with higher sampling frequency requirements, the analog input signal internal resistance must be smaller. When applying, the requirements for the analog input signal internal resistance at the specified sampling frequency must be estimated first. The maximum value allowed by R IN can be obtained from circuit theory (assuming the sampling time is T):

If the internal resistance of the signal source does not meet the requirements, a buffer with very small output impedance must be used, such as a voltage follower, so that the output impedance of the signal source is within the range of the input impedance required by the A/D converter.

2.2 Transformation of analog signal polarity and amplitude

In the data acquisition system, the collected analog signals are not all non-negative unipolar signals, but often bipolar signals. Therefore, when using the embedded A/D converter, the polarity of the analog input signal needs to be converted. We can use a linear network composed of operational amplifiers to convert its polarity and amplitude. However, it should be noted that when the linear network is introduced, a certain amount of nonlinear error is introduced. The linear network schematic diagram can be represented by the following figure:


The size of the analog input signal can be adjusted to meet the measurement requirements by simply changing the sizes of the resistors R1, R2, and R3 and their proportional relationship.

3. Specific application of A/D converter embedded in microcontroller chip
The following introduces a commonly used chip AT90S8535 and the precautions that should be taken when using its A/D converter.
AT90S8535 is a low-power 8-bit microcontroller based on AVR RISC structure produced by ATMEL. It has an analog-to-digital converter integrated inside. The analog-to-digital converter has the following characteristics:

l 10-bit resolution;

l ±2LSB accuracy;

l 0.5LSB integrated linearity;

l 65~260μs conversion time;

l 8 channels;

l Free-running mode and single-shot conversion mode;

l ADC conversion end interrupt;

l Sleep mode noise cancellation.

The AT90S8535 has a 10-bit resolution successive approximation A/D converter. The ADC is connected to an 8-channel analog multiplexer, which allows port A to be used as the ADC input pin. The ADC contains a sample-and-hold amplifier. The ADC block diagram is shown below:

The ADC can operate in two modes - single conversion and free run. In single conversion mode, the user must initiate each conversion, while in free run mode, the ADC continuously samples and updates the ADC data register. The ADFR bit of ADCSR is used to select the operating mode of the A/D converter.

Since the conversion of analog channels is always delayed until the end of the conversion, the free-running mode can be used to scan multiple channels without interrupting the converter. Generally, the ADC conversion end interrupt is used to modify the channel, but the following factors should be considered; the interrupt is triggered as soon as the result is ready. In free-running mode, the next conversion starts as soon as the interrupt is triggered. If the analog channel is changed after the interrupt is triggered and the next conversion has already started, the previous settings are still used.

3.1 ADC Noise Cancellation Technology

The internal and external digital circuits of AT90S8535 will generate electromagnetic interference, which will affect the accuracy of analog measurements. If higher measurement accuracy is required, the following techniques should be used to reduce noise:

1) The analog part of AT90S8535 and other analog devices should have independent ground plane on the PCB. The analog ground and digital ground should be connected at a single point;

2) Make the analog signal path as short as possible. Make the analog traces pass through the analog ground and keep them as far away from the high-speed digital path as possible;

3) AVCC must be connected to VCC through an RC network ;

4) Use the noise cancellation function of the ADC to reduce the noise from the CPU;

5) If some pins of port A are used as digital output ports, these ports should not change their status during the ADC conversion process.

3.2 ADC noise cancellation function implementation :

The ADC can convert in CPU idle mode, which makes it possible to suppress noise from the CPU. To achieve this feature, the following measures need to be taken:

A) The single conversion mode must be selected and the ADC conversion end interrupt must be enabled;

ADEN=1;ADSC=0;ADFR=0;ADIE=1;

B) Entering idle mode. Once the CPU stops, the ADC will start converting;

C) If no other interrupt occurs before the ADC conversion is completed, the ADC interrupt will wake up the MCU and execute the ADC conversion end interrupt.

Conclusion Due to its own structure and performance characteristics, the A/D converter on the microcontroller chip will encounter different problems from independent A/D converters in many applications. However, most A/D devices embedded in microcontrollers have similar structures and characteristics to AT90S8535, and the noise reduction technology and methods adopted are also roughly the same. We need to analyze whether to adopt embedded A/D or independent A/D according to specific circumstances, and take necessary measures to improve the accuracy of A/D converters according to specific needs.

[References]
[1] Application Technology of Analog-to-Digital Converters Gao Guangtian Science and Technology Press 2001
[2] AVR AT90S8535 data sheet
[3] Application Technology of AVR Microcontrollers Li Xun Geng Degen Beijing University of Aeronautics and Astronautics Press 2002

(End of full text)
This post is from Analog electronics

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list