With Teensy 3.2 w/ Quad Audio (2 Shields) can you select which SD card slot?

Status
Not open for further replies.

qcarver

Member
Hello,

Running on the Teensy 3.2 with 2 Audio shields configured thusly: https://www.sparkfun.com/news/2055

Is there a way to select which Audio Shields' SD slot you want to read/write to?

My SD card setup is currently straight out of the example now:

Code:
// Use these with the Teensy Audio Shield
#define SDCARD_CS_PIN    10
#define SDCARD_MOSI_PIN  7
#define SDCARD_SCK_PIN   14

....

/**
  @return void
  @brief Set up the SD card where the audio files will be stored.
 */
void sdSetup() {
    // Initialize the SD card
    SPI.setMOSI(SDCARD_MOSI_PIN);
    SPI.setSCK(SDCARD_SCK_PIN);
    if (!(SD.begin(SDCARD_CS_PIN))) {
        // stop here if no SD card, but print a message
        while (1) {
            Serial.println("Unable to access the SD card");
            delay(500);
        }
    }
}

Thanks,
 
Each SD card should use a seperate CS pin to avoid data conflicts on the same bus.

I vaguely remember a post on this forum regarding proper tri-state of SD card outputs. I also know there have been posts about other devices no behaving on the SPI bus.

You may have to resort to a seperate buffer to take care of this issue. Look at what SumoToy has done with the RA-8875 display for more detail on this problem.
 
The slots need different cs pins. But Im not sure if the sd lib supports two slots. Maybe not.
Well, the default SD card slot seems to not work anymore. The project case is pretty small I suspect I was too rough, in fact the SD card that was in it is cracked. At any rate, I don't really need but one slot and was hoping I could use the other (undamaged one) instead. The whole project is soldered together so it would save me 2 man-days if we could figure it out.
 
if the slots are wired 1:1 both slots should work (ok, if undamaged), if you put a card in only one of them. They are wired the same way (Pauls forgot to add a jumper-pad to separate the chipselects).
 
if the slots are wired 1:1 both slots should work (ok, if undamaged), if you put a card in only one of them. They are wired the same way (Pauls forgot to add a jumper-pad to separate the chipselects).
I have not observed this. In practice, only the SD wired for channel 3&4 is the one that has worked in the past. (Now neither do)
 
I have not observed this. In practice, only the SD wired for channel 3&4 is the one that has worked in the past. (Now neither do)
No good...
Try to switch to a low speed, for example 24MHz. If that does not work, too: Both slots are damaged, or the card is broken.
 
Gentlemen, my apologies. I see why your rules are to post all code, and I have been careful about that because I am writing it under contract. Recently I added a 3 color LED to my project and used the following pins:

Code:
int rLed = A0;
int gLed = A1;
int bLed = A2;

I assumed it was a hardware issue I had created but when I went back to check connectivity between the shields and the 3.2 I noticed that the SD card uses A0 (pin 14). If I leave the LEDs off, there is no problem writing to SD. The cracked SD card was just a red herring (and yes that card IS dead).

Also, you are all correct in that I can use either SD card port among the two shields (as long as I'm not driving LEDs :rolleyes:). So, hopefully that is useful information for you.

Thanks very much for your input. This is my first real post to this community and I am amazed by the response.
-Quinn
 
Status
Not open for further replies.
Back
Top