Forum Rule: Always post complete source code & details to reproduce any issue!
-
Is there any sd card detect pin for Teensy 3.6 builtin SD Card
Hi,
I cannot find any information for detecting the presence of an SD card for T3.6's built-in Sdio card slot. I'm aware this can be done with may of the spi card reader modules but I need the additional speed provided by the builtin sd card.
Does anybody know if this is directly wired to any pins on the T3.6 processor, and if so could you give some guidelines on whether I can include an ISR to implement code when the card is detected vs. not detected.
I am using this with a TFT screen so in the absence of a card detect pin the only option I see is to have the Teensy read the card and if an error is returned when reading, then assume the card is removed and enter a reset type screen waiting for a user to touch a button on TFT screen to say it has been inserted. Then I can get it to go through initialization of the SDFat library again and resume operation. However a Card Detect pin on an ISR would be simpler and more reliable in my opinion.
Hopefully, someone can help.
Regards,
Pat
-
Senior Member
No, sadly there isn't any hardware provision like a physical card detect switch or resistor on a data line. The only viable way is polling by trying to communicate with the card.
-

Originally Posted by
paqwa
more reliable in my opinion.
Not sure if this is correct. It does not help to know if the card is inserted - but does not respond. The only reliable way, in my opinion, is to test if the communication works.
-
Thanks Paul and Frank,
Firstly, I just wanted to say that while this is my first time posting here I've followed 100's of your discussions on forums over the past year/two since I got my first micro-controller and have always found them a great inspiration as well as being a very helpful guide to tinkering with them. So thanks for that and please keep up the excellent work.
Anyway, back to the issue. May be worth noting that I also just came across a thread which is of interest to this topic (link below), specifically a post by posse noting a register on the chip that should be able to report if card is present. However, I believe it needs to be polled rather than the neater implementation of being coupled to an ISR, very much doubt the NVIC has an IRQ for it. Anyway, going to try this out over the weekend and will update thread if successful to further share with others.
https://forum.pjrc.com/threads/43422...etect?p=140505
Thanks to all for now.
P
-
Senior Member
I know this is an old thread, however, you can do sdcard detect with an interrupt.

Works for Teensy 3.5/6 and Teensy 4.0/1 with UHS3 (which properly supports the change detect pin!!!).
-
Senior Member
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules