SPI slave select PINs

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

SPI slave select PINs

1,113 次查看
portal127
Contributor I
If I understand well, when I configure the SPI master, I have to use the PCSn PINs as slave select PINs. These PINs depend on the SPIn port. For example, my board (FRDM-K28F) has only 1 PCS for SPI3, 2 PCSs for SPI2, etc.

 

1. So if I want to use 2 SPI slaves I have to configure kDSPI_Ctar0 for PCS0 and kDSPI_Ctar1 for PCS1, isn't it?

2. And what about if I want to use my own PIN as slave select (I mean custom pin to set high and low from GPIO driver)? Is it possible? For example, can I configure in SPI3 one slave with the PCS0 and another using an external GPIO as slave select pin for a second device?

3. And what about to use only custom PINs as slave select? Is it possible?

 

Thank you,

Antonio

标签 (1)
0 项奖励
回复
1 回复

934 次查看
FelipeGarcia
NXP Employee
NXP Employee

Hi Antonio,

Please see below my answers:

1. Not necessarely, if you want to have the same Ctar configuration for both SPI slaves you can use the same.

2,3. Using GPIO pins as slave pins is possible but you need to disable FIFO by setting the DIS_TXF in SPIx_MCR register.

Please give it a try and let me know your findings.

Best regards, 

Felipe

0 项奖励
回复