Structure, function and application of STM32F429 ADC

Publisher:BlossomWhisperLatest update time:2024-03-25 Source: elecfansKeywords:STM32F429  ADC Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

12.1 AD brief description

Before introducing ADC, let us first talk about the fields in which ADC is generally applied. For example, it is widely used in wireless communications, software defined radio, data acquisition, optical communications, instrumentation and other fields. To give a very simple example, if you want to obtain the power consumption of battery voltage, you need to use ADC. Of course, there are many types of ADCs, which I won’t go into here. You can check them online. Take a look and learn more.


In fact, most of the quantities that exist in nature are analog quantities, such as temperature and humidity, time, speed, pressure, flow, etc., but, brothers, when we use these things, we need to use a computer to convert them into digital quantities. , so that some control can be carried out more effectively.

Therefore, a bridge is needed between them, and this bridge is ADC and DAC. This chapter only introduces ADC, DAC will be introduced in the next chapter.

A typical digital control system flow diagram is shown below:

Block diagram of a typical digital control system

According to the information in the figure, we can know that non-electrical analog quantities need to use specific sensors to convert analog signals into electrical signals, and then use ADC to convert the electrical signals into digital signals. After being processed by the embedded system, the digital signals are then converted into digital signals through DAC. into analog signals to control the actuator.

12.1.1 Brief introduction to ADC

Let's first talk about the conversion process of ADC, and then talk about the principle. Of course, if you find it too verbose, you can skip it directly.

ADC is the English abbreviation of Analog-to-Digital Converter, which translates as analog-to-digital converter. It refers to a device that converts continuously changing analog signals into discrete digital signals. The function of A/D conversion is to convert analog signals that are continuous in time and continuous in amplitude into digital signals that are discrete in time and discrete in value. Therefore, A/D conversion generally goes through four processes: sampling, holding, quantization and encoding. As shown below. In actual circuits, some of these processes are combined. For example, sample and hold, quantization and encoding are often implemented simultaneously during the conversion process.

A/D conversion process

1. ADC: Analog/digital converter or analog/digital converter. It refers to a device that converts continuous variable analog signals into discrete digital signals.

A typical analog-to-digital converter converts an analog signal into a digital signal that represents a proportional voltage value.

2. When performing analog/digital conversion, the analog signal must be sampled at certain time intervals, and then the sampled value must be converted into a digital quantity. Therefore, the basic process of analog/digital conversion consists of ① sampling, ② holding, ③ quantization and ④ encoding.

Usually, the two processes of sampling and holding are completed by a sample-hold circuit, and quantization and encoding are often implemented simultaneously during the conversion process.

12.1.2 ADC principle

There are many types of ADCs which can be roughly divided into

Successive comparison approximation type, parallel comparison type, integration type, Σ-Δ modulation type, and voltage-to-frequency conversion type.

these types. Please search Baidu for the specific details.

Of course these types have their own advantages and disadvantages. Look at the picture below:

1- Sample and hold

1). The switch S is controlled by the sampling signal vS:

Let’s look at two pictures first:

Sample/hold circuit schematic and waveform diagram

Here are a few things you can know from the picture above:

(1) When vs is high level, S is closed, and in the sampling stage, vo=vI;

(2) When vs is low level, S is disconnected and is in the holding phase. At this time, since the capacitor has no discharge circuit, vO remains at the instantaneous value of the input voltage at the end of the last sampling.

The digital signal output by A/D conversion is then converted to D/A. The closeness of the obtained analog signal to the original input signal is closely related to the sampling frequency.

2) Sampling theorem

What's sampling?

Define something like this:

Sampling is to extract the measured analog signal amplitude at times T, 2T, 3T,... with an interval of T. The interval T between two adjacent sampling times is also called the sampling period.

Insert image description here

Only when the sampling frequency fs is greater than or equal to 2 times the highest frequency component fmax of the analog signal v (fs≥2fmax), the collected signal samples can reflect the changing pattern of the original analog signal without distortion.

For example: If the frequency of the highest frequency component of the sampled signal is 100Hz, the sampling frequency should not be lower than 200Hz.

3), holding circuit

