0% found this document useful (0 votes)
59 views

stm32l4 Analog Adc

The STM32L4 microcontrollers contain up to 3 analog-to-digital converters (ADCs) that can convert analog sensor outputs to digital values at over 5 million samples per second. The 12-bit ADCs use successive approximation and include oversampling capabilities. They support various triggering methods, low power modes, and data transfer via interrupts or DMA to offload processing from the CPU.

Uploaded by

ST
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
59 views

stm32l4 Analog Adc

The STM32L4 microcontrollers contain up to 3 analog-to-digital converters (ADCs) that can convert analog sensor outputs to digital values at over 5 million samples per second. The 12-bit ADCs use successive approximation and include oversampling capabilities. They support various triggering methods, low power modes, and data transfer via interrupts or DMA to offload processing from the CPU.

Uploaded by

ST
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

Hello and welcome to this presentation of the STM32L4

Analog-to-Digital Converter block. It will cover the main


features of this block, which is used to convert the
external analog voltage-like sensor outputs to digital
values for further processing in the digital domain.

1
The analog-to-digital converters inside STM32 products
allow the microcontroller to accept an analog value like a
sensor output and convert the signal into the digital
domain. There are up to three ADCs and 16 to 24 analog
inputs depending on the device. The ADC module itself
is a 12-bit successive approximation converter with
additional oversampling hardware. Under certain
conditions, the oversampled output can have a 16-bit
result. The sampling speed is more than five mega
samples per second. Each ADC module integrates three
analog watchdogs. The data can be made available
either through DMA movement or interrupts. This ADC is
designed for low power and high performance. There are
a number of triggering mechanisms and the data
management can be configured to minimize the CPU
workload.

2
Up to 3 analog-to-digital converters are integrated inside
STM32L4x6 products. The input channel is connected to
up to 24 GPIO channels capable of converting signals in
either Single-end or Differential mode. The ADCs can
convert signals in excess of 5 mega samples per
second. There are several functional modes which will
be explained later. There are also several different
triggering methods. In order to offload the CPU, the ADC
has 3 analog watchdogs for monitoring thresholds. The
ADC also offers oversampling to extend the number of
bits presented in the final conversion value. For power-
sensitive applications, the ADC offers a number of low-
power features.

3
This slide shows the general block diagram for each
analog-to-digital converters embedded in the STM32L4.

4
The STM32L4’s ADCs support a Deep power-down
mode. When the ADC is not used, it can be disconnected
by a power switch to further reduce the leakage current.
Auto-delayed mode makes the ADC wait until the last
conversion data is read before starting the next
conversion. This avoids unnecessary conversions and
thus reduces power consumption. The power
consumption is in function of the sampling frequency. For
low sampling rates, the current consumption is reduced
almost proportionally.

5
The ADC supports up to 5.33 mega samples per second
of conversion. By using dual interleaved mode, it can be
extended to ten mega samples par second. The ADC
includes the oversampling hardware which accumulates
data and then divides without CPU help. The
oversampler can accommodate from 2 to 256 times
samples and right shift from one to eight binary digits.
The sequencer allows the user to convert up to 16
channels in any desired order. Also each channel can
have different sampling period. The ADC offers an auto
calibration mechanism. It is recommended to run the
calibration on the application if the reference voltage
changes more than 10% so this would include emerging
from RESET or from a low power state where the analog
voltage supply has been removed and reinstated.

6
The ADC needs a minimum of 2.5 clock cycles for the
sampling and 12.5 clock cycles for conversion. With an
80 MHz ADC clock, it can achieve 5.33 mega samples
per second. For higher speed sampling, it is possible to
reduce the resolution down to 6 bits then the sampling
speed can go up to 8.88 mega samples per second.

7
The sampling time can be programmed individually for
each input channel of the analog-to-digital converters.
The sampling times listed in this slide in ADC clock
cycles are available. Longer sample times ensure that
signals having a higher impedance are correctly
converted.

8
The ADCs have a selectable clock source. When the
system needs to run synchronously, the AHB clock
source is the best selection. If a slow CPU speed is
required, but the ADC needs a higher sampling rate, the
dedicated ADC clock can be selected.

9
AD converter supports several conversion modes:
• Single mode, which converts only one channel, in
single-shot or continuous mode.
• Scan mode, which converts a complete set of pre-
defined programmed input channels, in single-shot or
continuous mode.
• Discontinuous mode, converts only a single channel
at each trigger signal from the list of pre-defined
programmed input channels.

10
The ADCs support hardware oversampling. They can
sample by 2, 4, 8, 16, 32, 64, 128 and 256 times without
CPU support. The converted data is accumulated in a
register and the output can be processed by the data
shifter and the truncater.
12-bit data can be extended to be presented as 16-bit
data. This functionality can be used as an averaging
function or for data rate reduction and signal-to-noise
ratio improvement as well as for basic filtering.

11
Each ADC has three integrated analog watchdogs with
high and low threshold settings. The ADC conversion
value is compared to this window threshold, if the result
exceeds the threshold, an interrupt or external signal can
be generated or a timer can be immediately stopped
without CPU intervention.

12
The ADC conversion result is stored in a 16-bit data
register. The system can use CPU polling, interrupts or
DMA to make use of the conversion data. An overrun flag
can be generated if data is not read before the next
conversion data is ready. For injected channel
conversions, 4 dedicated data registers are available.

13
An injected conversion is used to interrupt the regular
conversion, then insert up to 4 channel conversions.
Once an injected conversion is finished, the regular
conversion sequence can be resumed. The injected
conversion result is stored in dedicated data registers.
Flags and interrupts are available for the end of
conversion or end of sequence. The choices for an
injected channel can be reprogrammed on the fly. Even if
a regular or injected conversion is in progress, you can
add a different channel to the queue so that next injected
channel can be different from the previous one.

14
Each ADC can generate 9 different interrupts: ADC
Ready, end of conversion, end of sequence, end of
injected conversion, end of injected sequence, analog
watch dog, end of sampling, data overrun and the
overflow of the injected sequence context queue.
DMA requests can be generated at each end of
conversion when the ADC output data is ready.
The ADCs are active in Run, Sleep, Low-power run and
Low-power sleep modes. In Stop0, Stop 1 or Stop 2
mode, the ADCs are not available but the contents of
their registers are kept. In Standby or Shutdown mode,
the ADCs are powered-down and must be reinitialized
when returning to a higher power state. There is a Deep
power-down mode in each ADC itself which reduces
leakage by turning off an on-chip power switch. This is
the recommended mode whenever an ADC is not used.
The following table shows performance parameters for
the ADC.

17
These peripherals may need to be specifically configured
for correct use with the ADCs. Please refer to the
corresponding peripheral training modules for more
information.

18
The STM32L4 embeds up to three ADCs. ADC 1 and
ADC 2 can be configured to work together in Dual mode,
so that each analog-to-digital conversion can be
synchronized between the two modules. ADC 3 works as
a standalone converter.
Several application notes dedicated to analog-to-digital
converters are available. To learn more about ADCs, you
can visit a wide range of web pages discussing
successive approximation analog-to-digital converters.

20

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy