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.

28035 SPI通訊錯誤



我使用F28035與晶片進行SPI通訊
當我F28035在接收晶片的值時

發生了錯位的問題
但似乎有沒有光只有錯位這麼簡單

而後來我使用Arduino測試時
接收晶片的值卻是正常的沒有錯位

有沒有人發生過這種問題啊QQ

以下是init()跟read的程式碼

void spi_read() //16bits

SpiaRegs.SPITXBUF=0xffff;
while(SpiaRegs.SPIFFRX.bit.RXFFST !=1) { }
rdata_bala = SpiaRegs.SPIRXBUF;

}
void spi_init()
{
SpiaRegs.***.all =0x008f;// // Reset on, rising edge, 16-bit char bits
SpiaRegs.***.all =0x000e; // Enable master mode, normal phase,
SpiaRegs.SPIBRR =0x000e; //clock

SpiaRegs.SPIPRI.bit.FREE = 1; // Set so breakpoints don't disturb xmission

}

以下是我用邏輯分析儀讀回來的值
TI 錯誤的回傳值          0x00 0x1E

arduino正確的讀值      0x00 0x0F