2-Quantization and encoding

1. What is quantification?

After we sample the analog signal, we will get a sequence of pulse signals that are discrete in time, but the amplitude of each pulse is still continuous. However, the digital signals that the CPU can process are not only discrete in time, but also the changes in value are discontinuous. Therefore, the amplitude of each pulse after sampling must be discretized to obtain the discrete value processed by the CPU. , this process is called quantification.

To put it bluntly, during the A/D conversion process, the output voltage of the sample-and-hold circuit must be planned to the corresponding discrete level in a certain approximate manner.

2. What is coding?

The binary representation of the quantization result is called encoding. Moreover, an n-bit quantized result value is exactly represented by an n-bit binary number. This n-bit binary number is the output result after the ADC conversion is completed.

To put it bluntly, it is a quantization process. It just rounds the analog signal according to the quantization unit. Only by using a code to represent the quantized value can the digital quantity be obtained. Of course, the commonly used encoding is binary encoding.

Of course, there are two ways to encode: look at the picture below:

1. Only rounding is not done when rounding, that is to say, when the voltage is 0-1v, the voltage is 0, when the voltage is 1-2v, the voltage is 1, and so on. Using this method, the input voltage is always higher than the output voltage, so the resulting quantization error cannot be negative.

2. There is rounding when rounding (that is, rounding): that is, 0-0.5V is taken as 0, 0.5-1.5V is taken as 1, and so on. From this we can see that the quantization error here is both positive and negative.

In fact, quantification is simply a process of rounding up analog signals in real time.

3-Conversion speed

It refers to the time required from receiving the conversion control signal to obtaining a stable digital output signal at the output end. The conversion speed is usually expressed by the time required to complete an A/D conversion operation.

For example, if the conversion time T of an ADC is 10ms, then the conversion speed of the A/D converter is 1/T=100 times/s.

4-Resolution

Resolution can also be called resolution. Used to describe scale divisions. The resolution is often expressed in terms of the number of bits in the output binary code. The more digits, the smaller the quantization error, and the higher the conversion accuracy. Camera digital processing is used in many places.

5-Quantization error

Quantization error refers to the error caused by quantization, which is the two situations mentioned above.

6-Accuracy

Accuracy refers to the total error between the ideal value and the actual value of the required analog voltage to produce a given digital output, including errors caused by quantization error, zero point error and nonlinearity. Used to describe the accuracy of physical quantities.

Pay special attention: precision and resolution are not the same.

7-Input analog voltage range

The input analog voltage range refers to the allowed input voltage range of the ADC. Beyond this range, the A/D converter will not work properly. For example: STM32F429 input voltage range is: unipolar 0~V_ref.

8-Conversion time

Conversion time is the time required for the ADC to complete an A/D conversion. It refers to the total time required from starting the ADC to obtaining the corresponding data.

12.2 Structure of STM32F429 ADC

After the above content, we already have a general understanding of the basics of ADC.

Let’s talk about the ADC in STM32.

12.2.1 Introduction to STM32

ADC main structural content:

12-bit resolution

Interrupts are generated on end of conversion, end of injected conversion, and analog watchdog events.

Single and continuous conversion modes

Auto scan mode from channel 0 to channel n

self-calibration

Data alignment with built-in data consistency

Sampling intervals can be individually programmed per channel

Both rule transformations and injection transformations have external triggering options

Intermittent mode

Dual mode (devices with 2 or more ADCs)

ADC conversion time: When the clock is 56MHz, the shortest ADC conversion time is 1μs

ADC power supply requirements: 2.4V to 3.6V

ADC input range: VREF- ≤ VIN ≤ VREF+

A DMA request is generated during regular channel conversion.

STM32F429IGT6 has 3 ADC controllers: its core is an analog-to-digital converter, which is triggered by software or hardware and driven by the ADC clock ADCLK to sample, quantize and encode analog signals in regular channels or injected channels.

1. The 12-bit ADC is a successive approximation analog-to-digital converter that can be configured with 10-bit, 8-bit or 6-bit resolution.

2. Up to 19 multiplexed channels, capable of measuring signals from 16 external sources, two internal sources and VBAT channels.

