SPI configuration...for reading and writing a single a byte...

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
Hi,
I am working on SPI 4100 module,My aim is to transfer a single byte over a SPI,So what should be the frame length and word length for this motto, & do i need to check & clear both flags,e.i 1) Receive Ending flag 2)Alternate receive ending flag,I want to transfer(read and write) byte by byte only.

Best Regards,
Irfan
0 Likes
2 Replies
chismo
Employee
Employee
First like received
Hello,

Since the frame length and the word length are the same (1-byte), you can configure both FLE and WLE bit fields in SCTR register to 7.
Or if you are using DAVE4 with XMC lib, you can define:
XMC_SPI_CH_SetWordLength(XMC_SPI0_CH0, 8);
XMC_SPI_CH_SetFrameLength(XMC_SPI0_CH0, 8);

For the detection of the received byte, only the Alternate Receive Interrupt (PSR.AIF), which indicates the reception of the first word in a frame, is needed. Receive interrupt (PSR.RIF), which indicates reception of subsequent words in a mult-word frame, is therefore not relevant.

Regards,
Min Wei
0 Likes
Not applicable
Thanks for the Reply, To receive data I'm sending the Dummy Byte(0xFF) by this API only, but there is no data on MISO pin,
So my question is, Is it possible to send and receive data from SPI using the same API? if possible help me out.

Regards,
Irfan
0 Likes