Teensy3.1 + CISECO I/O POD uSD (microSD) does not work at all

Status
Not open for further replies.

potz!

Member
Hello!

I want to use a microSD card on a Teensy3.1 so bought a microSD breakout board from Ciseco, because it is simple, small and cheap. A datasheet can be found here. I connected the boards using the supplied 10cm wires for digital pins and some other wires of about the same length for power/gnd like this:

teensy:
Teensy pin no.Teensy pin nameI/O POD pin name
-GND (near button)GND
-3.3V (near button)3V3
10CSSS
11DOUTMOSI
12DINMISO
13SCKSCK

I used the example SDInfo from sdfatlib 20131225 and cardinfo from Arduino SD lib to test and both fail in the very first initialization step with error 0x1 (data 0xff). According to docs/output this means that no card seems to respond/be found. I used a NoName 2GB card and a Samsung 32GB SDHC card. Both produce the same output.

To find the problem I did the following steps:

1. Placed some debug output (Serial.print...) in sdfatlib to check if the right SPI code is used and where the problem arises. Everything seems to be allright but no answer comes in. I increased waiting time without success. SPI freq is set to lowest value by default in this stage of initialization, so reducing SPI_XXX_SPEED makes no difference here.

2. Used a multimeter to check if the breakout board has any pins shorted to another. Wanted to check connection of microSD socket to board but can't reach the pins of the socket because they are in/under the socket. Only did a visual check and the solder points look OK.

3. Used my fathers old scope (maybe from the 80s?) to try to get a better insight in what is happening. First of all I am new to scopes and found out that the scope shows a signal that seems to be the 50Hz from the socket, when not connected to something.
I checked the SPI clock and found it in the low 3digit kHz range I think. The flanks start sharply and are rounded in the last quarter both on the rising and the falling flank. The rounding is not to bad so there's still a distinct plateau.
Next I tried to check the CS signal and found sth. that I don't understand. The signal is in the middle of the scopes display in the beginning, it falls for an extremely short amount of time in the beginning of the initialization but instantly comes back to the center for the waiting time an rises for an equally short amount of time in the end. I don't understand what's happening here and can only guess that the scope pulls the line to a "medium"? level. This behaviour stayed the same on other pins that I configured for CS.
In the end I tried to check the data pins MISO/MOSI but didn't find much. I synced the scope to SPI CLK but found the signal to be totally weird. Additionally I think I influenced the MISO signal with the scope because the error data reported by SDInfo changed to 0x0 (error code stayed 0x1).

4. In the end I connected my 5110 LCD to pins 8-12 to check if the pins are defective but found no problem.

Now I'm at the end of my knowledge. Every hint what I did wrong or could check next is very welcome. The only thing that came to my mind is buying a microSD sniffer board to check the soldering of the socked to the board but would rather do anything that can be done without buying stuff first.

Thanks for reading this!
 
I used the example SDInfo from sdfatlib 20131225 and cardinfo from Arduino SD lib to test and both fail in the very first initialization step with error 0x1 (data 0xff). According to docs/output this means that no card seems to respond/be found. I used a NoName 2GB card and a Samsung 32GB SDHC card. Both produce the same output.

Let's talk about the SD library. I haven't tested SdFat much, but I know for certain SD works.

When you tried the CardInfo example, did you edit the chipSelect pin? The default is pin 4.

Code:
// change this to match your SD shield or module;
// Arduino Ethernet shield: pin 4
// Adafruit SD shields and modules: pin 10
// Sparkfun SD shield: pin 8
// Teensy 2.0: pin 0
// Teensy++ 2.0: pin 20
const int chipSelect = 4;

You need to change this to pin 10. Or you could connect the chip select to pin 4...
 
Thank you very much for your response!
Yes I changed that line to 10. Repeated the example just right now just to be sure.
In the moment I hit Ctrl+Shift+M to start the console, the LED illuminates and after a moment I get the known error message:


Initializing SD card...initialization failed. Things to check:
* is a card is inserted?
* Is your wiring correct?
* did you change the chipSelect pin to match your shield or module?


What would be the next thing to check?
 
Other things that came to my mind:
- Power supply is USB. Using two different cables and two different computers. Both are Linux 64bit.
- Could 10cm of wire be to much? Someone mentioned that he uses source termination resistors, but I don't really know how to do this properly.
 
Unlikely your trouble, but I had a USB micro cable that was rather thin. It would not power some USB things adequately due to small gauge wire.
And try different types/brands of SD card, after confirming all wiring.
 
Unlikely your trouble, but I had a USB micro cable that was rather thin. It would not power some USB things adequately due to small gauge wire.
I don't think this could be my problem as both wires that I tested are different and both came with android devices for charging/data. I don't have a third cable.

And try different types/brands of SD card, after confirming all wiring.
Unfortunately I don't have more than the two cards mentioned in the first post. I will try to borrow some other cards though.
What additional checks on my wiring do you suppose? The used pins (except CLK) and cables work with my 5110 LCD and I have put this together multiple times, ending up with the connections listed in the table of my first post every time.
 
