Hello,
I have a question regarding communication between my Tiva C EK-TM4C123GXL lauchpad and a generic SD Card breakout board.
Using:
- Energia 0101E0013
- Windows 8.1
- SD Library (SD_TM4C)
- 4 GB FujiFilm SD card
I CAN get the ReadWrite demo program in the SD library to work sucessfully by wiring everything up according to the 1-page pinout diagram that came with my board for the SPI bus.
Hardware wiring (SD breakout --> Launchpad):
SDCS --> J2.9 / PA3 / 12
MOSI --> J2.6 / PB7 / 15
SCK --> J1.7 / PB4 / 7
MISO --> J2.7 / PB6 / 14
And then I change the ReadWrite code so that it looks like this:
void setup()
{
...
...
...
pinMode(12, OUTPUT);
pinMode(12, LOW);
if (!SD.begin(12)) {
Serial.println("initialization failed!");
return;
}
Serial.println("initialization done.");
...
...
...
}
...and everything works just fine.
Here's where the problem comes in. I need to change the pins I'm using for the SD card because I'm going to use the Sensor Hub BoosterPack which uses (at least) J2.6 - J2.7 for I2C communication with the sensors. As far as my understanding goes, that means I need to find a different SPI bus for the SD card because I can't switch modes or devices easily.
I have tried wiring up to pins J3.3 - J3.6 and changing my code to this...
void setup()
{
...
...
...
pinMode(24, OUTPUT);
pinMode(24, LOW);
if (!SD.begin(24, SPI_HALF_SPEED, 3)) {
Serial.println("initialization failed!");
return;
}
Serial.println("initialization done.");
...
...
...
}
... but the SD card never initializes correctly. I'm obviously missing something and/or not understanding this SP_TM4C library correctly.
Any help would be amazing.
Thank you!
View the full article on Stellarisiti. 43oh pulls Stellarisiti Energia posts, so that members do not miss out questions. Please bear with this arrangement for now. Thanks!