Multiple chip selects on a spi port

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

Multiple chip selects on a spi port

927 Views
barbercolman
Contributor III

HI

I am using CW 10.3 and MQX 4.0. I am working with SPI0. I only see 1 chip select.  I am using a MK20DN512VLK10 which shows more than 1 chip select available for SPI0. How do I enable / use a second chip select line?

Thanks

Labels (1)
0 Kudos
4 Replies

519 Views
DavidS
NXP Employee
NXP Employee

Hi Dale,

Please look at the MQXIOUG.pdf in the MQX4.0/docs/mqx path.

Section 9.6 Using the Driver elaborates on how to select the SPI module chip select when doing a fopen() operation:

Ex:

spifd = fopen("spi2:1", NULL); /* CS0 on bus spi2*/

Regards,

David

520 Views
barbercolman
Contributor III

I like your answer because it points to an open question I have. How much are we to use PE with MQX? I have a non PE application developed from the twr60K demo. I am porting the application to the k20 and because it appears that Freescale is moving to PE so started to work with PE. Where is the diving line, should I be setting up RS485 ports using PE or MQX?

Is there any good direction on what to use?

0 Kudos

520 Views
Monica
Senior Contributor III

Dale,

did this help? We'd like to know! :smileywink:

Regards!

0 Kudos

520 Views
DavidS
NXP Employee
NXP Employee

Hi Dale,

For our Kinetis L devices, they heavily reply on PE for baremetal and MQX Lite functionality.

The Kinetis K devices have used PE for clock configuration and quickly adding in drivers for on-chip peripherals.  PE can also help when it comes to porting as the processor component can be changed out and/or helpful for changing packages.

The divide line is user specific.  Some people like using PE much and other prefer using the MQX drivers and adding their own code.  So no right or wrong answer.

Later this year Freescale will offer having the MQX Lite on the Kinetis K devices via PE and the PE will have some nice enhancements.

Regards,

David