5.2.5.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 ADC_MR.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 requested to obtain the result of averaging if ADC_EMR.OSR = 1.

Figure 5-12. Digital Averaging Function Waveforms Over Multiple Trigger Events

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 ADC_EMR.OSR). As a result, only one trigger is required to obtain the result of the averaging function, as described in the following figure.

Figure 5-13. Digital Averaging Function Waveforms on a Single Trigger Event

When USEQ = 1, the user can define the channel sequence to be converted by configuring ADC_SEQRx 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 following figure.

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.

Table 5-3. Example Sequence Configurations (USEQ = 1, ASTE = 1, OSR = 1)
RegisterNumber of Channels Non-interleaved Averaging - Register Value
1 (e.g., CH0)2 (e.g., CH0, CH1)3 (e.g., CH0, CH1, CH2)
ADC_CHSR0x0000000F0x000000FF0x00000FFF
ADC_SEQR10x000000000x111100000x11110000
ADC_SEQR20x000000000x000000000x00002222
Figure 5-14. Digital Averaging Function Waveforms on a Single Trigger Event, Non-interleaved