硬件连接是上图方式,希望能给个驱动代码,ADS1248,ADS1247的code都可以
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.
底层通讯已经写好,就是有点难理解它的写寄存器的方式,另外这个网页好像无法访问
通讯是可以通讯了,但是电流却没有输出
Set_ADS1247_Chip_Enable();
Send_Data_SPI(0x40);
Send_Data_SPI(0x0e);
Send_Data_SPI(0x2e);//MUX0 00101110
Send_Data_SPI(0);//VBIAS
Send_Data_SPI(0x05);//MUX1 00000101
Send_Data_SPI(0x0f);//SYS0 00001111
Send_Data_SPI(0);//OFC0
Send_Data_SPI(0);//OFC1
Send_Data_SPI(0);//OFC2
Send_Data_SPI(0);//FSC0
Send_Data_SPI(0);//FSC1
Send_Data_SPI(0);//FSC2
Send_Data_SPI(0x0f);//IDAC0 00001111
Send_Data_SPI(0x47);//IDAC1 0x47
Send_Data_SPI(0);//GPIOCFG 0
Send_Data_SPI(0xff);//GPIODIR ff
Send_Data_SPI(0);//GPIODAT 00
Clear_ADS1247_Chip_Enable();
Set_ADS1247_Chip_Enable();
Send_Data_SPI(0x20);
Send_Data_SPI(0x0e);
for(uint8_t i=0; i<15; i++)
{
tab[i]= Receive_Data_SPI();
}
Clear_ADS1247_Chip_Enable();
目前寄存器能读能写,但是读取数据,一直读出来为0,求解
Set_ADS1247_Chip_Enable(1);
Send_Data_SPI(0x04);
Send_Data_SPI(0x04);
Clear_ADS1247_Chip_Enable(1);
__delay_cycles(500);
Set_ADS1247_Chip_Enable(1);
while(DOUT1);
Send_Data_SPI(0x12);
bufferIN[0] = Receive_Data_SPI(1);
bufferIN[1] = Receive_Data_SPI(1);
bufferIN[2] = Receive_Data_SPI(1);