Dear all,
Again something that really should work out of the box.
I have a standard SD Card adaptor. Connect to the Arduino Giga R1. Tried different oil settings (switching MISO and MOSI). But SD.begin(10) keeps on giving a fail.
What am I doing wrong? Help is appreciated.
Tried a second adaptor on 5 Volt. Same results.
#include "Arduino.h"
#include "SD.h"
// Vcc to 3.3 volt
// miso to pin 11
// mosi to pin 12
// SCK to pin 13
// CS to pin 11
void setup() {
Serial.begin( 115200 );
while (!Serial && millis() < 5000);
Serial.println("Begin");
SPI.begin();
if (!SD.begin(10))
{
Serial.println("SD card failed!");
}
else
{
Serial.println("SD card success!");
}
}
void loop() {
// put your main code here, to run repeatedly:
}
Thanks,
Now tried this one (and switching MISO and MOSI). No luck so far. Any suggestions?
(*our doubts are seriously growing to use this Arduino product in our commercial product *).
#include "Arduino.h"
#include "SD.h"
// Vcc to 3.3 volt also tried 5 volt
// miso to pin D89 SPI
// mosi to pin D90 SPI
// SCK to pin D91 SPI
// CS to pin 10
void setup() {
Serial.begin( 115200 );
while (!Serial && millis() < 5000);
Serial.println("Begin");
if (!SD.begin(10))
{
Serial.println("SD card failed!");
}
else
{
Serial.println("SD card success!");
}
}
void loop() {
// put your main code here, to run repeatedly:
}
Sorry, I have not use the OLD SD library in a long time.
On the Teensy, there is a newer version which is a thin wrapper onto the SDFat library.
Which gains you lots of stuff, like the ability for long file names, newer SD disks (ExFat)...
Not sure if it helps, but here is a quick and dirty setup I have on mine right now.
Thank you for checking. Either my module is broke, or it could be something related to this
In this link [Use code tags to format code for the forum](https://docs.arduino.cc/learn/communication/spi/) is see the following table
Mode
Clock Polarity (CPOL)
Clock Phase (CPHA)
Output Edge
Data Capture
SPI_MODE0
0
0
Falling
Rising
SPI_MODE1
0
1
Rising
Falling
SPI_MODE2
1
0
Rising
Falling
SPI_MODE3
1
1
Falling
Rising
In SD2card.cpp that only SPI_MODE0 is used. Maybe that is the issue with my card. We I need to dive into that. Btw : In this reference [Use code tags to format code for the forum](https://www.arduino.cc/reference/en/libraries/sd/) Arduino clearly states that
This library is compatible with all architectures so you should be able to use it on all the Arduino boards.
So it would be weird if I have to make changes in the SD library. Keep you posted.