Need help with SPI and logic analyzer for KE06Z SDK.

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

Need help with SPI and logic analyzer for KE06Z SDK.

跳至解决方案
2,672 次查看
tcwong
Contributor III

Hello,

I downloaded the SDK for the KE06Z and found the sample code spi_interrupt_b2b_master.c. How would you edit this code to send the 8 bits of data you would want to send (i.e. 00100001) to be viewed by a logic analyzer? Thank you in advance.

0 项奖励
回复
1 解答
2,530 次查看
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi Tyler Wong,

Yes. After modify the codes, the spi_interrupt_b2b_master project will send 0x21.

You can have a try.

modify.png

SPI 0x21.png

Best Regards,

Robin

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

在原帖中查看解决方案

0 项奖励
回复
5 回复数
2,530 次查看
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi Tyler Wong,

SPI_WriteData can be used to achieve it.

You need to modify the spi_interrupt_b2b_master project.

The pins of logic analyzer need to connect with KE06 pins.

spi_interrupt_b2b_master.png

Best Regards,

Robin

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复
2,530 次查看
tcwong
Contributor III

Hello Robin,

Thanks for the reply! So just to clarify, if I wanted to write 00100001, or 0x21, for example the function would look like SPI_WriteData(EXAMPLE_SPI_MASTER, 0x21)? Is this correct?

Best,

Tyler Wong

0 项奖励
回复
2,531 次查看
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi Tyler Wong,

Yes. After modify the codes, the spi_interrupt_b2b_master project will send 0x21.

You can have a try.

modify.png

SPI 0x21.png

Best Regards,

Robin

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复
2,530 次查看
tcwong
Contributor III

Hello Robin,

So I replaced the same line you did but my MOSI is just outputting 0xFF instead of 0x21. Do you know the reason for this? Below is what my program is outputting as a reference. Thanks in advance.

pastedImage_2.png

Best,

Tyler

0 项奖励
回复
2,530 次查看
tcwong
Contributor III

Whoops I just realized I was reading the wrong line. Thank you

0 项奖励
回复