-->
Page 1 of 1

TFT 1.8 display used with SD card (Nodemcu esp8266)

PostPosted: Thu Feb 15, 2018 6:18 am
by Tribolo1
Very strange issue found in a simple tracer project. I used NodeMcu (V01), one display TFT 1.8 (SPI) and the SD card on board of TFT display (all hardware details in the picture attached).
The first test code is very simple, setup ftf display, setup the SD card and print the right massage on the display.
Simple but.... It works only separately, if I try to init the SD card After the init of display the code doesn't works and the display seems blocked.

CODE:
/*
SD card with TFT Test
Nodemcu v1
*/
// include the SD library:
#include <SPI.h>
#include <SD.h>
#include <Adafruit_GFX.h> // Core graphics library
#include <Adafruit_ST7735.h> // Hardware-specific library

// set up variables using the SD utility library functions:

#define SD_CS 4
#define TFT_CS 5
#define TFT_RST -1 // Connect to nodemcu reset
#define TFT_DC 16
#define TFT_SCLK 14
#define TFT_MOSI 13
Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_MOSI, TFT_SCLK);

void setup()
{
// initialize a ST7735S chip, black tab
tft.initR(INITR_BLACKTAB);
tft.fillScreen(ST7735_BLACK);
tft.setCursor(0, 0);
tft.setTextColor(ST7735_YELLOW);
tft.setTextWrap(true);
Serial.begin(9600);

// Open serial communications
Serial.print("Initializing SD card...");
tft.println("Sd Card init..");

// initialize SD card
if (!SD.begin(SD_CS)) {
Serial.println("initialization failed!");
tft.println("SD Init failed!");
return;
}
Serial.println("SD Init done!");
}


void loop(void) {
tft.println("OK OSCAR");
delay(5000);
}

Thank you all for any advice

Re: TFT 1.8 display used with SD card (Nodemcu esp8266)

PostPosted: Fri May 04, 2018 4:05 am
by Vincenzo Miceli
Hello,

can you check if doing the SD card init before the tft init make a difference?

V.