Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 5 of 5

Thread: Teensy 3.6 Audio Adapter & Built-in SD Card

  1. #1
    Junior Member
    Join Date
    Aug 2019
    Posts
    3

    Teensy 3.6 Audio Adapter & Built-in SD Card

    Hi All

    I'm trying to get the Audio Adaptor working with the built-in SD card on my Teensy 3.6. I'm trying with the example/code for tutorial "Part_1_04_Blink_While_Playing" and I've swapped the comments to define the CS pin as BUILTIN_SDCARD for SDIO.

    The Setup function runs but the whole program stops somewhere after SD.begin() is called, but the setup function never completes and the loop function never runs.

    Code:
    void setup() {
      Serial.begin(9600);
      AudioMemory(8);
      sgtl5000_1.enable();
      sgtl5000_1.volume(0.45);
      SPI.setMOSI(SDCARD_MOSI_PIN);
      SPI.setSCK(SDCARD_SCK_PIN);
      if (!(SD.begin(SDCARD_CS_PIN))) {
        while (1) {
          Serial.println("Unable to access the SD card");
          delay(500);
        }
      }
      pinMode(13, OUTPUT); // LED on pin 13
      delay(1000);
      Serial.println("Setup complete");
    }
    This is my first project with a Teensy so I'm not that familiar with it but I've done my best to try and find out whats going wrong. If I remove all traces of the AudioPlaySdWav object then the code moves on to the loop as expected, I've tried adding some Serial.println()'s to the Audio library and I can see that the object is instantiated and begin() is called and completes on the AudioPlaySdWav object but as expected (loop isn't running) play() is never called.

    I should mention that I've got the files for the tutorial on the SD card, and the SD library on it's own can read the card and list the files.

    Any thoughts on what I can try next?

    Regards
    Ben

  2. #2
    Senior Member+ manitou's Avatar
    Join Date
    Jan 2013
    Posts
    2,198
    what version of arduino IDE and teensyduino are you running? There is a known problem with AudioPlaySdWav and BUILTIN_SDCARD with teensyduino 1.46. Upgrade to 1.47

  3. #3
    Junior Member
    Join Date
    Aug 2019
    Posts
    3
    Quote Originally Posted by manitou View Post
    what version of arduino IDE and teensyduino are you running? There is a known problem with AudioPlaySdWav and BUILTIN_SDCARD with teensyduino 1.46. Upgrade to 1.47
    I was on 1.46 but just upgraded and same behaviour. There's no release notes yet so maybe that known issue hasn't been addressed?

    Worth downgrading? If so do you know where I can obtain the older installers?

  4. #4
    Senior Member+ manitou's Avatar
    Join Date
    Jan 2013
    Posts
    2,198
    The example works for me on T3.5 with BUILTIN_SDCARD. I'm running 1.47. Can you confirm you're running 1.47 by looking at the Help -> About on the Teensy loader window? When you do an install, you can't have IDE or Teeny loader running.
    Do you have the audio adapter with soldered male pins into soldered female header on your T3.6? (maybe attach a photo). Change the sketch to use pin 10 instead of BUILTIN_SDCARD, and try the microSD on the audio shield. Can you generate a sine wave tone through the ear buds?

    It's hard to downgrade. you have to load a fresh copy of Arduino IDE. earlier image
    https://www.pjrc.com/teensy/td_145/
    Last edited by manitou; 08-22-2019 at 12:29 AM.

  5. #5
    Junior Member
    Join Date
    Aug 2019
    Posts
    3
    Hi Manitou

    Was quite late last night and after upgrading teensyduino I forgot to clear out my libraries folder with the copies of SD and Audio. After doing that this morning the examples are working fine.

    Thanks very much for your assistance!

    Regards
    Ben

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •