查看: 31217|回复: 3

[提问] ads1258接收过来的数据跑乱了

[复制链接]
发表于 2010-12-11 17:25:43 | 显示全部楼层 |阅读模式
关键词: 数据
哪位高手大侠指导指导啊 从ads1258读过来的数据跑乱,不正常,是不是设置错了。用DRDY做外部中断触发写的程序如下: 初始化void ads1258_init(void)
{
   
cs = 1;  
cs = 0;
spi_send_byte(0xc0);  //reset command
START = 0;
            
spi_send_byte(0x70);   //write registers/MUL=1¡£
spi_send_byte(0x06);   //wait for 4096fclk then SPI reset/chopping = 1 /enable status
spi_send_byte(0x33);   //standby mode/delay us/data rate
spi_send_byte(0x00);
spi_send_byte(0x00);    spi_send_byte(0x5a);   //single input 1.3.4.6
spi_send_byte(0x55);   //single input 8.10.12.14
spi_send_byte(0x00);
spi_send_byte(0xff);
spi_send_byte(0x00);
spi_send_byte(0x8b);
    START = 1;
} DRDY低电平触发中断到接收数据服务程序void int1_isr(void) interrupt 2
{
unsigned char status;
           
spi_send_byte(0x30);  //register form
         
  status = spi_send_byte(0xee) ;       XBYTE[write_pointer++] = spi_send_byte(0xee);   XBYTE[write_pointer++] = spi_send_byte(0xee);   XBYTE[write_pointer++] = spi_send_byte(0xee);                       
} 程序运行起来后,通道数据和状态字节会混淆跑乱
发表于 2011-3-17 22:17:58 | 显示全部楼层
下降沿触发试一下
发表于 2012-9-26 15:24:12 | 显示全部楼层
发表于 2013-4-8 13:30:13 | 显示全部楼层
同步信号有问题?
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关于我们  -  服务条款  -  使用指南  -  站点地图  -  友情链接  -  联系我们
电子工程网 © 版权所有   京ICP备16069177号 | 京公网安备11010502021702
快速回复 返回顶部 返回列表