Hello,
the LPSPI Transmit Data Register TDR is built so that it zero-extends 8 and 16 bit writes
We want to fill the FIFO with DMA transfers. In case I have 5 bytes of data and a Framesize of 5 * 8 = 40 to send I will have one 4 byte DMA transfer and one 1 byte DMA transfer.
The last DMA transfer will only write 8 bit to the register therefore the bits 8 to 31 will be zero.
Kind regards,
Stefan
解決済! 解決策の投稿を見る。
Hi,
I did a test based on MCUXpresso SDK interrupt_b2b_master demo.
I make below change with the code:
uint32_t masterRxData[TRANSFER_SIZE] = {0U};
/*Master config*/
masterConfig.baudRate = TRANSFER_BAUDRATE;
masterConfig.bitsPerFrame = 40; //8;
masterConfig.cpol = kLPSPI_ClockPolarityActiveHigh;
masterConfig.cpha = kLPSPI_ClockPhaseFirstEdge;
masterConfig.direction = kLPSPI_MsbFirst;
masterTxData[0] = 0x11223344;
masterTxData[1] = 0x55;
I could get below transfer siganl from captured scope:
So, the LPSPI module is set to MSB first it will send your expecet data.
Have a great day,
Mike
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
Hi,
I did a test based on MCUXpresso SDK interrupt_b2b_master demo.
I make below change with the code:
uint32_t masterRxData[TRANSFER_SIZE] = {0U};
/*Master config*/
masterConfig.baudRate = TRANSFER_BAUDRATE;
masterConfig.bitsPerFrame = 40; //8;
masterConfig.cpol = kLPSPI_ClockPolarityActiveHigh;
masterConfig.cpha = kLPSPI_ClockPhaseFirstEdge;
masterConfig.direction = kLPSPI_MsbFirst;
masterTxData[0] = 0x11223344;
masterTxData[1] = 0x55;
I could get below transfer siganl from captured scope:
So, the LPSPI module is set to MSB first it will send your expecet data.
Have a great day,
Mike
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
Thank you for testing it Mike!