How to do ADC averaging in STM32H7 MCU using hardware over sampling
hello everyone i am using stm32h7 MCU, i want averaged ADC data using hardware over sampling. how can get this.
hello everyone i am using stm32h7 MCU, i want averaged ADC data using hardware over sampling. how can get this.
Hello @RShar.9 ,
The example ADC_OverSampler available in the STM32CubeH7 package will help you to configure and use the ADC to convert an external
analog input combined with oversampling feature:
STM32Cube_FW_H7_V1.5.0\Projects\STM32H743I-EVAL\Examples\ADC\ADC_OverSampler
hadc1.Init.OversamplingMode = ENABLE; /* Oversampling enabled */
hadc1.Init.Oversampling.Ratio = 3; /* Oversampling ratio */
hadc1.Init.Oversampling.RightBitShift = ADC_RIGHTBITSHIFT_2; /* Right shift of the oversampled summation */
hadc1.Init.Oversampling.TriggeredMode = ADC_TRIGGEREDMODE_SINGLE_TRIGGER; /* Specifies whether or not a trigger is needed for each sample */
hadc1.Init.Oversampling.OversamplingStopReset = ADC_REGOVERSAMPLING_CONTINUED_MODE; /* Specifies whether or not the oversampling buffer is maintained during injection sequence */hadc1.Init.Oversampling.Ratio = 1; /* Oversampling ratio */
hadc1.Init.Oversampling.RightBitShift = ADC_RIGHTBITSHIFT_1; /* Right shift of the oversampled summation */Hope this helps you.
Best Regards,
Imen
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.