Table 90. Offset Computation Versus Data Resolution - STMicroelectronics RM0365 Reference Manual

Advanced arm-based 32-bit mcus
Table of Contents

Advertisement

Analog-to-digital converters (ADC)
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 82
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 92
analog watchdog 1.
Resolution
(bits
RES[1:0])
00: 12-bit
01: 10-bit
10: 8-bit
11: 6-bit
When reading data from ADCx_DR (regular channel) or from ADCx_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
80,
data.
323/1080
and
Figure
83.
describes how the comparison is performed for all the possible resolutions for

Table 90. Offset computation versus data resolution

Substraction between raw
converted data and offset:
Raw
converted
Data, left
aligned
DATA[11:0]
OFFSET[11:0]
DATA[11:2],00 OFFSET[11:0]
DATA[11:4],00
OFFSET[11:0]
00
DATA[11:6],00
OFFSET[11:0]
0000
Figure
81,
Figure 82
DocID025202 Rev 7
Result
Offset
signed 12-bit
data
signed 10-bit
data
signed 8-bit
data
signed 6-bit
data
and
Figure 83
show alignments for signed and unsigned
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"
RM0365

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the RM0365 and is the answer not in the manual?

Table of Contents