lpspi implementation on S32K144 EVB as SPI master

cancel
Showing results for 
Search instead for 
Did you mean: 

lpspi implementation on S32K144 EVB as SPI master

Jump to solution
628 Views
Ji-won
Contributor V

Hi,

I am a beginner of S32K itself.

I need to implement SPI master on S32K and SPI slave on KW38.

I already have confirmed the SPI slave operation with SPI master on KW38 Eval boards temporarily using 500K baud rate and active low CS triggering along with generic standard polarity and phase.

FYI, KW38 SPI communication shows half-duplex when receiving response from SPI Slave. Please see the pictures below.

jiwonlee_3-1625669520776.png

Now, I need to implement SPI master running on S32K EVB.

So, I've imported the lpspi_transfer_s32k144 project.

by the way, it seems to have full-duplex data transferring, but, response data is a garbage data or 0x00.

And I don't still understand why the "LPSPI_DRV_SlaveInit() and LPSPI_DRV_SlaveTransfer() are required in master sending code. So, I commented out the APIs now. First of all, even the instance is using lpspi1.

And master related APIs are using lpspi0.

jiwonlee_0-1625670380080.png

 

Regardless of the half-duplex or full-duplex, a response data should be in the MISO line. but what I don't expect is there. What I expect is the same data. If SPI master sent 0x08, SPI slave needs to send the same 0x08 back to SPI master.

what parts are wrong on my code below?

jiwonlee_4-1625669922401.pngjiwonlee_5-1625669945983.png

 

jiwonlee_6-1625670122774.png

 

Labels (1)
Tags (1)
0 Kudos
1 Solution
593 Views
Ji-won
Contributor V

cleared. I have solved it out.

View solution in original post

1 Reply
594 Views
Ji-won
Contributor V

cleared. I have solved it out.