S32K148 LPSPI transfer error

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

S32K148 LPSPI transfer error

853 Views
FBS
Contributor II

Hi NXP community,

I have a problem with the LPSPI0 transfers which explain below.

When I set LPSPI0 as master to transmit 4 bytes at 4,8MBaudrate with LPSPI0_CLK_SEL = 24MHz (FIRCDIV2 / 2), there seems to be a pause in the middle of the 4 bytes I’m sending.

Inkedphoto5870704704739195328_LI.jpg

The applied settings can be seen in the following images.

a.JPG

To isolate the problem as much as possible I have done a project that only sets LPSPI0 as master and makes an infinite loop that only makes transmissions and waits. 

If you need to clarify anything about the management or configuration I do in the LPSPI interface, please let me know.

Best regards,

Labels (1)
Tags (2)
0 Kudos
1 Reply

833 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @FBS,

If you configure the SDK LPSPI for 8bit frames, in the interrupt mode, the LPSPI_DRV_FillupTxBuffer() function (lpspi_shared_function.c) that is called from the interrupt handler can fill the TX FIFO with 8bit frames. The FIFO can take only up to 4 such frames.

danielmartynek_0-1650540747264.png

 

The SDK LPSPI driver needs some time to fill the TX FIFO (CPU overhead).

You can reduce the delay either by increasing the system clock frequency or by reducing the SPI bitrate.

 

Regards,

Daniel

 

 

 

0 Kudos