3. A/D conversion can be performed in single, continuous, scanning or discontinuous

Performed in sampling mode.

4、ADC 的结果存储在一个左对齐或右对齐的 16 位数据寄存器中。

5、ADC具有模拟看门狗特性,允许应用检测输入电压是否超过了用户自定义的阈值上限或下限。

6、多种ADC转换触发方式:软件方式、定时器、EXTI 中断线。

7、可触发DMA功能(可看DMA章节)。

ADC内部结构图:

ADC internal structure

ADC电路走向:

[1] [2]
Keywords:STM32F429  ADC Reference address:Structure, function and application of STM32F429 ADC

Previous article:Some professional terms in STM32F10x
Next article:Interpretation of STM32 minimum system things

Recommended ReadingLatest update time:2024-11-22 20:38

Interfacing the MAX1169 ADC to a PIC Microcontroller
This application note describes how to interface the MAX1169 analog-to-digital converter (ADC) to a PIC microcontroller. Example circuits and software for the PIC18F442 are provided. The software contains function calls to interface the ADC to the PIC microcontroller at 400kHz using the internal MSSP I2C* port.
[Microcontroller]
Interfacing the MAX1169 ADC to a PIC Microcontroller
Detailed explanation of the conceptual differences between ADC accuracy and resolution
When talking to system designers who use analog-to-digital converters (ADCs), one of the questions I hear most often is: “Is your 16-bit ADC also 16 bits of accuracy?” The answer to this question depends on a basic understanding of the concepts of resolution and accuracy. Despite being two completely different con
[Power Management]
Detailed explanation of the conceptual differences between ADC accuracy and resolution
High-performance signal source for ADC and audio testing using innovative digital pre-distortion technology
summary Testing precision instrumentation requires ultra-low distortion, low noise, high-performance signal generators. New products are often required to meet high performance targets. Reference designs, such as the ADMX1002, simplify this task by leveraging high-performance precision digital-to-an
[Industrial Control]
High-performance signal source for ADC and audio testing using innovative digital pre-distortion technology
STM32 serial port prints ADC collection voltage
ADC is a single-chip microcomputer and one of the commonly used functions of STM32 in industrial control. It is used to collect voltage, temperature, etc. as indicators and provide them to other parts for corresponding operations. It is very convenient to configure it using the 32 firmware library. Here, the collected
[Microcontroller]
STM32 serial port prints ADC collection voltage
Higher integration and lower costs require deeper system understanding
Industry analysts agree that the future development trend of systems is mobility, "green" energy saving, and the integration of more sensors in terminal devices. This development trend requires analog-to-digital (ADC) converters and digital-to-analog (DAC) converters to have more channels, higher speed and performance
[Power Management]
Higher integration and lower costs require deeper system understanding
Design of smoke alarm based on 51 single chip microcomputer - ADC0809
1. Hardware Solution The fire alarm uses 51 single-chip microcomputer as the core controller, and realizes basic functions by using gas sensor MQ-2, ADC0809 analog-to-digital converter, DS18B20 temperature sensor, etc. Through these sensors and chips, when the concentration or temperature of combustible gas in the env
[Microcontroller]
Design of smoke alarm based on 51 single chip microcomputer - ADC0809
The influence of sampling clock jitter on ADC signal-to-noise ratio and jitter clock circuit
ADC is the bridge between the analog signal processing part and the digital signal processing part in modern digital demodulators and software radio receivers. Its performance largely determines the overall performance of the receiver. There are many sources of noise introduced in the A/D conversion process, mainly
[Analog Electronics]
The influence of sampling clock jitter on ADC signal-to-noise ratio and jitter clock circuit
ADC based on 51 single chip microcomputer (can be connected to various sensors for control)
******************************  Copyright(C) CaKe  ************************************ === ... ​ ​ ​ ​2014.08.30 ============= ================**Function description : ADC experimental test      === ... //Digital tube 1 sbit SMG2 = P2^5; //Digital tube 2 sbit SMG3 = P2^6; //Digital tube 3 sbit SMG4 = P2^7; //Digita
[Microcontroller]
Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号