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.

ads1255初始配置的问题

Other Parts Discussed in Thread: ADS1255, ADS1256

这是我对于ads1255初始寄存器的设置 实验 本来打算用这个实验来验证这个adc可用 但是 在对读回寄存器的时候,发现问题 就是对于status寄存器的写入为0x04但是读回其寄存器的值确实 0x30 别的寄存器读回值都是正确的 不知道是什么问题

由于应用需要,这个adc芯片的spi接口我用了 ad公司的 adum1402芯片进行了隔离 调了好久 spi部分调好之后,发现以上问题 不知道是什么原因

void main(void)
{
 
// spi_init();//
 WDTCN = 0xDE;
 WDTCN = 0xAD;
 ClockInit22( );
 GPIOInit( );
 while( DRDY==1 );
 spi_TranByte( SELFCAL ); // 上电自校准
 while( DRDY==1 );   // 自校准完成标志
 spi_TranByte(WREG|STATUS);
 spi_TranByte(0x00);
 spi_TranByte(0x04); //数据字节,配置ADS1256输出数据高字节高位在前 自动校准开
 delay_n_us(160);
 while( DRDY==1 );
 spi_TranByte(RREG|STATUS);
 spi_TranByte(0x00);
 delay_n_us(200);
 ads1256[0]=spi_TranByte(0xff); //单独读一次

 while( DRDY==1 );/// DRDY=0才可写ADS1256寄存器
 spi_TranByte(WREG|MUX);// 写寄存器首地址
 spi_TranByte(0x03);//只操作4个寄存器
// spi_TranByte(0x04);//数据字节,配置ADS1256输出数据高字节高位在前 自动校准开
 spi_TranByte(0x01);
 spi_TranByte(0x03);
 spi_TranByte(0xb0);
 spi_TranByte(0xe0);
 delay_n_us(255);//命令间延时
 while( DRDY==1 );
// spi_TranByte(WREG|ADCON);
// spi_TranByte(0x01);//写ADCON和DRATE寄存器
// spi_TranByte(0x03);// adcon
// spi_TranByte(0xb0);// drate
// delay_n_us(160);//
 spi_TranByte(RREG|STATUS);//读寄存器首地址
 spi_TranByte(0x04);//连续读5个寄存器
 
 delay_n_us(200);//
 while( DRDY==1 );/// DRDY=0才可写ADS1256寄存器
 ads1256[0]=spi_TranByte(0xff);
 ads1256[1]=spi_TranByte(0xff);
 ads1256[2]=spi_TranByte(0xff);
 ads1256[3]=spi_TranByte(0xff);
 ads1256[4]=spi_TranByte(0xff);
 NOP();
 while(1);

}