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

Thread: Audio Adaptor SD card and Flash Memory

  1. #1
    Junior Member
    Join Date
    Jul 2020
    Posts
    10

    Audio Adaptor SD card and Flash Memory

    Hello!
    I have a few questions with my project. I made my very first PCB using fusion360 software and surface mount assembly by JLPCB. A teensy4, adafruit MPR121 touch sensor, and audio adaptor connect with headers, and there are 33 surface mount leds.
    Amazingly enough, the pcb works! The feeling when those leds lit up, just wow lol. Thereís was just one thing, however...

    The audio adaptor works, all of my audio synthesis and audio files stored in program memory work fine. But, The SD card is not recognized. On my custom pcb, the audio adaptor is ~3 inches away from the teensy, connected with traces.

    Question 1:
    Could it be the distance from the teensy that is causing the SD card to fail? I remember reading warnings about using long wires to connect the audio adaptor, but was hoping 3Ē traces would be ok. Anything else I could check?

    My project uses 8 wav files that play from the SD card. In reality, a SD card is far more memory than I need. I have here 16MB flash memory chips from a reputable teensy distributor, so was thinking to use these instead. Maybe the SDcard failure was a hidden blessing after all.

    Question 2:
    Is there anything about the SD card failing that would also affect flash memory? Pins or distance from the teensy.

    Question 3: is it possible to load files onto flash memory using a teensy 4 *without using copyfromSD*, since I have no SDcard?

    I suppose I could build up the audio adaptor and use a second teensy with stacking headers to load and test the flash, then move the audio adaptor to the project pcb. Probably should do that anyway! But curious to know if I can load or change files on the flash without access to the SD card.

    Thanks for any help!

  2. #2
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    15,274
    Does the SD have good power? Are the wires properly connected? An early for T_4.0 breakout ended up with swapped wires and that needed revised,

    Post in recent days says TeensyTransfer works on T_4.0 - a HID sketch runs on Teensy and file transfers over USB for storage.

  3. #3
    Junior Member
    Join Date
    Jul 2020
    Posts
    10
    Iíll look into TeensyTransfer, thanks!

    The audio adaptor is connected pin for pin according to the webpage on pjrc, which only lists 3.3V. How could I measure if itís getting enough power?

    The adaptor was purchased from an online retailer; any way to know if itís an old one that has wires swapped? (If Iím understanding correctly)

  4. #4
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    4,100
    Note, be sure to connect both ground pins (the one next to pin 0 on the left side, and the one between VIN and 3.3v on the right side).

    On the Teensy 3.x, these are separate ground pins (the one next to pin 0 is the digital ground and the one between VIN and 3.3v is the analog ground). The audio adapter uses the analog ground for audio stuff, but it uses the digital groun for SPI stuff (SD card, flash memory).

    On the Teensy 4.x, these two pins are both digital ground (there is no concept of analog ground on the Teensy 4.x). But when Paul redesigned the revision D audio adapter, he kept using the ground next to pin 0 for the SPI devices, and the ground between VIN and 3.3v for the rest of the audio board.

  5. #5
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    4,100
    Quote Originally Posted by phi View Post
    I’ll look into TeensyTransfer, thanks!

    The audio adaptor is connected pin for pin according to the webpage on pjrc, which only lists 3.3V. How could I measure if it’s getting enough power?

    The adaptor was purchased from an online retailer; any way to know if it’s an old one that has wires swapped? (If I’m understanding correctly)
    Underneath the audio shield, you will see either "Rev d" or "Rev c". If you see "Rev d" that is the appropriate adapter for the Teensy 4.0 an 4.1. If you see "Rev c", "Rev b", or possibly no "Rev" that adapter is the correct adapter for the Teensy 3.1, 3.2, 3.5, or 3.6.

  6. #6
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    15,274
    Quote Originally Posted by defragster View Post
    Does the SD have good power? Are the wires properly connected? An early for T_4.0 breakout ended up with swapped wires and that needed revised,
    ...
    This part was off base - didn't read the Audio adapter - saw T_4.0 and PCB and assumed the under pads were used ...

  7. #7
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    25,233
    Quote Originally Posted by phi View Post
    Question 1:
    Could it be the distance from the teensy that is causing the SD card to fail? I remember reading warnings about using long wires to connect the audio adaptor, but was hoping 3” traces would be ok. Anything else I could check?
    On the wire length, all of the issues we saw were with the MCLK signal to the SGTL5000 chip.

    Usually SD cards work fine with 3 inches of wire. With all wiring, running the ground wire along the same path as the signals is best. Adding a decoupling capacitor between 3.3V and GND close to the SD socket is a good plan.

  8. #8
    Junior Member
    Join Date
    Jul 2020
    Posts
    10
    Well this is embarrassing but a huge relief: the sd cs pin was routed on my schematic but didnít make it onto the pcb. One piece of wire later, SD card is recognized. Whatís a first-time PCB without a kludge, ha! Full spectrum roller coaster synth dev experience...do I get a badge?

    What an incredible community to get so much help in such short time, you guys are amazing. I hope you all have a wonderful week!

  9. #9
    Junior Member
    Join Date
    Jul 2020
    Posts
    10
    Might have spoke too soon,
    The SD card is recognized, but when I play an audio file from it, the output from the audio adaptor goes to a zippering click sound that remains until I restart the device.

    Is this likely due to a short in the kludge, or something else to consider?

  10. #10
    Junior Member
    Join Date
    Jul 2020
    Posts
    10
    The kludge meters continuity and no shorts...

    One of the grounds from the audio adaptor goes direct to the Teensy.
    The other ground from the audio adaptor looks like autoroute sent it through the ground leg of an led before it gets to the teensy.
    Most of the board was routed manually, but I missed this.
    The leds have decoupling caps between ground and V, and the leds get 5V.
    The sound from the audio adaptor when a SD file is playing is much much louder and distorted, with a zippering sound, and gradually becoming more so.

  11. #11
    Junior Member
    Join Date
    Jul 2020
    Posts
    10
    Hi!
    Quick update and case closed:
    I soldered a wire direct from teensy to audio adaptor for the MCLK signal. That trace was right on the edge of design rules in my layout.
    Thanks to Paul for pointing out that is the touchy one to watch out for. With the wire soldered, everything works. Thanks everyone!

Posting Permissions

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