S32K148 with VN9D30Q100F SPI error bit set

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

S32K148 with VN9D30Q100F SPI error bit set

1,860 Views
han1005
Contributor II

hi, Im trying spi communication using S32K148 with VN9D30Q100F. 

Occasionally, when receiving SDO data from the VN9D30Q100F to the S32K148, the SPI error bit in the global status bit of the response data (SDO) is set to 1.

I think a reason of this error is that the time between the chip select signal goes low and the sdi is sent is too long.

in VN9D30Q100F's data sheet, max time of CSN(chip select) low to output valid is 200ns. but current this time is checked 34.7us.

How can I reduce time?

사진1.jpg

오실로 사진.jpg화면 캡처 2022-01-26 094233.jpg

 

 

0 Kudos
Reply
5 Replies

1,841 Views
Jeremy_He
NXP Employee
NXP Employee

Hi,

Yes from the code you are using software CS control. After switching to hardware CS, it should be faster, also you can change the PCSSCK value by baremetal code to adjust the time.

nxf58909_0-1643167540329.png

nxf58909_1-1643167636129.png

 

 

Best wishes,

Jeremy

1,812 Views
han1005
Contributor II

Is that only one solution? 

actually i don't know how to write bare metal code. 

and if some solution to set values in PCSSCK using components library is exist, could you tell me about that? or could you show me a picture of PCSSCK bare metal code examples?

0 Kudos
Reply

1,786 Views
Jeremy_He
NXP Employee
NXP Employee

Hi  Han,

 

please try 

 

LPSPI0->CCR &= ~LPSPI_CCR_PCSSCK_MASK;
LPSPI0->CCR |= LPSPI_CCR_PCSSCK(0x03);

 

In this case, LPSPI0 is used, and PCSSCK is set to 0x03.

 

When you chose Hardware CS, CS pin is controlled by hardware.  It will be set automatically when you call  MasterTransfer().

 

Best wishes,

Jeremy

 

 

0 Kudos
Reply

1,843 Views
frank_yang_1
NXP Employee
NXP Employee

Does the CS pin(PTA15) controlled by GPIO instead of SPI?

nxf65308_0-1643166414711.png

If true,  1 method to reduce time is that making the CS pin controlled by SPI and only call MasterTransfer(). 

Two additional GPIO operation added some unnecessary time consumption in time-limited app.

1,811 Views
han1005
Contributor II

yes, now i control chip select pin using gpio functions.

after than i check time that use only gpio funtions. in this case, consumed time was verry short.

i think SPI_MasterTransfer function consumed long time.

and how can i control CS pin using call MasterTransfer()?

0 Kudos
Reply