lpspi implementation on S32K144 EVB as SPI master

取消
显示结果 
搜索替代 
您的意思是: 
已解决

lpspi implementation on S32K144 EVB as SPI master

跳至解决方案
928 次查看
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

 

标签 (1)
标记 (1)
0 项奖励
1 解答
893 次查看
Ji-won
Contributor V

cleared. I have solved it out.

在原帖中查看解决方案

1 回复
894 次查看
Ji-won
Contributor V

cleared. I have solved it out.