66.6.13.1 Enhanced Resolution Mode
The Enhanced Resolution mode is enabled if the OSR field is configured to 1, 2, 3 or 4 in ADC_EMR. The enhancement is based on a digital averaging function.
There is no averaging on the last index channel if the measure is triggered by an RTC event.
In this mode, the ADC Controller will trade off conversion speed against accuracy by averaging multiple samples, thus providing a digital low-pass filter function.
The selected oversampling ratio applies to all enabled channels when triggered by an RTC event.
where N and M are as shown in the table below.
ADC_EMR.OSR Value | ADC_LCDR.LDATA Length | N Value | M Value | Full Scale Value | Maximum Value |
---|---|---|---|---|---|
0 | 12 bits | 1 | 1 | 4095 | 4095 |
1 | 13 bits | 4 | 2 | 8191 | 8190 |
2 | 14 bits | 16 | 4 | 16383 | 16381 |
3 | 15 bits | 64 | 8 | 32767 | 32761 |
4 | 16 bits | 256 | 16 | 65535 | 65521 |
The average result is valid in ADC_CDRx (x corresponds to the index of the channel) only if the ADC_ISR.EOCn flag is set and if the ADC_OVER.OVREn flag is cleared. The average result for all channels is valid in ADC_LCDR only if ADC_ISR.DRDY is set and ADC_ISR.GOVRE is cleared.
Note that ADC_CDRs are not buffered. Therefore, when an averaging sequence is ongoing, the value in these registers changes after each averaging sample. However, overrun flags in ADC_OVER rise as soon as the first sample of an averaging sequence is received. Thus the previous averaged value is not read, even if the new averaged value is not ready.
Consequently, when an overrun flag rises in ADC_OVER, it means that the previous unread data is lost but it does not mean that this data has been overwritten by the new averaged value as the averaging sequence concerning this channel can still be ongoing.
When an oversampling is performed, the maximum value that can be read on ADC_CDRx or ADC_LCDR is not the full-scale value, even if the maximum voltage is supplied on the analog input. See table above.