So I realized that I used the scope in AC mode. Switched it to DC today and checked CS and SCK again. CS is correct now but SCK is a mystery to me. I don't get why it's different now than in my first post but see this "screenshot" ;) for what I got today:
osci_microsd_clk_edit.jpg
The sweep range was set to 10KHz and the poti for variable sweep near the right end of it's range, so I suppose the sweep should be somewhere around 100KHz? So what am I seeing in the pic? Is the scope to slow to visualize the individual clock cycles of bursts of 8 or is my clock brutally distorted?

Note: all pins work well with my 5110 LCD including SCK but frequency is to high for my scope.
 
Of course! But I don't know if you want to see my very crude wiring. I have taken two photos because you can't see everything in one.
wiring1.jpgwiring2.jpg

One thing came to my mind:
The difference of the clock signal compared to what I described in my first post most likely comes down to using SDfatlib in the first post and SD.h today. SD.h seems to use SPI_HALF_SPEED for init() whereas SDfatlib uses SPI_SCK_INIT_DIVISOR which should be much slower.
 
I didn't have any further success with this. Today I tried the third card (SanDisk 16GB microSDHC Class4) but the result is the same: no initialization. Any suggestions?
 
If it were me, I would try changing your SD pin to #4 (and software) and see if by chance it magically works.

Not sure how much current these SDCards use? Could it be more than the 3.3v output from the Teensy wishes to supply?

Not sure if the patches from Paul in this thread: http://forum.pjrc.com/threads/25582...interrupts-and-main-program?p=47270#post47270 would help. I know I used it with my TFT display with SD to get them both to work with each other.
 
Your 6 wires appear to be correct in those 2 photos.

Any suggestions?

Perhaps try a fresh copy of Arduino 1.0.5 and Teensyduino 1.18 or 1.19-rc1, without any copy of SdFat anywhere.

I know this probably isn't the answer you want, but perhaps it's time to simply get the PJRC adaptor?

http://www.pjrc.com/store/wiz820_sd_adaptor.html

I used one of these yesterday with the SD library on a Teensy 3.1. It absolutely does work. The CS signal is routed to pin 4 on that adaptor.

Pin 10 also does work.
 
Thanks for your reply!

If it were me, I would try changing your SD pin to #4 (and software) and see if by chance it magically works..
No success unfortunately.

Not sure how much current these SDCards use? Could it be more than the 3.3v output from the Teensy wishes to supply?.
This is on my mind for weeks. I have voltage regulators on order to solve this.

Not sure if the patches from Paul in this thread: http://forum.pjrc.com/threads/25582...interrupts-and-main-program?p=47270#post47270 would help. I know I used it with my TFT display with SD to get them both to work with each other.
This seems to be SDFat related. I'm using the standard SD library because Paul suggested to.
 
Thanks for your ideas!
Perhaps try a fresh copy of Arduino 1.0.5 and Teensyduino 1.18 or 1.19-rc1, without any copy of SdFat anywhere.

This didn't help unfortunately. Used a clean 1.0.5/1.18 installand removed .teensy and .arduino files

I know this probably isn't the answer you want, but perhaps it's time to simply get the PJRC adaptor?
I have one from Sparkfun on order since yesterday because my preferred shop here in Germany doesn't stock yours. If this doesn't work either I will try to come by one of yours.
 
This seems to be SDFat related. I'm using the standard SD library because Paul suggested to.
I know when I was trying to get the SD library to work with the ADAfruit TFT displays (1.8" and 2.8" with touch), I was having difficulties getting the SD library to work with my Teensy 3.1 using 1.18...
It would fail in the init... It has been a few weeks, but I think internally, the card init, but the volume init failed when, the first call to do a read failed... That is when I converted the test program that displays a bitmap on the display to use SDFat which worked...
 
Same problem with Ciseco "I/O POD microSD Card" from exp-tech.de. After formatting with the "SdFormatter.ino" example sketch of SDfat everything worked fine. Card: 4 GB SDHC (EXP-T04-024)

As i see this moment, exp-tech.de has now audio and OctoWS2811 Adapter in stock, i requested three weeks ago!
 
Thanks for the tip but SDFormatter.ino doesn't work as well because the initialization fails exactly like in CardInfo.ino. Interestingly the unmodified SDFormatter fails even before initializing the card because after sending 'Y' on the prompt to choose an option (E,F,Q), the first char received by Serial.read() without sending anything after 'Y' is 0xff. If I wait for E,F,Q in a loop, it works. There is only one unexpected 0xff.
 
Interestingly the unmodified SDFormatter fails even before initializing the card because after sending 'Y' on the prompt to choose an option (E,F,Q), the first char received by Serial.read() without sending anything after 'Y' is 0xff. If I wait for E,F,Q in a loop, it works. There is only one unexpected 0xff.
Sorry, i forgot to mention this bug, found and solved in a similar way last night.
 
Interestingly the unmodified SDFormatter fails even before initializing the card because after sending 'Y' on the prompt to choose an option (E,F,Q), the first char received by Serial.read() without sending anything after 'Y' is 0xff. If I wait for E,F,Q in a loop, it works. There is only one unexpected 0xff.
Sorry, I forgot to mention this bug, found and solved it in a similar way last night.
 
Status
Not open for further replies.
Back
Top