Go Down

Topic: (SOLVED) SFE microSD Breakout woes ... (Read 1 time) previous topic - next topic

KirAsh4

Aha, reading SD.cpp I see this:
Code: [Select]
boolean SDClass::begin(uint8_t csPin) {
 /*
   Performs the initialisation required by the sdfatlib library.
   Return true if initialization succeeds, false otherwise.
  */
 return card.init(SPI_HALF_SPEED, csPin) &&
        volume.init(card) &&
        root.openRoot(volume);
}


Changing that to read
Code: [Select]
return card.init(2, csPin) &&
... instead fixed the problem.

KirAsh4

Hey Tom, on that TXB0104 ... can you suggest a DIP equivalent?  I do all of my prototyping on breadboards before I create an SMD final board ... so I need something in DIP form ... or I'll have to create a breakout for the TXB0104 ...

Tom Carpenter

The begin() function calls card.init() with SPI_HALF_SPEED:

Code: [Select]
boolean SDClass::begin(uint8_t csPin) {
  /*

    Performs the initialisation required by the sdfatlib library.

    Return true if initialization succeeds, false otherwise.

   */
  return card.init(SPI_HALF_SPEED, csPin) &&
         volume.init(card) &&
         root.openRoot(volume);
}


Which means it is running too fast. In Windows, if you open the following file (it is slightly different on Mac):
<arduino directory>/libraries/SD/SD.cpp

You will find the begin() function declaration, just change the SPI_HALF_SPEED to 2.

As for the TXB0104, there are breakout boards available ready soldered:
http://www.adafruit.com/products/395 (This is actually the 8 channel version, TXB0108)
http://www.nanocore12.com/products/details/27/4/accessories/breakout-board,-level-shifter,-3v/5v,-14-pin-wide-dip.html (4 channel TXB0104)
~Tom~

KirAsh4

Yeah, I changed SD.cpp, however rather than specifying 2, I changed it to SPI_QUARTER_SPEED and called it a day.  It works.  :)

Thanks for the links!

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy