S32K SPI Slave mode

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

S32K SPI Slave mode

1,214 Views
SunW
Contributor I

Hello

 

I have two S32K144 EV board.

One board set SPI master. Other board set SPI Slave.

SPI master pin is  

SPI0_CLK(PB2)

SPI0_MISO(PB3)

SPI0_MOSI(PB4)

SPI0_CS(PB0)

 

SLAVE

SPI1_CLK(PD0)

SPI1_MISO(PD2)

SPI1_MOSI(PD1)

SPI1_CS(PD3)

In case master, I set Chip select pin Software GPIO

In case slave, I set chip Hardware cs.

but  I can't understand SPI slave cs timing.

If Master ChipSelect pin is low, slave SPI chipSelect set low.

How do i check SPI slave chipselect low?

Master sudo code

- cs low

- SPI_transmit

- SPI receive

- cs high

slave Sudo code

- get cs pin low (how do i check pin low?)

- SPI_receive data

- SPI_transmit

- get cd pin high

 

SPI_PIN.PNG

0 Kudos
3 Replies

1,204 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@sunW

you said :If Master ChipSelect pin is low, slave SPI chipSelect set low.

this is not right. the slave cs pin direction should be set to Input, and the voltage level of the CS signal which depends on Master 's CS control only. 

take a look at the example project:lpspi_transfer_s32k14x, it will show the LPSPI Master and Slave functionalities.

BR!

     Jim,

0 Kudos

1,198 Views
SunW
Contributor I

I already saw this project.

Buy i can't find method 

When do i get slave data in MISO.

I try to set cs pin as port interrupt.

So Spi communicaion is not working.

0 Kudos

1,179 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@SunW

   I understand what you mean, you want to enable send &receive by reading the status of CS pin, but the CS pin is not a GPIO port in this example project, so you can't do it through IO interrupt( i guess this is the reason why the SPI communication is not working. )

This answer is very similar to your question, you can refer to this answer.

https://community.nxp.com/t5/S32-SDK/How-do-I-know-if-the-SPI-slave-has-received-the-data/m-p/849975 

BR!

     Jim,

0 Kudos