EasyManuals Logo

ST STM32L4 5 Series User Manual

ST STM32L4 5 Series
1830 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #540 background imageLoading...
Page #540 background image
Analog-to-digital converters (ADC) RM0351
540/1830 DocID024597 Rev 5
and Figure 99.
Special case: when left-aligned, the data are aligned on a half-word basis except when the
resolution is set to 6-bit. In that case, the data are aligned on a byte basis as shown in
Figure 98 and Figure 99.
Note: Left-alignment is not supported in oversampling mode. When ROVSE and/or JOVSE bit is
set, the ALIGN bit value is ignored and the ADC only provides right-aligned data.
Offset
An offset y (y=1,2,3,4) can be applied to a channel by setting the bit OFFSETy_EN=1 into
ADC_OFRy register. The channel to which the offset will be applied is programmed into the
bits OFFSETy_CH[4:0] of ADC_OFRy register. In this case, the converted value is
decreased by the user-defined offset written in the bits OFFSETy[11:0]. The result may be a
negative value so the read data is signed and the SEXT bit represents the extended sign
value.
Note: Offset correction is not supported in oversampling mode. When ROVSE and/or JOVSE bit is
set, the value of the OFFSETy_EN bit in ADC_OFRy register is ignored (considered as
reset).
Table 112 describes how the comparison is performed for all the possible resolutions for
analog watchdog 1.
When reading data from ADC_DR (regular channel) or from ADC_JDRy (injected channel,
y=1,2,3,4) corresponding to the channel “i”:
If one of the offsets is enabled (bit OFFSETy_EN=1) for the corresponding channel, the
read data is signed.
If none of the four offsets is enabled for this channel, the read data is not signed.
Figure 96, Figure 97, Figure 98 and Figure 99 show alignments for signed and unsigned
data.
Table 110. Offset computation versus data resolution
Resolution
(bits
RES[1:0])
Subtraction between raw
converted data and offset:
Result Comments
Raw
converted
Data, left
aligned
Offset
00: 12-bit DATA[11:0] OFFSET[11:0]
signed 12-bit
data
-
01: 10-bit DATA[11:2],00 OFFSET[11:0]
signed 10-bit
data
The user must configure OFFSET[1:0]
to “00”
10: 8-bit
DATA[11:4],00
00
OFFSET[11:0]
signed 8-bit
data
The user must configure OFFSET[3:0]
to “0000”
11: 6-bit
DATA[11:6],00
0000
OFFSET[11:0]
signed 6-bit
data
The user must configure OFFSET[5:0]
to “000000”

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the ST STM32L4 5 Series and is the answer not in the manual?

ST STM32L4 5 Series Specifications

General IconGeneral
BrandST
ModelSTM32L4 5 Series
CategoryMicrocontrollers
LanguageEnglish

Related product manuals