Hi all,
We are using a Giga board for writing receiver data on an SD card. However, the Giga board has a lot of mistakes while writing. Do you have any solutions to overcome this issue?
Hi all,
We are using a Giga board for writing receiver data on an SD card. However, the Giga board has a lot of mistakes while writing. Do you have any solutions to overcome this issue?
You can check this thread out: Using SD Cards on Arduino Giga?
Thanks. I checked it but my problem isn't solved. I am now trying to use sdfat library. But I face new issues. Cause the giga board can't initialize the sd at all.
Is your SD card OK? Did you also check the SD card and SD card reader with an Arduino UNO?
Yes, it is ok. I checked it with Arduino Mega.
Might help to see additional information, like what sd adapter are you using? How is it hooked up?
How is sdfat configured?
Hard to know if hardware or software. Like does your adapter use voltage level shifters? May work differently as voltage level different on GIGA versus MEGA.
EDIT: Again showing the wiring and how you try to initialize the SDFat library is very important.
For example, are you using the SPI object pins (Which confusingly are shown as SPI1 in the schematic. This is the underlying hardware Wire object used for the Software SPI object
or the SPI1 pins? Which are hardware SPI5 object as shown on their pinout.
On my GIGA, I currently am using the SPI pins with the real simple Sparkfun adapter
And I have SDFat configured like:
// SD_FAT_TYPE = 0 for SdFat/File as defined in SdFatConfig.h,
// 1 for FAT16/FAT32, 2 for exFAT, 3 for FAT16/FAT32 and exFAT.
#define SD_FAT_TYPE 3
#define CS_SD 52
// SDCARD_SS_PIN is defined for the built-in SD on some boards.
//#ifndef SDCARD_SS_PIN
//const uint8_t CS_SD_PIN = SS;
//#else // SDCARD_SS_PIN
// Assume built-in SD is used.
//const uint8_t CS_SD_PIN = SDCARD_SS_PIN;
//#endif // SDCARD_SS_PIN
// Try max SPI clock for an SD. Reduce SPI_CLOCK if errors occur.
#define SPI_CLOCK SD_SCK_MHZ(30)
// Try to select the best SD card configuration.
//#if HAS_SDIO_CLASS
//#define SD_CONFIG SdioConfig(FIFO_SDIO)
//#elif ENABLE_DEDICATED_SPI
#define SD_CONFIG SdSpiConfig(CS_SD, DEDICATED_SPI, SPI_CLOCK)
//#else // HAS_SDIO_CLASS
//#define SD_CONFIG SdSpiConfig(CS_SD, SHARED_SPI, SPI_CLOCK)
//#endif // HAS_SDIO_CLASS
in Setup I have:
if (SD.begin(SD_CONFIG)) {
Note: I am using the DEDICATED_SPI as there is no other SPI objects being used. If you have other SPI objects on the bus, then need to use SHARED_SPI.
IF you are instead using the pins on Shield connectors, then you would specify the SD config to be something like:
#define SD_CONFIG SdSpiConfig(CS_SD, SHARED_SPI, SPI_CLOCK, &SPI1)