TI中文支持网
TI专业的中文技术问题搜集分享网站

ADS8168: ads8168

Part Number:ADS8168

Dear TI engineer:

I am using ads8168 but not working well, here is the initialization code snippet :

SetReg(WR_REG,REG_ACCESS,EN_REG_WRITE_ACCESS);
SetReg(WR_REG,PD_CNTL,0x08); //external reference   0x080408
SetReg(WR_REG,SDI_CNTL,0x00); //SPI-0
SetReg(WR_REG,SDO_CNTL1,0x60); //data is 16 bit
SetReg(WR_REG,SDO_CNTL2,0x00); //
SetReg(WR_REG,SDO_CNTL4,0x00); //
SetReg(WR_REG,DATA_CNTL,0x00); //0x10 ADC conversion result + 4 bit channel ID
SetReg(WR_REG,PARITY_CNTL,0x00); //
SetReg(WR_REG,REG_ACCESS,DIS_REG_WRITE_ACCESS);
SetReg(WR_REG,OFST_CAL,0x04); //Vref = 3.0v

SetReg(WR_REG,DEVICE_CFG,0x02);//Auto mode   0x081c02
SetReg(WR_REG,AUTO_SEQ_CFG1,0x07);//CH0/1/2 enable   0x088007
SetReg(WR_REG,AUTO_SEQ_CFG2,0x01);//0:no repeat,1:repea    
SetReg(WR_REG,SEQ_START,0x01);//start 

read adc conversion result:

uint32_t read_sdo(void)

{

uint32_t rdata = 0;

Set_Nss(0);
spi_master_transfer_start(SPI0, SPI_TRANS_START);

while (RESET == (SPI_STAT(SPI0) & SPI_FLAG_TP));
spi_i2s_data_transmit(SPI0, 0);
rdata = spi_i2s_data_receive(SPI0);

while (RESET == spi_i2s_flag_get(SPI0, SPI_FLAG_TC));
Set_Nss(1);

return rdata;

}

I don't know what the problem is,please help me thx.

Alice:

Hello,

       Please explain the issue in detail , no data out or data wrong?

赞(0)
未经允许不得转载:TI中文支持网 » ADS8168: ads8168
分享到: 更多 (0)