lpspi implementation on S32K144 EVB as SPI master

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

lpspi implementation on S32K144 EVB as SPI master

ソリューションへジャンプ
2,593件の閲覧回数
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 解決策
2,558件の閲覧回数
Ji-won
Contributor V

cleared. I have solved it out.

元の投稿で解決策を見る

1 返信
2,559件の閲覧回数
Ji-won
Contributor V

cleared. I have solved it out.