Multiple Slaves on one SPI for the KL25Z48M

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

Multiple Slaves on one SPI for the KL25Z48M

跳至解决方案
2,652 次查看
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

标签 (1)
标记 (2)
0 项奖励
回复
1 解答
2,384 次查看
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 项奖励
回复
3 回复数
2,384 次查看
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 项奖励
回复
2,385 次查看
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 项奖励
回复
2,384 次查看
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 项奖励
回复