⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.wsdof.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
4 posts / 0 new
Last post
Sparta
Offline
Last seen:1 year 1 week ago
加入:2016-03-14 14:22
da14580 adc resistance

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?

Attachment:
Device:
TR_Dialog
Offline
Last seen:2 months 1 week ago
Staff
加入:2014-06-30 23:52
Hi,

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

Sparta
Offline
Last seen:1 year 1 week ago
加入:2016-03-14 14:22
/ *校准通道ADC

/ *校准通道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();

MT_dialog
Offline
Last seen:1 month 3 weeks ago
Staff
加入:2015-06-08 11:34
Hi Sparta,

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