This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

ADS8361数据转换问题

Other Parts Discussed in Thread: ADS8361

使用PIC的32位单片机控制ADS8361,时钟频率80MHz,ADS8361设置在模式1工作。然后连续采集十次ADS8361的输出,每次间隔300ms,采集到的十个数,其中有好几对一模一样的数据,而且相同数据没有挨在一起,不知道是不是代码有问题,麻烦帮我看一下,谢谢。代码如下:

unsigned short Read_ADS8361A0(void)
{
unsigned char i;
unsigned short A0_Data = 0,A0_Positive_Negative_Judge = 0;

RD = 1;
_nop();
_nop();
_nop();
_nop();
_nop();
_nop();
CLOCK = 1;
_nop();
_nop();
_nop();
_nop();
_nop();
_nop();
CLOCK = 0;
_nop();
_nop();
_nop();
_nop();
_nop();
_nop();
CLOCK = 1;
_nop();
_nop();
_nop();
_nop();
_nop();
_nop();
CLOCK = 0;
_nop();
_nop();
_nop();
_nop();
_nop();
_nop();
CLOCK = 1;
_nop();
_nop();
_nop();
_nop();
_nop();
_nop();
CLOCK = 0;
_nop();
_nop();
_nop();
_nop();
_nop();
_nop();
RD = 0;

for(i = 0;i < 16;i ++) //读取16位AD转换后的值,高位在前,所以每读一位是左移
{
A0_Data <<= 1;
CLOCK = 1;
_nop();
_nop();
_nop();
_nop();
_nop();
_nop();

if(DATAA)
{A0_Data |= 0x01;}

CLOCK = 0;
_nop();
_nop();
_nop();
_nop();
_nop();
_nop();
}
CLOCK = 1;
_nop();
_nop();
_nop();
_nop();
_nop();
_nop();
CLOCK = 0;
_nop();
_nop();
_nop();
_nop();
_nop();
_nop();

A0_Positive_Negative_Judge = A0_Data & 0x8000; //判断数据正负,最高位是1为负,返回0x0000,最高位是0为正,返回转换的值
if(A0_Positive_Negative_Judge == 0x0000)
{
return A0_Data;
}
else
{
return 0x0000;
}
}

  • 请问你连续采的10个数据是同一个通道的吗?  他们之间相差有多大? 跟你的计算值差距有多大?

    有没有用示波器看过你现在的接口时钟频率以及接口时序?

  • 是同一个通道的,采集的数据没有问题,就是连续采集时,理论上连续采集的数据中不应该出现一模一样的数据,是我连续采集的时间间隔太短了吗?还是ADS8361每次转换完成之后还要有一些操作?下图是仿真的结果,相同的数据用同样颜色的线条标记出来了。

  • 你这个数据是经过处理后的了?这个结果看起来无规律,应该是没问题的!

    你这连续采集的采样时间大概多长?采样时间能够保证足够的话,连续采集之间是不用间隔的。