Multiple Slaves on one SPI for the KL25Z48M

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

Multiple Slaves on one SPI for the KL25Z48M

Jump to solution
999 Views
donmacnally
Contributor I

I notice that the SPI devices on the KL25Z48M only have 1 chip select, for example, SPI0_PCS0.

I need two devices on 1 SPI device. I'm thinking that I can use two GPIO's for the two spi chip selects and leave the SPI0_PCS0 unused.

I'd just need to manually control the GPIO's before and after the SPI reads and writes.

Does that sound like a valid solution?

Is their a better way?

Don

Labels (1)
Tags (2)
0 Kudos
1 Solution
731 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi,

Yes, you can use two GPIO pins as SPI chip selects instead of the original SPI0_PCS0 pin.

Wish it helps.

View solution in original post

0 Kudos
3 Replies
731 Views
donmacnally
Contributor I

Clarification;

The need is for two external slave devices attached to 1 KL15 SPI Master device.

So is the best way to do this;

In PE select 0 chip selects.

Use two manually controlled GPIO's for the two chip selects.

?

0 Kudos
732 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi,

Yes, you can use two GPIO pins as SPI chip selects instead of the original SPI0_PCS0 pin.

Wish it helps.

0 Kudos
731 Views
donmacnally
Contributor I

Thank you,

I find out that the GPIO pin goes low 9uS before the MOSI pin begins to toggle and then goes high 10uS after the MOSI pins last data bit.  So the price to pay for using GPIO is ~19uS of compute time.

0 Kudos