18个帖子/ 0新
最后一篇
罗尼
离线
最后一次露面:4年9月前
掌握
加入:2014-05-15 15:02
ADC的差模

I am trying to understand how the differential mode works.
I am connecting voltage to P0_0 and ground to P0_1.
我在单个结束时样本通道0和1,然后在差分模式下,但结果我没有意义。
这是代码
// ADC init.
adc_init(GP_ADC_SE,0); //single ended
ADC_ENABLE_CHANNEL(ADC_CHANNEL_P00);// adc_channel_p00.
temps[0]=adc_get_sample(); //start the sampling

adc_disable();
adc_init(GP_ADC_SE,0); //single ended
adc_enable_channel(adc_channel_p01);// adc_channel_p01.
temps[1]=adc_get_sample(); //start the sampling

adc_disable();
ADC_INIT(0,0);// diff mode.
adc_enable_channel(0);// adc_channel_p00- adc_channel_p01.
temps [2] = adc_get_sample();//开始采样

不应该瞬间[2]搅动到温度[0] - temps [1]?
Thanks

je_dialog.
离线
最后一次露面:3 days 14 hours ago
职员
加入:2013-12-05 14:02
你好rony,我会有一个

你好rony,我将有一个团队联系你。我们的数据表涉及到ADC时有点不清。有人将很快与触摸联系。

BR JE_DIALOG.

罗尼
离线
最后一次露面:4年9月前
掌握
加入:2014-05-15 15:02
Thanks

Thanks

RVA.
离线
最后一次露面:5 days 10 hours ago
职员
加入:2014-02-07 14:10
Hi Rony,

Hi Rony,
您是正确的,因为从单个结束输入中减去输出值应该使结果与差分输入相同。但是,您必须确保首先将ADC值转换为实际电压。查看下面显示的详细信息

GP_ADC_ATTN3X GP_ADC_SE输入通道输入比例输入限制
0 1 P0_0, P0_1, P0_2, P0_3 0 V to +1.2 V -0.1 V to +1.3 V
0 0 [P0_0,P0_1],[P0_2,P0_3] -1.2 V至+1.2 V -1.3 V至+1.3 V
1 1 P0_0, P0_1, P0_2, P0_3 0 V to +3.6 V -0.1 V to +3.45 V
1 0 [p0_0,p0_1],[p0_2,p0_3] -3.6 v至+3.6 V -3.45 V至+3.45 V

如果这不回答您的问题,可以在单个结束和差分模式下显示您从ADC读取的一些值吗?
Best regards,
RVA(对话)

罗尼
离线
最后一次露面:4年9月前
掌握
加入:2014-05-15 15:02
我觉得我明白了。

我觉得我明白了。
I can set GP_ADC_SE by using adc_init, but how do set GP_ADC_ATTN3X?

je_dialog.
离线
最后一次露面:3 days 14 hours ago
职员
加入:2013-12-05 14:02
嗨rony,请看

嗨rony,请看following thread whcih details how to set the 3x attenuator .

BR JE_DIALOG.

http://support.dialog-semiconductor.com/using-adc-read-voltage-divider-value

罗尼
离线
最后一次露面:4年9月前
掌握
加入:2014-05-15 15:02
谢谢。我会检查一下

谢谢。
我会检查一下

RVA.
离线
最后一次露面:5 days 10 hours ago
职员
加入:2014-02-07 14:10
Hi Rony,

Hi Rony,

我放入早期帖子的桌子有点乱码。这是一个更好的照片:

Best regards,

RVA(对话)

罗尼
离线
最后一次露面:4年9月前
掌握
加入:2014-05-15 15:02
是的,我破译了它。

是的,我破译了它。
Will start using it next week.
如果我有问题,你将是第一个知道的......
Thanks

罗尼
离线
最后一次露面:4年9月前
掌握
加入:2014-05-15 15:02
正如所承诺的那样,你将成为

正如所承诺的那样,你将成为first to know if there are problems.
我连接了一个设置,其中我可以测量p0和p1单端和p0差分。
我从单一结束的值是逻辑的。
我从差异中得到的东西对我来说没有意义。
我录制了2个文件,其中我手动扫描并录制了我得到的p0,p1和p0-p1
其中一个p0总是高于p1,并且在第二个中它是相反的。
测量不是同时的,但它们是另一个之一。
我如何将数据发送给您?

RVA.
离线
最后一次露面:5 days 10 hours ago
职员
加入:2014-02-07 14:10
Hi Rony,

Hi Rony,

暂时关闭此主题,我们通过邮件讨论的差异ADC测量需要进一步的文档,我们建议使用单端ADC测量。

Best regards, RvA(Dialog)

sprhawk
离线
最后一次露面:3年1周前
加入:2016-03-03 17:25
I am also encounter the

