Shield ST7735 1.8" Shield with seesaw issue with onboard SD card connector

Hello,
I have a shield ST7735 with an arduino mega R3 and wanted to:

  1. measure the temperature using MAX6675 with a thermocouple type K.
  2. save it into a file into the microSD on the shield
  3. display it in the screen of the shield as it changes over time (ideally a plot like display)

But during the first tests of the screen/shield before going into the rabbit hole of the project, I am having issues with SD card.
I based myself in the shieldtest.ino of the example of the library adafruit ST7735.
everything looks like it work with the exception of the SD card, that if I add to the setup to check If it works (if not the print is lost in the printing of other things of the test) so I added to the setup function:

  Serial.print("Initializing SD card...");
  if (!SD.begin(SD_CS)) {
    Serial.println("failed!");
    return;
  }

I am getting Initializing SD card...failed! so it is not beginning, the SD_CS is defined to 4 by default. not sure if I should change it? following here: SPI - Arduino Reference
I should use.... 53? (arduino mega) but if that's so, the pin is not connected as I placed the shield as it would be connected with the arduino uno see attached picture.

what I am missing?

any guidance/recommendations would be appreciated

This does not match your topic title.

A title that matches your subject, a wiring diagram, the hardware you are using, the program you are running.

1 Like

Hello,
my excuses for not being so clear.
the program is the following (copy pasted from the shieldtest.ino in the examples of the shield library)

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

#if defined(__SAM3X8E__)
    #undef __FlashStringHelper::F(string_literal)
    #define F(string_literal) string_literal
#endif

// TFT display and SD card will share the hardware SPI interface.
// Hardware SPI pins are specific to the Arduino board type and
// cannot be remapped to alternate pins.  For Arduino Uno,
// Duemilanove, etc., pin 11 = MOSI, pin 12 = MISO, pin 13 = SCK.
#define SD_CS    53  // Chip select line for SD card
#define TFT_CS  10  // Chip select line for TFT display
#define TFT_DC   8  // Data/command line for TFT
#define TFT_RST  -1  // Reset line for TFT (or connect to +5V)

Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_RST);

#define BUTTON_NONE 0
#define BUTTON_DOWN 1
#define BUTTON_RIGHT 2
#define BUTTON_SELECT 3
#define BUTTON_UP 4
#define BUTTON_LEFT 5

void setup(void) {
  Serial.begin(9600);

  // Initialize 1.8" TFT
  tft.initR(INITR_BLACKTAB);   // initialize a ST7735S chip, black tab

  Serial.println("OK!");
  tft.fillScreen(ST7735_BLACK);
  Serial.print("Initializing SD card...");
  if (!SD.begin(SD_CS)) {
    Serial.println("failed!");
    return;
  }
}

as it can be seen It defines SD_CS, originally it was 4 on the example.
for the wiring, the shiedl is connected to all the pins that would be the ones of the UNO but in the mega with exception of A6 and A7. the rest (A5 to A0) vim,GND GND 5V, 3.3V reset IOREF digitals 0 TO 13 GND AREF SDA1 SCL1 and the six ICSP connectors are connected directly to the shield, to the same pinout layout (so te digital 0 goes to digital 0 analog 1 to analog 1 etc)

What type SD card are you using? The SD library supports SD cards up to 32GB with FAT16 or FAT32 format.

Edit: The 128GB card you have in the SD slot is too big.

The first goal is to solve the topic title. Remove all extraneous devices and code.

Hello, I re made the post and flag it for removing but waiting for the moderators to delete it :sweat_smile:
sorry for the troubles!
also, the issue was the SD cad, that it was giving problems as it was not the correct format

Sorry. I meant "Remove all extraneous HARDWARE devices and code from your PROGRAM CODE" of your project. This way you fix the (topic) first. Then add more code and hardware until you have a working project.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.