2017-11-13 11:43 AM
I am not sure why I keep getting around .3 - .4 V even when the measured input is at 0V using a hand-held DMM. It's hard to imagine my ground noise is that high. Do you think it could be a software issue?
Here are the codes for reading ADC value. The reference voltage is 3.3V.
void StartADCConversion(void)
{ G_ADC_conv_ready = 0; HAL_ADC_Start_IT(&L_hadc); }void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef* hadc)
{ double temp_volt = 0; if (__HAL_ADC_GET_FLAG(hadc, ADC_FLAG_EOC)) { temp_volt = HAL_ADC_GetValue(hadc); G_PackVoltage = (temp_volt/4095.0) * 3.30; G_ADC_conv_ready = 1; } }2017-11-13 01:06 PM
Have you tried hard shorting the ADC input to VDDA?
JW
2017-11-13 02:58 PM
It seems like my conversion time is too short. I increase to ADC_SAMPLETIME_55CYCLES_5 and now it seems to work.
Thanks.