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.

对ADS1247寄存器读写问题

我在写ADS1247驱动的时候,发现不能将值写入寄存器,能够读取寄存器中的值,但是一直是复位的值,而事先写的值并没有写进去。想请教下各位是怎么回事,以下是一段测试代码。

SPI_CS_CLR;
SPI_MasterTransmit(0x40);

SPI_MasterTransmit(0x00);
SPI_MasterTransmit(0x02);

SPI_CS_SET;

while(1)
{
///*
pwrite_data = re_data;
SPI_CS_CLR;
SPI_MasterTransmit(0x20);

SPI_MasterTransmit(0x00);

rdata = SPI_SlaveReceive();
SPI_CS_SET;
do{
*pwrite_data++ = (rdata%10) + 0x30;
rdata /= 10;
}while(rdata != 0);
pwrite_data--;
do{
uart_send_data(*pwrite_data);
}while(pwrite_data-- != psta);