cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H745ZIT6 ADC error

MorisG_PE
Associate II

I'm encountering an issue with the ADC on my STM32H745ZIT6 microcontroller when reading voltages from a power supply. Here's the problem in detail:

I'm using the ADC to convert analog voltages from a power supply into digital values. However, I've noticed significant inaccuracies in the ADC readings across all voltage ranges. For example, when the power supply outputs 6V, the ADC reads 6.22V consistently, and similar deviations occur across other voltage levels.

I've ensured that the power supply voltages are stable and within the operating range specified for the ADC. The issue is persistent and does not seem to be related to specific voltage thresholds.

 

Has anyone else in the community encountered similar issues with the STM32H7 series ADC? If so, how did you resolve them? Any insights or suggestions on how to troubleshoot or resolve this issue would be greatly appreciated.

 

20 REPLIES 20
RolfStDK
Associate II

TDK, thank you for the info, I've managed to set it manually as in the following flow:

  1. call HAL_ADCEx_Calibration_Start() //Performs self-calibration
  2. wait 10 msec
  3. call HAL_ADCEx_LinearCalibration_GetValue(): get calibrated values (160-bits LINEAR_CALIB_REG save calibrated values (e.g. EEPROM)
  4. Get (hadc.Instance)->CALFACT (11-bits linearity factor) and save (e.g. EEPROM)
  5. Power cycle 
  6. call HAL_ADCEx_LinearCalibration_SetValue(): retrieve saved 160-bits LINEAR_CALIB_REG values
  1. (hadc3.Instance)->CALFACT = retrieve saved 11-bits linearity factor value
  2. HAL_Delay(10)