S32K146 SPI lost data

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

S32K146 SPI lost data

575 Views
347996379
Contributor III

In the SDK routine, the baud rate used by spi is relatively low, such as 50K;There was no problem in the test of this communication rate in my code, but when I continued to increase the communication baud rate of spi to more than 300K, spi began to lose frames of data, and the higher the baud rate, the more serious the frame loss.I tried to increase the clock on the lpspi, but it didn't work.Do you have any ideas?

I have spent many days without solving this problem. Could you please help me to check the attached code? Where is my problem exactly

Labels (1)
0 Kudos
1 Reply

504 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

if it works at low speed, there's not much to check in the code.

There are several points to consider:

- what is the slave device? Is that capable to communicate at such speed?

- communication frequency can be limited by bus capacitance. Did you try to check the signals by oscilloscope? How was the distortion? What is the length of wires? It should be as short as possible or the frequency should be decreased appropriately

- from SW point of view, you can play with settings in Configuration Register 1 CFGR1 (Sample point) and

Clock Configuration Register CCR to see if it makes a difference.

Regards,

Lukas

0 Kudos