Teensy 3.1 SPI CS pins

Status
Not open for further replies.

EK701

Well-known member
Is there any trick to using the "alternate" CS pins for SPI (2,6,9,15,20,21,22,23)?

I'm trying to use 15 and 20 as CS pins, but not having any luck. Same setup using pin 10 works fine.

Thanks!
 
You have to let the controller/driver/library 'know' which alternative CS pin you are trying to use; lots of 'stuff' is written with a nice #define/const/function to allow setting alternative CS but they don't all do it the same way so if you cannot find it for yourself you may have to specify what 'stuff' you are trying to use for better help :)
 
Specifically, I'm using U8Glib and SDfat on the SPI bus (spi4teensy3, Arduino 1.6.5 and TD 1.24). With the hardware using CS pins 6 and 10 and specifying that in the appropriate code location, it works. I try pins 15 and 20 and the same hardware and changing the CS pin in the code, it doesn't work. I can bit bang U8Glib to use pin 20 but hardware SPI doesn't work. I can't get the SD card to work on pin 15 at all (no bit bang support in SDfat).
 
Specifically, I'm using U8Glib and SDfat on the SPI bus (spi4teensy3, Arduino 1.6.5 and TD 1.24). With the hardware using CS pins 6 and 10 and specifying that in the appropriate code location, it works. I try pins 15 and 20 and the same hardware and changing the CS pin in the code, it doesn't work. I can bit bang U8Glib to use pin 20 but hardware SPI doesn't work. I can't get the SD card to work on pin 15 at all (no bit bang support in SDfat).

unless i'm missing something, there's no concept of hardware CS pins in spi4teensy?

fwiw, this is what my u8glib "main com function" does:


Code:
case U8G_COM_MSG_CHIP_SELECT:
		if(arg_val == 0)
		{
			digitalWriteFast(_CS, HIGH);
		}
		else{
			digitalWriteFast(_CS, LOW);
		}
	break;

it should work with any pin really.
 
Status
Not open for further replies.
Back
Top