2024-02-11 05:38 AM
Tried implementing ADC conversion on STM32H563ZI Nucleo board. But, getting only a constant value like 66,67,68,69 in serial monitor(Tera term) irrespective of the given input even the i/p is unplugged getting the same values. Need a help to fix this. Thanks in advance!
Solved! Go to Solution.
2024-02-11 06:06 AM - edited 2024-02-11 06:09 AM
Did you set the sequence for ADC1 in Cube (even if regular conversion -> only one "rank" ) ?
ie :
+
first need calibrate the adc , to get good precision, use : HAL_ADCEx_Calibration_Start(..);
2024-02-11 06:06 AM - edited 2024-02-11 06:09 AM
Did you set the sequence for ADC1 in Cube (even if regular conversion -> only one "rank" ) ?
ie :
+
first need calibrate the adc , to get good precision, use : HAL_ADCEx_Calibration_Start(..);
2024-02-11 07:14 AM
PA4 (ADC1_IN18) is VBUS_SENSE on that board, unless you disconnect it by removing SB56.
> sConfig.SamplingTime = ADC_SAMPLETIME_2CYCLES_5;
Probably insufficient sampling time for most application.
Calibration is required before using the ADC.