Which pin is SD card's SS on Teensy 3.5?

Status
Not open for further replies.

vagyver

Member
Hello!

I am trying to use the on board micro sd card on a Teensy 3.5 but i can't find which is the SD card's SS pin.
Any help?
 
there is no pin it's on the SPI SDIO bus, you need to use the SDFat Beta library on github to access it. I repeat, the SDCARD doesnt use the SPI pins, it has it's own bus.
 
Thank you for your help, i will search at the github.

(I thought i could use the ready examples that are contained inside the teensduino).

By the way, where i can find the schematics of teensy 3.5?
 
there is no pin it's on the SPI SDIO bus, you need to use the SDFat Beta library on github to access it. I repeat, the SDCARD doesnt use the SPI pins, it has it's own bus.

Not correct, there IS a SPI bus overlaying the SDHC, and it has been used to program the uSDCard using SPI.
But you are correct if you suggest to use the sdhc interface and not the SPI interface

Edit: while there is No pin number for CS you can explicitly use PTE4 (alt1)

By the way, where i can find the schematics of teensy 3.5?
where it should be: https://www.pjrc.com/teensy/schematic.html
 
Last edited:
(I thought i could use the ready examples that are contained inside the teensduino).

You can. Just make sure you select Teensy in the Tools > Boards menu first, since modern versions of Arduino show a different Examples menu depending on which board is selected.

When you open any of the examples from File > Examples > SD, you should see this:

Code:
// change this to match your SD shield or module;
// Arduino Ethernet shield: pin 4
// Adafruit SD shields and modules: pin 10
// Sparkfun SD shield: pin 8
// Teensy audio board: pin 10
// [COLOR="#008400"]Teensy 3.5 & 3.6 on-board: BUILTIN_SDCARD[/COLOR]
// Wiz820+SD board: pin 4
// Teensy 2.0: pin 0
// Teensy++ 2.0: pin 20
const int chipSelect = 4;

Again, you need to have Teensy selected. If a non-Teensy board is selected, you'll see Arduino opens the examples from its own copy of the SD library, which doesn't have this extra info (or support for the dedicated SDIO port on Teensy 3.5).


By the way, where i can find the schematics of teensy 3.5?

https://www.pjrc.com/teensy/schematic.html
 
When you open any of the examples from File > Examples > SD, you should see this:

I ran into an issue: If you update the SD car library through the library manager, it saves it in the library folder (where it saves sketches), after which the IDE ignores the Teensy version and only offers the one it just saved (even when the board is selected).

After updating to Arduino IDE 1.8, Teensyduino 1.34, and deleting the SD library in the above folder, it's all working.
 
SD Card Library Name Ambiguity

I ran into an issue: If you update the SD car library through the library manager, it saves it in the library folder (where it saves sketches), after which the IDE ignores the Teensy version and only offers the one it just saved (even when the board is selected).

After updating to Arduino IDE 1.8, Teensyduino 1.34, and deleting the SD library in the above folder, it's all working.

----------------------------------------------------------------------------------------------------------------------------------
I had the same issue and resolved it the same way as above.

Prior to resolution, "SD" showed up under "Examples for any board" and not under "Examples for Teensy 3.6".

After "SD" folder deletion from under "C:\Users\DickC\Documents\Arduino\libraries": "SD" is absent from "Examples for any board" and present under "Examples for Teensy 3.6".

Apparently, the "Examples" menu cannot handle duplicate names even if they occur in separate groups.
Perhaps a fix is needed in the Arduino IDE.
 
Most of this has already been said, but...

Not sure why anyone would want to use the SPI interface to communicate with the SDCard when the SDHC is available and the like.

I also wish Arduino had a better way to control which version libraries get included especially when you have duplicates. If you install a library from GitHub to your <sketch folder> \ libraries it will override the ones Teensy installs. ...

Not correct, there IS a SPI bus overlaying the SDHC, and it has been used to program the uSDCard using SPI.
But you are correct if you suggest to use the sdhc interface and not the SPI interface

Edit: while there is No pin number for CS you can explicitly use PTE4 (alt1)

As I mentioned in another very similar thread maybe yesterday or the day before. The IO pins associated with the SDCard are defined in the IO pins with pin numbers 58-63. I have made a couple of adapters that can plug into the sdcard reader and use these IO pins for other purposes.

Code:
58	PTE0	ADC1_SE4a	ADC1_SE4a	PTE0	SPI1_PCS1	UART1_TX	SDHC1_D1	TRACE_CLKOUT	I2C1_SDA	RTC_CLKOUT
59	PTE1	ADC1_SE5a	ADC1_SE5a	PTE1/LLWU_P0	SPI1_SOUT	UART1_RX	SDHC0_D0	TRACE_D3	I2C1_SCL	SPI1_SIN
60	PTE2	PTE2/LLWU_P1	ADC1_SE6a	PTE2/LLWU_P1	SPI1_SCK	UART1_CTS_b	SDHC0_DCLK	TRACE_D2		
61	PTE3	ADC1_SE7a	ADC1_SE7a	PTE3	SPI1_SIN	UART1_RTS_b	SDHC0_CMD	TRACE_D1		SPI1_SOUT
62	PTE4	DISABLED		PTE4/LLWU_P2	SPI1_PCS0	UART3_TX	SDHC0_D3	TRACE_D0		
63	PTE5	DISABLED		PTE5	SPI1_PCS2	UART3_RX	SDHC0_D2		FTM3_CH0
Sorry quick copy/paste from my Excel document.

All of these pins have ALT1, which is to use as digital pin, some have Alt0 and can be used for Analog pins (not sure if done).

Also all of these pins have ALT3 functions and have Serial2 and Serial4 capabilities.

But more to the point of this thread. All of these pins have SPI1(ALT2 and ALT7) and SDCARD (ALT4) functionality. The SPI library (and Core) was updated to allow these pins to be used for SPI1.

That is you can call:
SPI1.setMISO(59) or pin 61,
SPI1.setMOSI(59) or 61,
SPI1.setSCLK(60)
SPI1.setCS(58) or 62, or 63.

So the pieces are maybe there allow you to use SPI1 to talk to the SDCard, again not sure if anyone has tried to do so...
I have however used these SPI1 pins to run an ILI9341 display

Also sort of interesting the pin PTE4 in SPI mode is CS1-0 (cs 0 on buss 1), in SDCARD mode it is Data2 pin...
 
Status
Not open for further replies.
Back
Top