Hi Daniel,
Thanks for your answer.
When changing the Code to
/* reset framesize: set bit 11-0 to 0!*/
LPSPI1->TCR &= 0xFFFFF007; /* set first 12 bit (0-11) of 32 bit word to zero*/
//LPSPI1->TCR |= LPSPI_TCR_FRAMESZ(LPSPI1_TCR_FRMSZE_1);
LPSPI1->TCR |= LPSPI_TCR_FRAMESZ(framesize-1);
}
it will change the framesize.
But now i run into the problem of sending 10 Bytes of data, but TDR size is 32Bit. I tried several possibilities, as found in the NXP community:
// for loop: //for ( index = 0; index < sequence_length; ++index) {
// for loop: //LPSPI1->TDR = &txbuffer[index]; /* Transmit data */
// for loop: //}
// cast to 32Bit words
// LPSPI1->TDR = ((uint32_t)txbuffer[index] << 24)
// |((uint32_t)txbuffer[index+1] << 16)
// |((uint32_t)txbuffer[index+2] << /* Transmit data */
// |((uint32_t)txbuffer[index+3] ) ;
// LPSPI1->TDR = ((uint32_t)txbuffer[index+4] << 24)
// |((uint32_t)txbuffer[index+5] << 16)
// |((uint32_t)txbuffer[index+6] << /* Transmit data */
// |((uint32_t)txbuffer[index+7] ) ;
// LPSPI1->TDR = ((uint32_t)txbuffer[index+8] << 24)
// |((uint32_t)txbuffer[index+9] << 16);
Nothing is working, also receiving more than 32 Bits is not working!
How should the sending and receiving of data greater than 32Bit word file be implemented?