查看: 2878|回復: 0
打印 上一主題 下一主題

ads1258接收過(guò)來(lái)的數據跑亂了

[復制鏈接]
跳轉到指定樓層
樓主
發(fā)表于 2010-12-11 17:24:27 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
哪位高手大俠指導指導啊 從ads1258讀過(guò)來(lái)的數據跑亂,不正常,是不是設置錯了。用DRDY做外部中斷觸發(fā)寫(xiě)的程序如下: 初始化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低電平觸發(fā)中斷到接收數據服務(wù)程序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);                       
} 程序運行起來(lái)后,通道數據和狀態(tài)字節會(huì )混淆跑亂
您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規則

關(guān)于我們  -  服務(wù)條款  -  使用指南  -  站點(diǎn)地圖  -  友情鏈接  -  聯(lián)系我們
電子工程網(wǎng) © 版權所有   京ICP備16069177號 | 京公網(wǎng)安備11010502021702
快速回復 返回頂部 返回列表
午夜高清国产拍精品福利|亚洲色精品88色婷婷七月丁香|91久久精品无码一区|99久久国语露脸精品|动漫卡通亚洲综合专区48页