Unable to access the SD card on the Audio Adapter

Status
Not open for further replies.

SynthNerd

Member
New to the Teensy and starting off with the 4.1 and audio board 4.0 and following the Audio Workshop with both boards on a breadboard rather than stacked. Jumper wires are all 4” long maximum.

The only area I cannot get to function is the SD card on the audio adapter. Taking a step back and simply using the example Teensy sketch - CardInfo, it reports a failed initialisation. I have selected the appropriate SPI I/O for the 4.1 combo: By default MOSI is 11, MISO 12, SCK 13 and CS is 10 but to make sure I have uncommented the audio board lines and changed them to the above.

If I move the SD card from the audio adapter into the 4.1 and change the chipSelect to BUILTIN_SDCARD then all works perfectly suggesting that the audio adapter is functioning fine.

Out of desperation, I have changed the SPI addressing to point towards the 4.1 built in SD card instead of using BUILTIN_SDCARD:
MOSI 43, MISO 42, SCK 45, CS 44 but again a fail initialisation. I have tried another external SD card and similar failed results.

I have buzzed out the jumper wires from the Teensy 4.1 right through to the pins on the audio adapter SD carrier and they are all good.

So, the SD card and audio adapter are fine as they play back the sample wav files when inserted into the Teensy 4.1 slot. Any attempt to use any SPI, SPI1 or SPI2 results in a failed initialisation.

Just a final point, in case the wrong duplicate libraries are being used, I have renamed the Arduino libraries folder to force it to use the Teensy libraries. Looking at the verbose output, references all look to be pointing towards hardware\\teensy etc

I am at a loss now as to what else to try so would welcome any suggestions.
 
Good news: The BUILTIN_SDCARD is way better than the one the shield, so you really don't need the slot on the shield. It uses 4Bit-parallel transfers, not SPI, and is way faster.
For the shield, there *must* be an issue with the connections, otherwise it would work.
 
I would say part of the problem may be the revision of the audio board that you are using. I look at this page: https://www.pjrc.com/store/teensy3_audio.html.

If you are jumping wires from the Audio board to the T4 follow the pinout on the that same page and just use pins 10, 11, 12, and 13.

I am using a Rev D board with the T4.1 and tried Cardinfo file in the sd examples and it didn;t have any issues reading the card on the audio adapter.
 
Thank you both for the replies. Going forward I will certainly use the BUILTIN_SDCARD but reluctant to leave the issue unresolved as I hate to admit defeat on something which should be straightforward. I have lost count how many times I have checked the SPI wiring and even buzzed it from the respective pins on the T4.1 to the actual SMT pins on the adapters SD socket. It is reassuring to hear that your own test worked okay which does mean something specifically wrong with my setup. I'll get a scope on it to see if that gives a clue.
 
Maybe it would help if you told us what revision level you on the Audio adapter and showed us a picture of the wiring.
 
Indeed, the shield is 4.0. I have ripped out all wiring that was neat and tidy using a mix of solid jumpers and jumper wires for a fresh start. As the adapter is too wide to fit a breadboard, the adapter is raised up on a stack of headers so I can use jumper wires point to point. Previously the breadboard was populated with switches and pots for the audio workshop, they have been left off for now. Same results as before.

T4 Wiring Table.JPG


Top View.jpg

RH Side.jpg

LH Side.jpg
 
First suggestion would be to disconnect everything except for the SPI pins need for the SD Card and try reading the SD card without anything else attached. Then run the CardInfo example in the SD library and remember to change the chipselect to 10. The memory chipselect is 6 and that looks ok.

When I am trouble shooting I try and keep the connections down to the minimum needed so in this case it would be just the SD pins. If you don't have flash soldered onto the board I would not bother hooking up the jumper to pin 6.

Then I would go the audio connections. Again since you don't have a pot soldered on don't use those connections.

EDIT: oh would suggest to make sure you are using Teensyduino 1.54 which is the latest version.
 
Thank you mjs513 for the continuing advice. I have reduced the inter-board wiring to just SPI, CS and power and stacked them with 75mm jumper wires:

