S32K146 SPI Master - clock irregularities

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

S32K146 SPI Master - clock irregularities

2,960 Views
partis
Contributor III

We have a S32K146 running as an SPI master, at 4Mbps, DMA and transferring around 500 bytes per frame.

Often, at each 32nd bit multiple of data transfer, the bit is sometimes incorrect.

Looking on a 'scope, the S32K generated SPI clock, is truncated, during its high period (from 125ns to 62ns). This happens every 32 bits, consistantly. The clock appears perfect in every other respect, with no delays/stalling etc.

Is this a known issue, incorrect SPI setup (we are using AutoSar), or something else?

 

Gary Partis
Labels (1)
0 Kudos
Reply
2 Replies

2,487 Views
mattiasecchiaro
Contributor I

Hi,

we have observed same issue on a project running on S32K148.

LPSPI2 is configured with Processor Expert as per attached image "spi_PE_setup.jpg". Furthermore:

  • we configure 3 wire SPI by setting PINCFG = 10b and OUTCFG = 1
  • we have a protocol with 9 bits words on writing and 8 bits words on reading, so at runtime we change accordingly value of FRAMESZ

As shown in image "SPI_waveform_1.jpg", first clock bit has a period that is a half of the others (so first bit is clocked at 5MHz instead of 2.5MHz). Same issue is shown in "SPI_waveform_2.jpg", where we have inserted a delay between words, to highlights that issue involves first bit of the word.

Is this a known issue? Or an incorrect SPI setup?

Thanks.

0 Kudos
Reply

2,823 Views
namnguyenviet
NXP Employee
NXP Employee

Hi,

Could you please provide us your SPI configuration? 

0 Kudos
Reply