cancel
Showing results for 
Search instead for 
Did you mean: 

ADC stability

kkhli.1
Associate III

"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

9 REPLIES 9
AScha.3
Principal III

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".

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 

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".

i looked at Drivers/STM32Fxx_HAL_Driver/Src/stm32h7xx_hal_adc_ex.c   but there is no function called  HAL_ADCEx_Calibration_Start 

ok - sorry, maybe this is series without calibration . 

+

Data from ACSxxx sensor has noise - doing some averaging the data always needed (my experience) , 

so read data 8x , average /8 -> better value (and 480 sampling time is "over" , try 15 or 28 cycles and average (sum) some values, to reduce the noise.

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

i did this but there is no great difference , i looked to F4 series also has not callibration but they guive me a good result , the probleme i need to work with F7 series

About calibration - STM not doing good, as i see it, about making this clear and obvious :

all Capacitive-re-dristribution-adcs need calibration cycle , some do automatic, on first "init", some need extra command.

ie in H563 ds :

AScha3_0-1707946352000.png

F4 have "auto" , F7 -- i dont know. (I dont want to load all F7 stuff, to see it. )

But basically all F7 are same or better than F4 series, so your "problem" is not the basic precision of the cpu/soc/adc.

 

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

what you mean by some need extra command. which command i have do

raptorhal2
Lead

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.