我也遇到了差异模式的问题

你能给我进一步的文件吗?

罗尼
离线
最后一次露面:4年9月前
掌握
加入:2014-05-15 15:02
OK

OK
这就是我们现在正在做的事情。
Thanks

Z20121202038
离线
最后一次露面:3年9个月前
加入:2016-03-30 12:51
你好,

你好,
关于SDK5.0.3:

adc_init(0,gp_adc_sign,0);
ADC_USDELAY(20);
adc_enable_channel(0);
adc_sample = adc_get_sample();

Shouldn't adc_sample be P0_1- P0_0 ?
测量范围是否应为[-1.2V,1.2V]?

它无法测量上面代码的正确值。

期待你的答复。
谢谢。

mt_dialog.
离线
最后一次露面:1 month 3 days ago
职员
加入:2015-06-08 11:34
嗨z20121202038,

嗨z20121202038,

根据您想要衡量的频道,您将不得不进行适当的调整,因为数据表指示GP_ADC_SEL应该是0000如果您想测量P00 VS P01,因此请确保配置是正确的,也可以配置您的使用GPIO_CONFIGUREPIN引脚到ADC功能。除了您希望使用差分模式,您可以使用以下修改应用校准程序:

instead of:

new_adc_off_p = 0x200 - 2 * adc_off_p;
new_adc_off_n = 0x200 - 2 * adc_off_n;

用这个替换上面的:

new_adc_off_p = 0x200 - adc_off_p;
new_adc_off_n = 0x200 - adc_off_n;

谢谢mt_dialog.

Z20121202038
离线
最后一次露面:3年9个月前
加入:2016-03-30 12:51
嗨mt_dialog,

嗨mt_dialog,

我遇到了差异模式的问题
1)
Connect P00 and P01 to ground.
Modify the calibration procedure as your advise.
但输出为0x300或0xff,为什么不为0?
2)
输出是无符号整数还是签名整数?
3)
你能给我进一步的文件吗?

谢谢。

Z20121202038
离线
最后一次露面:3年9个月前
加入:2016-03-30 12:51
嗨mt_dialog,

嗨mt_dialog,

A detail test as follows:

/ ************************************************************************************ /
uint32_t adc_value1=0;
uint32_t adc_value2=0;
uint32_t adc_value3 = 0;
UINT32_T ADC_VALUE4 = 0;

UINT32_T ADC_GET_VBAT_SAMPLE(BOOL SAMPLEM_VBAT1V)
{
UINT32_T ADC_SAMPLE,ADC_SAMPLE2;
uint32_t att = GP_ADC_ATTN3X;

adc_calibrate();
adc_init(GP_ADC_SE, GP_ADC_SIGN, att);
ADC_USDELAY(20);
ADC_ENABLE_CHANNEL(ADC_CHANNEL_P00);
adc_sample = adc_get_sample();
ADC_VALUE1 = ADC_SAMPLE;
ADC_USDELAY(1);

adc_calibrate();
adc_init(GP_ADC_SE, GP_ADC_SIGN, att);
ADC_USDELAY(20);
adc_enable_channel(adc_channel_p01);
adc_sample = adc_get_sample();
ADC_VALUE2 = ADC_SAMPLE;
ADC_USDELAY(1);

ADC_VALUE3 = ADC_VALUE2 - ADC_VALUE1;

adc_calibrate();
ADC_INIT(0,GP_ADC_SIGN,ATT);
ADC_USDELAY(20);
ADC_ENABLE_CHANNEL(0x0000);
adc_sample = adc_get_sample();
ADC_VALUE4 = ADC_SAMPLE;
ADC_USDELAY(1);

adc_disable();

返回ADC_SAMPLE;
}

also, we configure the Pin as :
gpio_configurepin(0,0,输入,pid_adc,false);
gpio_configurepin(0,1,输入,pid_adc,false);
/ ************************************************************************************ /

结果:
adc_value1 = 0;
ADC_VALUE2 = 0x390;// 3.206V.
ADC_VALUE3 = 0x390;
adc_value4 = 0 x02b;/ / 0.151V

期待你的答复。
谢谢。

mt_dialog.
离线
最后一次露面:1 month 3 days ago
职员
加入:2015-06-08 11:34
嗨z20121202038,

嗨z20121202038,

Unfortunatelly there is no documentation or an example how the to operate with the differential ADC, most of the customers are not using the differential but the single ended mode, when zero voltage is applied the output of the ADC should be close to 1FF which is half or the 10 bit range since you are measuring from -1.2V to 1.2V (or multiplied by 3 with the attenuator), the output of the ADC is an unsigned 10bit value. Also try not to use the GP_ADC_SIGN when initializing the module and using the differential mode.

谢谢mt_dialog.