Treat MKW24D512VHA5 as a SPI master

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

Treat MKW24D512VHA5 as a SPI master

跳至解决方案
926 次查看
diaskuo
Contributor II

Hi everyone,

Can MKW24D512VHA5 treat as a SPI master device to connect with a sensor device (SPI slave)?

Would you please guide me to setup the SPI master?

Thanks a lot.

Best regards,

Dias

0 项奖励
回复
1 解答
742 次查看
EarlOrlando
Senior Contributor II

Hello Dias,

Are you using some specific software? If you aren't, I recommend you to take a look into the Kinetis SDK​, once you have installed the SDK please go to the folder C:\Freescale\KSDK_1.3.0\examples\twrkw24d512\driver_examples\dspi\dspi_non_blocking\master and open the project. This example code will help you enabling what you are asking for.

If you are using a BeeKit generated project, it already includes some functions to use the SPI instance which includes your MCU. You can find them in PLM/Source/SPI.

pastedImage_2.png

Please let me know if you need any additional direction and if this is useful for you.

Best regards,

Earl.

在原帖中查看解决方案

0 项奖励
回复
3 回复数
743 次查看
EarlOrlando
Senior Contributor II

Hello Dias,

Are you using some specific software? If you aren't, I recommend you to take a look into the Kinetis SDK​, once you have installed the SDK please go to the folder C:\Freescale\KSDK_1.3.0\examples\twrkw24d512\driver_examples\dspi\dspi_non_blocking\master and open the project. This example code will help you enabling what you are asking for.

If you are using a BeeKit generated project, it already includes some functions to use the SPI instance which includes your MCU. You can find them in PLM/Source/SPI.

pastedImage_2.png

Please let me know if you need any additional direction and if this is useful for you.

Best regards,

Earl.

0 项奖励
回复
742 次查看
diaskuo
Contributor II

Hi Earl,

I saw below info on page 17, MKW2xDxxx.pdf, Rev. 1, 11/2013.

The MKW2x SiP uses a SPI interface allowing the MCU to communicate with the radio's

register set and packet buffer. The SPI is a slave-only interface; the MCU must drive

R_SSEL_B, R_SCLK and R_MOSI, ..., etc.

Can a MKW24D512VHA5 be SPI master to connect to SPI slave (e.g. a temperature sensor)?

Best regards,

Dias

0 项奖励
回复
742 次查看
EarlOrlando
Senior Contributor II

Hello Dias,

The MKW2xD devices include one additional SPI instance additionally to the one used to control the internal radio. The section you are referring makes reference to the radio's SPI instance but the another instance can works either as master or slave.

Best regards,

Earl.

0 项奖励
回复