SPI Transmit and Receive Flag.

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

cross mob
Not applicable
Hi,
I am working on 4100 SSC module, I am using SPI for interfacing EEPROM.which flag we should check for successful transmission of Frame and which flag for Receive, I read the 4100 reference manual they have mentioned Transmit Shift Flag, Recieve Indication Flag & Alternate Receive Indication flag, So can we say after successful transmission Transmit Shift flag gets enabled and for Recieve, Receive Indication flag gets set?
Kindly help me out.

Regards,
Irfan
0 Likes
3 Replies
chismo
Employee
Employee
First like received
Hi Irfan,

For receive in XMC4100, if you using frame size = word size, only the alternative receive (AIF) event will be triggered.
Only when frame size is > word size, the event is as follows:
- first word of frame => AIF
- next word of frame => RIF
- .... => RIF
- last word of frame => RIF

For transmit completion, you can actually use the same AIF event.
Reason is that SPI protocol always transmit and receive on alternate edges of the same clock cycle. So when the AIF is triggered, it must mean that the transmit frame has also been completed.

Regards,
Min Wei
0 Likes
Not applicable
Thanks, Min Wie for quick reply 🙂
I have one more doubt. (SSC implemented in FIFO mode) If the frame size is not fixed so I made following modification for manual control.
1-> WordLength = 8 ; FrameLength = 64;
2-> Enable Frame End Mode i.e PCR_SSC |= FEM_MASK (SET);
3-> before Transmitting Anything I am using EnableStartOfFrame(handle0), and after complete transaction I am using EnableEndOfFrame(handle0);

After making all above changes still, there is nothing on MISO line,

So probably I am missing some configuration parameter for controlling chip select, I have read TCI configuration, but I don't know how to use it and where it is applicable. Please let me know what are the other parameter we should take care of while transmitting or receiving Frame length of not fixed size.
0 Likes
Not applicable
Hi Min Wei,
I kept Frame Length = 64, And Word Length =8, And Enabled Frame End Mode, I have implemented SPI in FIFO.
I have written following code:
// CODE
EnableStartOfFrame(USIC0_CHNL1);

TransferByte(USIC0_CHNL1,0x06); // Write Enable CMD for EEPROM

TransferByte(USIC0_CHNL1,0x05);// Status Read command

u8_lData = TransferByte(USIC0_CHNL1,0xFF);// Transmit Dummy data to read the status

/*Make CS high*/
EnableEndOfFrame(USIC0_CHNL1);
// CODE END
For the first attempt I'm not able to read status but if execute it twice I am able to read, And second thing in reference manual it is clearly mentioned when frame length is kept 64, then before sending a last byte user should enable ENDOFFRAME,but in my case it's not working, after all trasaction I enabled ENDOFFRAME.
0 Likes