cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G031 ADC Hardware Oversampling

xpp07
Senior

Hello,

I'd like to use hardware oversampling to increase the ADC resolution to 16 bits. However, this is something I've never done. Is there documentation or examples available on this method? Has anyone had experience with this topic?

Thanks,

2 REPLIES 2
TDK
Guru

The reference manual RM0444 goes over it in quite some detail. Did you look there?

If you feel a post has answered your question, please click "Accept as Solution".
CortexFriend
Associate II

I think, increasing the "resolution" is not the main benefit of hardware oversampling.

But you can use it to make the results of a conversion "more stable" (integration). For instance, enable the oversampling by 2 and shift the result one step left (divide by 2) will give a 12-bit result with an automatic integration.

This is very useful for sampling slow input values. LL_ADC_ConfigOverSamplingRatioShift(ADC1, LL_ADC_OVS_RATIO_256, LL_ADC_OVS_SHIFT_RIGHT_8) gives a high integration in hardware without the need of additional code (or RAM). But keep in mind, the resolution is always 12bit...