Double Stack.jpg

Still the same results and yes, using Teensyduino 1.54.

I have purchased the flash chip but yet to solder it to the audio adapter. That could be worth doing to see if that can be accessed. To prove the SPI (11, 13), I have ported across a TFT display routine and that works fine although it does not use a CS. I did change the SD CS to pin 9 in case there was a hardware issue with pin 10 but that also made no difference to the SD card functionality.

T4 with TFT.jpg

In summary of where I am now, I am using the minimum SPI wiring to the audio adapter, I am using the default CardInfo file except for changing chipSelect to 10. The audio adapter functions fine when using BUILTIN_SDCARD but not when using the SD card on the audio adapter. I have proved the same SPI bus for the SD card does work with a TFT display. You have proved the SD functions on your T4.1 and audio adapter.

Where to go from here, purchase another T4.1 and adapter in case of a hardware fault although testing so far does not support that outcome.
 
Cant tell from the photo where pins 10, 11, 12 are going on the audio adapter but hope the are on the other side of the SD Card. Also not sure of your connections for power and ground looks off in the photo - hard to tell from the angle of the photo. From the photo looks like your 3.3v is on pin 23 should be third pin in as shown in the attached photo. You know from connecting the display that SPI works so problem has to be the wiring.
Capture.PNG

Also zooming in on the audio adapter looks like you have some cold solder joints - might want to touch them up or at least ring them out with a meter.
 
In the photo, you have two separate ground wires from the Teensy to the audio board. It looks like the red and green wires go to the Gnd and 3.3V pins on the audio board. But I can't figure out where the other ground lead goes.

Pete
 
In answer to the above:

All connections are mapped pin to pin, i.e. pin 10 on the adapter to pin 10 on the T4.1 etc.
Below is a photo of the adapter underside.

Adapter Underside.jpg

Having reworked this breadboard layout a number of times, buzzed the wiring from the T4.1 direct to the SMT terminals on the adapter SD card, I am confident of the patching between the two boards. Soldering is good, probably just the photo not doing it justice but I have checked again under a magnifier glass as aging eyes require extra diligence. I have 45 years of electronics experience and I design analogue synths so very comfortable with a soldering iron (or six) but accept we can all miss a joint from time to time.

Pete, the second green ground wire goes to the ground terminal above pin 0 as per the layout pic above. No idea if two grounds are required, I am assuming one is an analogue ground in which case not important at this time.
 
Better shot easier to see hard from the other photo.

Having reworked this breadboard layout a number of times, buzzed the wiring from the T4.1 direct to the SMT terminals on the adapter SD card, I am confident of the patching between the two boards. Soldering is good, probably just the photo not doing it justice but I have checked again under a magnifier glass as aging eyes require extra diligence. I have 45 years of electronics experience and I design analogue synths so very comfortable with a soldering iron (or six) but accept we can all miss a joint from time to time.
As you said probably the picture but had to ask.

Without actually hooking up a Logic Analyzer to the pins to the Audio Shield kind of out of ideas.

Except other things that I would normally try. Running the SDFat_usage.ino example. But one last question. I am assuming the message on from the cardinfo sketch is that it failed to initialize. You could try a different SD Card as a test to make sure its not the SD Card. PS SD only read Fat32 or exFat format SD Cards. YOu could try reformating the SD card on the PC. Grasping at straws now.
 
Great minds think alike. I have just come back online to say that progress has been made. I took out the Integral class 10 8GB SD card and replaced it with a Sandisc Ultra 32Gb and it works! So for some reason despite the Integral card working in the T4.1 slot, it will not work in the adapter.

Thank you all for your support, at least the cause has been identified if not the reason behind but I will see if I can see what the difference between the two cards is, perhaps formatting as you suggest. Both cards were new and not specifically formatted but simply had the 4 sample audio files dumped on them.

Thanks again.
 
Yeah. I have had similar problems but then after troubleshooting turned out it was th sd card itself as I mentioned

mike
 
Status
Not open for further replies.
Back
Top