I am having problems at converting the voltage at ADC0 pin.
I have defined the pin as follows:
// ANALOG INPUT as digital input ??
GPIO_PinModeSet(BAT_ADC_PORT, BAT_ADC_BIT, gpioModeInputPullFilter, 0);
and then,
ADC_SingleInput_TypeDef adc_channel = adcSingleInpCh0;
ADC_Ref_TypeDef volt_ref_adc = adcRef2V5;
uint32_t adc_val=0;
// get sample
adc_val = TD_MEASURE_SingleVoltage ( adc_channel, volt_ref_adc );
// bin to Volts (in mV)
adc_val = volt_ref_val * adc_val / 4096; // 12 bit resolution (LSB_voltage * ADC_code)
Anything wrong?
The converted value does not match the real one.
Regards, Ramon.