NEW - chaining more than 16 words using QSPI transfer

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

NEW - chaining more than 16 words using QSPI transfer

2,304 Views
ornini
Contributor I
I need to transfer 18 words using SPI, I wrote the code splitting the first 16 words and the last 2. When I use the debugger and run step by step, I see on the scope first 16 words and then the last two. When I run it all, I see only the last 2 words on the scope.
I miss something - maybe delay or clearing before transmitting the second phase of the QSPI.
Do you know what is it about?
Labels (1)
0 Kudos
4 Replies

419 Views
ornini
Contributor I
Thanks Kremer - You're the best.
 
Although it works well even without clearing the SPIF, WCEF flags. Why should I clear them?
0 Kudos

419 Views
Kremer
Contributor I
 As you stated, it works even if you don´t clear the flags SPIF and WCEF, but it surely won´t work for many SPI chained transfers, since you need to wait for the signals to be finished using:
 
while (!(MCF_QSPI_QIR & MCF_QSPI_QIR_SPIF));
 So, if you don´t clear at least SPIF, it will remain set and on the next SPI signaling round, when you try to wait for signals to be finished using the line above, the while will imediately return causing the exact behavior you were having before, eg, QSPI command RAM will be overwritten by the other commands before the older commands are executed. Probably WCEF will be set at this time, indicating your firmware overwrote a command RAM position while the current command was being executed.
 
Regards
0 Kudos

419 Views
ornini
Contributor I
Thank you.
 
Understood.
0 Kudos

419 Views
Kremer
Contributor I
 When you set SPE:
 
MCF_QSPI_QDLYR |= MCF_QSPI_QDLYR_SPE;
 
Are you sure you are waiting for the signals to be finished?
 
while (!(MCF_QSPI_QIR & MCF_QSPI_QIR_SPIF));
   
And clearing the flags after it has finished?

MCF_QSPI_QIR |=  MCF_QSPI_QIR_SPIF
                            |MCF_QSPI_QIR_WCEF;
 
Regards
0 Kudos