SPI slave select PINs

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

SPI slave select PINs

785 Views
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

Labels (1)
0 Kudos
Reply
1 Reply

606 Views
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 Kudos
Reply