TI中文支持网
TI专业的中文技术问题搜集分享网站

ADS1211数据输出格式问题

CMR 寄存器DF位表明:

但我设置cmd 寄存器的DF位 为1,输入信号引脚短接,差分信号为0,读取data寄存器,却发现值为0左右,将DF位置0,的时候,读取的值为0x800000左右,好像是与手册上说的相反,我将DF位 为1调试过程中的寄存器值打印出来如下,理论上信号为0的时候,值应该接近0x800000左右的值,但是取出确是0x000000,请问是怎么回事??

15:45:15.262 ü15:45:15.360 write INSR register 0x64

write ads1121 cmd reg value = 0x22238013

15:45:15.980 read cmd register value = 0x22038013, now should resume normal mode

read ocr reg value = 0x7d0000

read fscr reg value = 0xffffff

15:45:19.942 set extern vref on

get adc data:

0x0 0x0 0x0 0x0

0x0 0x0 0x0 0x0

15:45:20.357 get adc data:

0x0 0x1063 0x1063 0x1063

0x0 0x0 0x0 0x0

16:54:56.439 get adc data:

0x1063 0x0 0x0 0x1063

0x1063 0x0 0x0 0x0

16:54:56.839 get adc data:

0x0 0x0 0x4188 0x0

0x1894 0x0 0x28f7 0x0

16:54:57.246 get adc data:

0x0 0x0 0x0 0x0

0x0 0x0 0x0 0x830 

user4196946:

后面调试发现,似乎跟ocr的内容有关系,如下:
22:58:07.432 ð22:58:07.561 write INSR register 0x64
write ads1121 cmd reg value = 0x22238013
22:58:08.181 read cmd register value = 0x22038013, now should resume normal mode
read ocr reg value = 0x3000
read fscr reg value = 0xffffff
stAdcRingBuffer[0], writable_len = 32, readable_len = 0, write_idx = 0, read_idx = 0
stAdcRingBuffer[1], writable_len = 32, readable_len = 0, write_idx = 0, read_idx = 0
stAdcRingBuffer[2], writable_len = 32, readable_len = 0, write_idx = 0, read_idx = 0
stAdcRingBuffer[3], writable_len = 32, readable_len = 0, write_idx = 0, read_idx = 0
22:58:12.174 set extern vref on
get adc data:
0x0 0x0 0x0 0x0
0x0 0x0 0x0 0x0
22:58:12.549 get adc data:
0x800000 0x7fca10 0x7fbf48 0x7fd4db
0x7fd4db 0x7fbf48 0x7fbf48 0x7fca10
22:58:12.958 get adc data:
0x7fdfa4 0x7fbf48 0x7fdfa4 0x7f9eec
0x800000 0x7fbf48 0x7fbf48 0x7f9eec
22:58:13.362 get adc data:
0x7fea6c 0x7fea6c 0x800000 0x7f9423
0x7fbf48 0x7fea6c 0x7fbf48 0x7f9423
当ocr值为0x3000,输出的数据符合df位 的设定格式,请问ocr的值为什么每次启动后 会有差异呢,怎么才能设定矫正模式,以使输出结果正确呢?

,

Amy Luo:

您好,
OCR包含在转换结果放入数据输出寄存器之前应用于转换结果的偏移校正因子。在大多数应用中,此寄存器的内容将是自校准或系统校准的结果。OCR通过串行接口既可读又可写。对于需要更精确偏移校准的应用,可以执行多个校准,读取每个产生的OCR值,平均结果,并将更精确的偏移校准值写回OCR。

实际的OCR值会随着配置、温度和电源的不同而变化。因此,无法准确预测任何任意情况下的实际OCR值。也就是说,一个给定的系统偏移量不能仅仅通过外部测量误差、计算校正因子并将该值写入OCR来校正。

此外,请注意OCR的内容不用于直接更正转换结果。相反,校正是OCR值的函数。此函数是线性函数,两个已知点可用作OCR中间值插值的基础。有关更多详细信息,请参阅数据手册Calibration部分。

,

user4196946:

你好,我经过多次设定自校准,然后读取ocr寄存器内容如下:

20:35:11.291 write INSR register 0x64

write ads1121 cmd reg value = 0x22238013

20:35:11.883 read cmd register value = 0x22038013, now should resume normal mode

read ocr reg value = 0x7d0000

20:35:12.289 read ocr reg value = 0xf97000

20:35:12.694 read ocr reg value = 0x830000

20:35:13.103 read ocr reg value = 0x830000

20:35:13.506 read ocr reg value = 0x830000

20:35:13.911 read ocr reg value = 0x830000

20:35:14.319 read ocr reg value = 0x830000

20:35:14.693 read ocr reg value = 0x830000

20:35:15.101 read ocr reg value = 0x830000

20:35:15.502 read ocr reg value = 0x830000

20:35:15.911 read ocr reg value = 0x830000

20:35:16.315 read ocr reg value = 0x830000

20:35:16.728 read ocr reg value = 0x830000

20:35:17.126 read ocr reg value = 0x830000

20:35:17.501 read ocr reg value = 0x830000

20:35:17.974 read ocr reg value = 0x830000

20:35:18.311 read ocr reg value = 0x830000

20:35:18.721 read ocr reg value = 0x830000

20:35:19.121 read ocr reg value = 0x830000

20:35:19.529 read ocr reg value = 0x830000

20:35:19.932 read ocr reg value = 0x830000

但是在没有信号输入的情况下(也就会AINN与AIN短接)读出来的值为(DF = 1):

20:36:59.212 get adc data:

0xfa232c 0xfa32cf 0xfa232c 0xfa138b

0xfa138b 0xf9fc17 0xf9fc17 0xfa3a9f

20:36:59.623 get adc data:

0xf9e4a3 0xfa232c 0xfa32cf 0xfa138b

0xfa232c 0xfa32cf 0xfa138b 0xfa232c

20:37:00.025 get adc data:

0xfa4270 0xfa5213 0xfa5213 0xfa5213

0xfa3a9f 0xfa32cf 0xfa4270 0xfa4a40

20:37:00.430 get adc data:

0xfa232c 0xfa32cf 0xfa32cf 0xfa138b

0xfa232c 0xfa1b5b 0xfa2afc 0xfa232c

20:37:00.836 get adc data:

0xfa03e8 0xfa32cf 0xfa232c 0xfa138b

0xfa32cf 0xfa232c 0xf9e4a3 0xfa232c 

我不确定该数据该如何解读,怎么转换的呢?

,

user4196946:

补充:Gain = 1, 外部参考电压2.5v,当AINP接2.5V参考,AINN接地,此时输出的值为0xffffff,这也很让我疑惑,FSR不是2.5-(-2.5) = 5V么,结果与手册上很多都解释不通?请帮我解解疑惑

,

Amy Luo:

非常抱歉,回复晚了,不知道您的问题解决了没有
FSR的范围可以查看数据手册TABLE I. Full-Scale Range vs PGA Setting.
Gain = 1, 参考电压2.5V时,FSR是10V

赞(0)
未经允许不得转载:TI中文支持网 » ADS1211数据输出格式问题
分享到: 更多 (0)