Ultimate GPS Shield & Feather S3 - Data Logging!

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
floaf
 
Posts: 3
Joined: Mon Jan 30, 2023 9:57 pm

Ultimate GPS Shield & Feather S3 - Data Logging!

Post by floaf »

Hi,
I'm trying to use the [Ultimate GPS Shield][/https://www.adafruit.com/product/1272] and the [Feather S3 2MB PSRAM][/https://www.adafruit.com/product/1272] together, and write to the SD Card - the reason I have chosen this is that the development grid in the middle forms a very convenient development space for my project.
I've made the following connections:
SD ----> ESP32-S3
MOSI(DI) ----> 11
SD_CS ----> (None, as it is pulled up by the shield).

I'm attempting to use the VSPI port (as I have a display using the default SPI port). My code is as follows:

Code: Select all

#include <SPI.h>
#include <SD.h>

#define VSPI_SCLK 13
#define VSPI_MISO 12 // 12 -> DI
#define VSPI_MOSI 11 
#define VSPI_SS 14


#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3
#define VSPI FSPI
#endif

//uninitalised pointers to SPI objects
SPIClass * vspi = NULL;
SPIClass * hspi = NULL;

void setup() {
  vspi = new SPIClass(VSPI);
  hspi = new SPIClass(HSPI);
  vspi->begin(VSPI_SCLK, VSPI_MISO, VSPI_MOSI, VSPI_SS); //SCLK, MISO, MOSI, SS
  pinMode(vspi->pinSS(), OUTPUT); //VSPI SS
  pinMode(hspi->pinSS(), OUTPUT); //HSPI SS

  if (!SD.begin(VSPI_SS, *vspi)) {
    while (1) {
      Serial.println("card mount failed");
      delay(100);
    }
  }
}

// the loop function runs over and over again until power down or reset
void loop() {
  //use the SPI buses
  Serial.println("1");
  delay(100);
}
Let me know if any further information is required.

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: Ultimate GPS Shield & Feather S3 - Data Logging!

Post by adafruit_support_mike »

floaf wrote: Mon Feb 06, 2023 3:13 am I'm attempting to use the VSPI port (as I have a display using the default SPI port). My code is as follows:
And?

Does it work, does it fail, does it generate any error messages?

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino Shields from Adafruit”