目前有個TI-M4讀ADS1247的問題,在資料轉換完成,讀回來的24bit(MSB-Mid-Byte-LSB)前面的MSB-Mid-Byte二個資料完全一樣,
不管電位差怎麼改變,Dout回傳的值(MSB-Mid-Byte二個資料完全一樣),請問可能哪裡有錯呢???? 以下是我的流程~
我的Code一開始先配置register
Step1
Single_data(); // START PIN (HIGH--->LOW)
SPI2_Buffer_Tx[0] = 0x40; //write (register 0)
SPI2_Buffer_Tx[1] = 0x03; // nuber - 1 (4)
SPI2_Buffer_Tx[2] = 0x0B; //MUX0
SPI2_Buffer_Tx[3] = 0x00; //VBIAS
SPI2_Buffer_Tx[4] = 0x00; //MUX1
SPI2_Buffer_Tx[5] = 0x09;//0x06; //SYS0 320 SPS
SPI2_Send_Data(6);
while(SSIBusy(SSI3_BASE))
{
}
Step2
SPI2_Buffer_Tx[0] = 0x13; //改成單次 0x13(Read Data Once)
SPI2_Send_Data(1);
Step3
SysCtlDelay(20000);
SPI2_Send_Data(3); // NO Operation 3 bytes
SPI2_RxIdx = 0;
while(SSIBusy(SSI3_BASE))
{
}
Dout會回傳3 個 Byte (24bit) 結果前2個Byte是一樣的..謝謝
附件 綠色線是-----SCLK
黃色是--------DOUT