Hi everyone,
this is the first time that i use this board and i recentely started to work on an existing project for my company.
I have to write an sd card driver but i can’t make SDCard and LoRa work togheter, my configuration is:
LoRa SDCARD
CS 18 CS 27
SCK 5 SCK 5
MISO 19 MISO 19
MOSI 27 MOSI 27
i put a pullup resistor (1.5k) between sd cs and VCC , another one between lora cs and VCC.
I have the GPIO 17,23,25 and 36-39 free, i tried to use these but everything i put on GPIO 36/39 didn’t work, i know that are only input ports, maybe there is some workaround to let them work?)
i found some solution (like that), but nothing work.
surely i’m making a lot of mistakes, but i have no time to study all the architecture (long story) .
the code is
#include <lmic.h>
#include <SPI.h>
#include <SD.h>
const lmic_pinmap lmic_pins = {
.nss = 18,
.rxtx = LMIC_UNUSED_PIN,
.rst = 14,
.dio = {26, 34, 35}, // Heltec WiFi LoRa Board V2 (34,35) ; Heltec WiFi LoRa Board V1 (32,33)
.rxtx_rx_active = 0,
.rssi_cal = 8, // This may not be correct for Heltec board
.spi_freq = 8000000,
};
#define SD_CS 27
#define SD_SCK 5
#define SD_MISO 19
#define SD_MOSI 27
SPIClass spi1;
void setup()
{
// LMIC iniyt
os_init();
// Reset the MAC state. Session and pending data transfers will be discarded.
LMIC_reset();
pinMode(SD_CS, OUTPUT);
digitalWrite(SD_CS, HIGH);
SPIClass (1);
spi1.begin(SD_SCK,SD_MISO,SD_MOSI,SD_CS);
if(!SD.begin(SD_CS,spi1)){
Serial.println(“Card Mount Failed”);
}
}
thanks for help