2025-06-12 12:10 AM - edited 2025-06-12 9:58 PM
Hi,
we are using ADC with DMA for internal ADC channel like internal Temperature sensor, VBAT, VREF but we are facing issue related to accuracy please help me on this Configuration:
ADC channel:
2025-06-12 6:28 AM
A few things:
2025-06-12 11:13 PM
Are you calibrating the ADC before using it? You need to.
ANS: Yes
What chip are you using?
ANS: STM32H743ZIVET6
What raw ADC values do you get?
ANS: During debugging we could read the below calibration values and ADC raw count.
TS_CAL2 = 16287, TS_CAL1 = 12805.
Temperature raw count = 2877
Vbat raw count = 2760
You're using 130 for the upper end temperature instead of 110 as the comments say.
ANS:
As per the Datasheet of STM32H743ZI, an internal MCU temperature sensor connected to ADC3_INP18 channel is factory calibrated and below are the calibration values stored into the MCU internal Flash.
Below formula will be used for actual temperature calculation. Where TS_DATA is the actual temperature sensor output value converted by ADC. also mention this formula in code above
At room temperature, it is expected to get the value of TS_DATA between TS_CAL1 & TS_CAL2 or near around TS_CAL1. But we are getting TS_DATA = 2877 & calculated temperature = -198.098
For Vbat,
ADC count for Vbat/4 = 2760, formula used to calculate battery volt = 4 * 3.3 * Vbat raw count / 65535 , where 4 is multiplying factor for ADC count Vbat /4, 3.3 V is VDDA, 65535 is for 16 bit ADC resolution.
Hence Calculated Vbat = 0.56V
Measured Vbat pin voltage on STM32H743ZI Nucleo board is 3.25V.
2025-06-12 11:33 PM
Are you calibrating the ADC before using it? You need to.
ANS: Yes
What chip are you using?
ANS: STM32H743ZIVET6
What raw ADC values do you get?
ANS: During debugging we could read the below calibration values and ADC raw count.
TS_CAL2 = 16287, TS_CAL1 = 12805.
Temperature raw count = 2877
Vbat raw count = 2760
You're using 130 for the upper end temperature instead of 110 as the comments say.
ANS:
As per the Datasheet of STM32H743ZI, an internal MCU temperature sensor connected to ADC3_INP18 channel is factory calibrated and below are the calibration values stored into the MCU internal Flash.
Below formula will be used for actual temperature calculation. Where TS_DATA is the actual temperature sensor output value converted by ADC. also mention this formula in code above
At room temperature, it is expected to get the value of TS_DATA between TS_CAL1 & TS_CAL2 or near around TS_CAL1. But we are getting TS_DATA = 2877 & calculated temperature = -198.098
For Vbat,
ADC count for Vbat/4 = 2760, formula used to calculate battery volt = 4 * 3.3 * Vbat raw count / 65535 , where 4 is multiplying factor for ADC count Vbat /4, 3.3 V is VDDA, 65535 is for 16 bit ADC resolution.
Hence Calculated Vbat = 0.56V
Measured Vbat pin voltage on STM32H743ZI Nucleo board is 3.25V.