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.

ads1292r读寄存器一直为0

Other Parts Discussed in Thread: CC2541, ADS1292R

各位前辈和TI的大神们,我使用裸板驱动,cc2541是SPI master模式。没有使用协议栈,测试了2块PCB板,读ads1292r的寄存器为啥一直返回0啊,一直读不到寄存器的值。通过示波器能看到SPI总线上的SCK和DIN信号。贴上我的程序。帮忙看看问题出在什么地方?万分感谢啊!

unsigned char ADS1x9x_Reg_Read(unsigned char Reg_address)
{
unsigned char retVal;
SPI_Tx_buf[0] = Reg_address | RREG;
SPI_Tx_buf[1] = 0; // Read number of bytes - 1

Set_ADS1x9x_Chip_Enable(); // Set chip select to low


U0DBUF = SPI_Tx_buf[0]; // Send the first data to the TX Buffer
while ( !(U0CSR &0x02) ); 
U0CSR &=0xFD;

U0DBUF = SPI_Tx_buf[1]; // Send the first data to the TX Buffer
while ( !(U0CSR & 0x02) ); 
U0CSR &=0xFD;
retVal = U0DBUF; // Read RX buff

U0DBUF = 0x00; // Send the first data to the TX Buffer
while ( !(U0CSR &0x02) ); 
U0CSR &=0xFD;
retVal = U0DBUF; // Read RX buff

//Clear_ADS1x9x_Chip_Enable(); // Disable chip select
return retVal;}

初始化代码:

P1SEL |=0x38; //p1.3(CLK),p1.4(MISO),p1.5(MOSI)设置为外设
P1DIR |=0x47;
U0BAUD=0x00; //BAUD_M=0;
U0GCR =0x6F;//0x71; //;CPOL=0;CPHA=1;ORDER=1,MSB first;BAUD_E=15 1MHz
U0CSR &=~0xA0;