Closed KubeckPL closed 11 months ago
Hello @KubeckPL,
Thank you for this report. We will get back to you as soon as we analyze it further. This may take some time. Thank you for your comprehension.
With regards, Rania
Hello @KubeckPL,
I have the impression that there is only one flash calibration value for all ADCs.
So
Either the 12bit ADC is not calibrated by engineering,
Or the calibration value is the same between ADC 16B and 12B, and since the stored calibration value is 16B, the code is correct.
Regards, Rania
Hello,
Please let us know your feedback so that we can help you.
With regards,
Hello @KubeckPL ,
Please allow me to close this thread as no activity. You may reopen it at any time if you have any details to share with us in order to help you to solve the issue. Thank you for your comprehension.
With regards
Hello. I am not sure how calibrated the ADC is.
But in CubeMX there is no option to configure reference voltage and temperature measurement for ADC1 for MCU H730:
The only possibility is for ADC3:
Check the operation of my program - the reference voltage connected to the MCU is 3.3V:
if I use a macro that uses 16-bit resolution, I get a value of ~206mV.
however, if I correct the macro so that the resolution is consistent with ADC3, that is, 12 bits, the reference voltage values are measured correctly:
I have a feeling that the error is in the macro. RJMSTM can you please check this case?
Caution In the macros in the Low-Layer library to calculate Vref voltage and MCU internal temperature, there is an error for the H730 processor.
__LL_ADC_CALC_VREFANALOG_VOLTAGE https://github.com/STMicroelectronics/STM32CubeH7/blob/b75d4ea0a368c0e2e7bb9c40c1258a39fff0919a/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_ll_adc.h#L2417
__LL_ADC_CALC_TEMPERATURE: https://github.com/STMicroelectronics/STM32CubeH7/blob/b75d4ea0a368c0e2e7bb9c40c1258a39fff0919a/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_ll_adc.h#L2471
Both of the above macros use another macro, which is __LL_ADC_CONVERT_DATA_RESOLUTION. In this macro, an ADC resolution of 16 bits is implemented. This configuration is not correct when the user uses ADC3 to measure temperature and Vref voltage, because ADC3 is of a resolution of 12 bits. Using a macro with 16-bit scaling leads to erroneous measurement results.
The __LL_ADC_CONVERT_DATA_RESOLUTION_ADC3 macro is defined in the Low-Layer library, but it is not used in any case: https://github.com/STMicroelectronics/STM32CubeH7/blob/b75d4ea0a368c0e2e7bb9c40c1258a39fff0919a/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_ll_adc.h#L2359
Tools used:
Please analyze the problem.
Best regards.