Treat MKW24D512VHA5 as a SPI master

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

Treat MKW24D512VHA5 as a SPI master

Jump to solution
1,116 Views
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 Kudos
Reply
1 Solution
932 Views
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.

View solution in original post

0 Kudos
Reply
3 Replies
933 Views
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 Kudos
Reply
932 Views
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 Kudos
Reply
932 Views
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 Kudos
Reply