Firmware for Arduino Due SD HSMCI Card. Pin wiring set for the PowerDué. Reference for PowerDué lab for Low Power System on Chip Spring 2016 at CMU-SV.
- Download the files
- Move the folder
Arduino_Due_SD_HSMCI
to your Arduino Libraries - Move the folder
SD_HSMCI
to your Arduino Libraries (Same level asArduino_Due_SD_HSMCI
)
- The
SD
object will be created on#include <Arduino_Due_SD_HSMCI.h>
- Use
SD.MakeDirectory
to create a directory
- Create a new FileStore with
FileStore * f = new FileStore()
- Initiate the File pointer with
f->Init()
- Open the File Structure with
f->Open([DIRECTORY], [FILENAME], [FILE_WRITE | FILE_READ])
- Write with
f->Write([BUFFER], [LENGHT]);
- Close
f->Close()
Change following values to match the wiring of your board.
static const uint8_t PIN_HSMCI_MCCDA_GPIO = 101;
static const uint8_t PIN_HSMCI_MCCK_GPIO = 102;
static const uint8_t PIN_HSMCI_MCDA0_GPIO = 103;
static const uint8_t PIN_HSMCI_MCDA1_GPIO = 104;
static const uint8_t PIN_HSMCI_MCDA2_GPIO = 105;
static const uint8_t PIN_HSMCI_MCDA3_GPIO = 106;
static const uint8_t PIN_HSMCI_CARD_DETECT_ARDUINO = 77;
static const uint8_t PIN_HSMCI_MCCDA_GPIO_ARDUINO = 43;
static const uint8_t PIN_HSMCI_MCCK_GPIO_ARDUINO = 42;
static const uint8_t PIN_HSMCI_MCDA0_GPIO_ARDUINO = 73;
static const uint8_t PIN_HSMCI_MCDA1_GPIO_ARDUINO = 57;
static const uint8_t PIN_HSMCI_MCDA2_GPIO_ARDUINO = 56;
static const uint8_t PIN_HSMCI_MCDA3_GPIO_ARDUINO = 55;