KE04 SPI READ WRITE

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

KE04 SPI READ WRITE

Jump to solution
822 Views
jun1
Contributor V

Thank you for your help.

I ask you a very basic question.
1. Use "SDK_2.6.0_MKE04Z128xxx4" for SPI communication.
When writing to the SPI device, set CS = L, write the register address or command, and send the data to be written next. This can be done with "SPI_MasterTransferNonBlocking".
When reading out, use "SPI_MasterTransferNonBlocking", write the register address and command, and then read out. At that time, for example, output 0 as a dummy and adopt the data input simultaneously with that clock. What?

2. If you have typical samples for writing and reading, please let us know.

Thank you.

Labels (1)
1 Solution
697 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi jun,

SPI interface write and read data at same time. If you want to read a byte, you must write a dummy byte to data port. This can make SPI interface send spi clock.

KE04 SDK hasn't SPI polling example. You can refer to KL25 SDK. It has SPI polling example. There SPI module is very similar. You can also download KE04 driver library form https://www.nxp.com/webapp/Download?colCode=FRDM-KEXX-Driver-Library-Package&appType=license&locatio...

This library operate register directly. You can understand SPI quickly.

Regards,

Jing

View solution in original post

2 Replies
698 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi jun,

SPI interface write and read data at same time. If you want to read a byte, you must write a dummy byte to data port. This can make SPI interface send spi clock.

KE04 SDK hasn't SPI polling example. You can refer to KL25 SDK. It has SPI polling example. There SPI module is very similar. You can also download KE04 driver library form https://www.nxp.com/webapp/Download?colCode=FRDM-KEXX-Driver-Library-Package&appType=license&locatio...

This library operate register directly. You can understand SPI quickly.

Regards,

Jing

697 Views
jun1
Contributor V

Hi.

I am always grateful for your help.
I understand the clock.
Thank you for the source code for register direct access.
This is certainly a quick understanding of the SPI module.

jun

0 Kudos