MK20DX256 CS Pin

Status
Not open for further replies.
Hello I am making my own teensy board, and was wondering if any digital pin can be used as a chip select pin on the MK20DX256VLH7 (Teensy 3.2)
 
Hello I am making my own teensy board, and was wondering if any digital pin can be used as a chip select pin on the MK20DX256VLH7 (Teensy 3.2)

It really depends...

Chip Select for what? To be used as???

If you are using SPI as the master device, the majority of libraries simply use any digital IO pin, and drive them using something like digitalWrite... (Some more use registers and the like but same difference).

Now there are some Teensy specific libraries, like the ILI9341_t3, library that require the CS and DC pin both be hardware CS pins:

For the SPI object the pins are pins: 10, 2, 9, 6, 20, 23, 21, 22, 15
But there is an additional complication that you can not use all of these together at the same time, that is some of these pins are logically the same to SPI as some of the others:
That is they map to a mask: and the mask bits for the above are: 0x1, 0x1, 0x2, 0x2, 0x4, 0x4, 0x8, 0x8, 0x10

So (10, 2)PCS0 are to SPI the same as is PCS1(9,6), PCS2(20, 23), PCS3 (21, 22), and PCS4(15) is unique...


Now if instead you are wanting to use this board with it hooked up as the SPI Slave device, than you can I believe only use PCS0 for this which again is either pin 10 or pin 2...


Hope that helps
 
Status
Not open for further replies.
Back
Top