AnsweredAssumed Answered

S32K144 LPSPI Continuous Transfer problem

Question asked by Steven Hu on Jan 8, 2020
Latest reply on Jan 13, 2020 by Steven Hu

hi,

I want to using "Continuous Transfer" function, but  no data received after first writing tx fifo. 

 

LPSPI1->CR = 0x0302; /* Reset Module */
LPSPI1->CR = 0x0008; /* Enable debug mode */
LPSPI1->CFGR0 = 0x00000000UL;
LPSPI1->CFGR1 = 0x00000001UL; /* Master */
LPSPI1->CCR = 0x00000000UL;
LPSPI1->FCR = 0x00000003UL;
LPSPI1->IER = 0x00001A02UL; /* RDIE=1 FCIE=1 TIEI=1 REIE=1 */
LPSPI1->CR |= 0x00000001UL; /* Enable Module */

 

LPSPI1->TCR = 0x0820001FUL; /* PRESCALE:/2 CONT=1 FRAMESIZE:32 */
LPSPI1->TDR = 0x12345678UL;
LPSPI1->TCR = 0x0830001FUL; /* PRESCALE:/2 CONT=1 CONTC=1 FRAMESIZE:32 */
for (i = 0; i < 1000; i++) {}

LPSPI1->TDR = 0x12345678UL; /* 1st break point, run to here is no interrupt occured  before to here */
LPSPI1->TCR = 0x0830001FUL; /* PRESCALE:/2 CONT=1 CONTC=1 FRAMESIZE:32 */
for (i = 0; i < 1000; i++) {}

LPSPI1->TDR = 0x12345678UL; /* 2nd break point , interrupt occured before to here */
LPSPI1->TCR = 0x0830001FUL; /* PRESCALE:/2 CONT=1 CONTC=1 FRAMESIZE:32 */

 

what's the problem?

Outcomes