Skip to main content
kkhli.1
Associate III
February 14, 2024
Question

ADC stability

  • February 14, 2024
  • 2 replies
  • 3919 views

"I used the STM32F746ZG to read the current from an ACS712 sensor, but the problem is that the ADC is not stable. I tried using an STM32F466RE to measure the same current, and this time the ADC is stable. I don't understand why, despite the ADC characteristics of the two STM32 being similar. Is there an explanation for this?"please see the two images below

2 replies

AScha.3
Super User
February 14, 2024

ADC is not stable ... did you calibrate adc first ? ( HAL_ADCEx_Calibration_Start(...) )

+

set same/similar sampling time and conversion speed ?

"If you feel a post has answered your question, please click ""Accept as Solution""."
kkhli.1
kkhli.1Author
Associate III
February 14, 2024

yes i setted the same sampling time 480 cycle with ADCCLOCK 36 MHz

i did not calibrate the adc  because i do no how , i tryed to call HAL_ADCEx_Calibration_Start but i did not found this in hal librarry 

AScha.3
Super User
February 14, 2024

just look at ..Drivers/STM32Fxx_HAL_Driver/Src/stm32h7xx_hal_adc_ex.c

-- what is there..with xxxcalibrat...

(some series have auto-calibration at start , most not -> then you need to call calibration for adc running as it should. )

 

"If you feel a post has answered your question, please click ""Accept as Solution""."
raptorhal2
Lead
February 14, 2024

Just in case the problem is some unknown effect of the F7 interacting with the sensor board, try the Application 7 noise attenuation method provided in the ACS712 data sheet page 13.

As a further note to Ascha's response, the ACS712 has a low impedance op amp output. Large (480) sampling cycles should not be required, his 15 or 28 cycles likely all that is required.