Hello Dialog experts.
I have a question. I have divider on adc pin (pin P01) as in pdf. So if we have 4.2V battery I expect that on ADC pin will be 840 mV. But I haven't it. What is the impedance of ADC pin? And what can be the problem?
Device:
Hi,
P0_1, P0_2 are normal digital pads: Rpad ~ 1000 Ohm.
This pad resistance is in series with the 3x attenuator resistors (240K) when selected via GP_ADC_CTRL2_REG.
How are you configuring GP_ADC_CTRL_REG and GP_ADC_CTRL2_REG?
TR_DIALOG
/ *校准通道ADCinput */
adc_calibrate();
/* Initialise adc, single ended mode, no software attanuation */
adc_init(GP_ADC_SE, 0, 0);
adc_usDelay(20);
/* Enable ADC channel 1 */
adc_enable_channel(ADC_CHANNEL_P01);
/ *读取sammplefrom the ADC */
adc_sample = adc_get_sample();
Hi Sparta,
Since you dont use the attenuator the internal impedance of the ADC would be infinite, you also mention that you dont get 850mV when reading the ADC with only the external voltage divider, if there is an offset in the value you get, that is quite expected since an external attenuator will add some offset from the actual value (just llike when using the internal attenuator), that offset depends on the resistors that you are using. In general the larger the resistance of the divider is, the smaller the leakage would be but the larger the offset of the measurement and the opposite stands for using smaller resistors. Additionally make sure that you reserve and configure the specified pin to the ADC functionallity.
Thanks MT_dialog