SPI In Tc29x AURIX

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

cross mob
User11514
Level 1
Level 1
Hello,

I am facing problem with FIFO operation In SPI
How exactly the data are fetched and transmitted in SPI FIFO
I am using SIngle Move Mode and Short Data

((Ifx_QSPI*)spiModule)->GLOBALCON.B.LB = 1; // LOOP BACK mode requested

((Ifx_QSPI*)spiModule)->GLOBALCON.B.EN = 1; // RUN requested

((Ifx_QSPI*)spiModule)->GLOBALCON1.B.RXFM = 0x01;//
((Ifx_QSPI*)spiModule)->GLOBALCON1.B.TXFM = 0x01;//

((Ifx_QSPI*)spiModule)->GLOBALCON1.B.RXFIFOINT = 0x0;
((Ifx_QSPI*)spiModule)->GLOBALCON1.B.TXFIFOINT = 0x0;



function :
ifxSpiModule->BACONENTRY.U = (spiChannel << 28/*CS*/) |
(spiShiftMode << 21/*MSB*/) |
(0 << 0/*LAST*/) |
(31 << 23/*DL*/ | 7 << 16);


ifxSpiModule->DATAENTRY[0].U = buf[0];

ifxSpiModule->DATAENTRY[1].U = buf[1]; // write to transmitter buffer

ifxSpiModule->DATAENTRY[2].U = buf[2];

ifxSpiModule->DATAENTRY[2].U = buf[3];

(ifxSpiModule->BACONENTRY.U)|= 1 << 0;

ifxSpiModule->DATAENTRY[4].U = 0x11111224;

And when I read

temp = ifxSpiModule->RXEXIT.U; // read receiver buffer

buf0 = temp;

temp = ifxSpiModule->RXEXIT.U; // read receiver buffer

buf1 = temp;

temp = ifxSpiModule->RXEXIT.U; // read receiver buffer

buf2 = temp;

temp = ifxSpiModule->RXEXIT.U; // read receiver buffer

buf3 = temp;

when I read the in while (1) loop then buf0, buf1,buf2, buf3 value keeps changing
Can anyone explain me FIFO operation and its behaviour
0 Likes
3 Replies
Not applicable
What does the value change to?

You should read ((Ifx_QSPI*)spiModule)->STATUS.B.RXFIFOLEVEL to read how much data is available, and then read RXEXIT that many times.
0 Likes
User11514
Level 1
Level 1
Thanks..I will check with this
0 Likes
User14049
Level 3
Level 3
Hi,

can you please post code for SPI clock and calculation.
0 Likes