9.4.6.13.2 Averaging Function versus Trigger Events
The samples can be defined in different ways for the averaging function depending on the configuration of ADC_EMR.ASTE and ADC_MR.USEQ
When USEQ = 0, there are two possible ways to generate the averaging through the trigger event. If ADC_EMR.ASTE = 0, every trigger event generates one sample for each enabled channel, as described in the following figure. Therefore, four trigger events are required to obtain the result of averaging if OSR = 1.
If ADC_EMR.ASTE = 1 and ADC_MR.USEQ = 0, the sequence to be converted, defined in ADC_CHSR, is automatically repeated n times (where n corresponds to the oversampling ratio defined in the ADC_EMR.OSR field). As a result, only one trigger is required to obtain the result of the averaging function as described in the following figure.
When USEQ = 1, the user can define the channel sequence to be converted by configuring ADC_SEQR1 and ADC_CHER so that channels are not interleaved during the averaging period. Under these conditions, a sample is defined for each end of conversion as described in the figure below.
When USEQ = 1 and ASTE = 1, OSR can be only configured to 1. Up to three channels can be converted in this mode. The averaging result will be placed in the corresponding ADC_CDRx and in ADC_LCDR for each trigger event. The ADC real sample rate remains the maximum ADC sample rate divided by 4.
It is important that the user sequence follows a specific pattern. The user sequence must be programmed in such a way that it generates a stream of conversion, where a same channel is successively converted.
Register | Number of Channels Non-interleaved Averaging - Register Value | ||
---|---|---|---|
1 (e.g., CH0) | 2 (e.g., CH0, CH1) | 3 (e.g., CH0, CH1, CH2) | |
ADC_CHSR | 0x0000_000F | 0x0000_00FF | 0x0000_0FFF |
ADC_SEQR1 | 0x0000_0000 | 0x1111_0000 | 0x1111_0000 |