Download Print this page

ST STM32F301 6 Series Reference Manual page 226

Advanced arm-based 32-bit mcus

Advertisement

Analog-to-digital converters (ADC)
12.3.26
Data management
Data register, data alignment and offset (ADCx_DR, OFFSETy, OFFSETy_CH,
ALIGN)
Data and alignment
At the end of each regular conversion channel (when EOC event occurs), the result of the
converted data is stored into the ADCx_DR data register which is 16 bits wide.
At the end of each injected conversion channel (when JEOC event occurs), the result of the
converted data is stored into the corresponding ADCx_JDRy data register which is 16 bits
wide.
The ALIGN bit in the ADCx_CFGR register selects the alignment of the data stored after
conversion. Data can be right- or left-aligned as shown in
and
Figure
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 55
Offset
An offset y (y=1,2,3,4) can be applied to a channel by setting the bit OFFSETy_EN=1 into
ADCx_OFRy register. The channel to which the offset will be applied is programmed into the
bits OFFSETy_CH[4:0] of ADCx_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.
Table 39
analog watchdog 1.
Resolution
(bits
RES[1:0])
00: 12-bit
01: 10-bit
10: 8-bit
11: 6-bit
226/874
56.
and
Figure
56.
describes how the comparison is performed for all the possible resolutions for
Table 37. Offset computation versus data resolution
Substraction between raw
converted data and offset
Raw converted
data, left aligned
DATA[11:0]
DATA[11:2],00
DATA[11:4],0000
DATA[11:6],000000 OFFSET[11:0] Signed 6-bit data
Offset
OFFSET[11:0] Signed 12-bit data -
OFFSET[11:0] Signed 10-bit data
OFFSET[11:0] Signed 8-bit data
RM0366 Rev 5
Figure
53,
Figure
54,
Result
Comments
The user must configure
OFFSET[1:0] to "00"
The user must configure
OFFSET[3:0] to "0000"
The user must configure
OFFSET[5:0] to "000000"
RM0366
Figure 55

Advertisement

loading
Need help?

Need help?

Do you have a question about the STM32F301 6 Series and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Stm32f301 8 seriesStm32f318 8 series