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.

ADS1230 运行约半小时, 数据出错

Other Parts Discussed in Thread: ADS1230

问题描述: 开始测量正常,运行一段事件, 约半小时到两小时,数据会乱跳


#define NOP90nS()  _nop_() //11.0592Mhz stc单片机 1T模式 单nop约90ns
#define NOP180nS() NOP90nS();NOP90nS()

long ads1230_read(void)
{ long dat = 0; unsigned char i; if(ADS1230_DOUT) return 0xFFFFFFFF; EA=0; for(i=0;i<24;i++)//获取20位有效转换, 后4位无效,作用是为下一次转换做准备 { ADS1230_SCLK = 1; NOP180nS(); //手册时钟信号最低100ns , ADS1230_SCLK = 0; NOP180nS(); dat <<= 1; if(ADS1230_DOUT) dat ++; } EA=1; dat &= 0xFFFFFFF0; return dat; //按24位数据返回,低4位无效。 }
void weight_loop(void) // 此段程序约为 1.4ms
{
 long  dat      = 0;
 dat = ads1230_read();
 if(dat == 0xFFFFFFFF) return;  //器件未准备好,直接返回 
 if(dat & 0x00800000) dat |= 0xFF000000; //负数处理
 。。。。后边数据运算代码省略

}