Jan 17, 2023
11:54 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 17, 2023
11:54 PM
hi friends
i have a trouble when i am using SPI to communicate with a fram .I would like to know why using spi communication must use a delay function after sending a byte and before reading it, if no delay function is used, there will be a shift.(0x01,0x02,0x03 will become 0x00 0x01 0x02).And the delay time is different, the shift is different
Solved! Go to Solution.
1 Solution
Jan 18, 2023
01:33 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 18, 2023
01:33 AM
3 Replies
Jan 18, 2023
01:33 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 18, 2023
01:33 AM
Jan 18, 2023
09:17 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 18, 2023
09:17 PM
Jan 18, 2023
10:08 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 18, 2023
10:08 PM
I guess the reason is you need to make sure the TX was completed - the data was written to FRAM(by checking RX buffer status) before reading the data from FRAM.
/* Start transfer */
SPIM_SpiUartWriteTxData((uint32) wrBuf[i]);
/* Wait for the end of the transfer. The number of transmitted data
* elements has to be equal to the number of received data elements. */
while (PACKET_SIZE != SPIM_SpiUartGetRxBufferSize());
/* Clear dummy bytes from TX buffer */
SPIM_SpiUartClearTxBuffer();
/* Read data from the RX buffer */
tmpBuffer[i] = (uint8) SPIM_SpiUartReadRxData();
Roy Liu