1. A breve aggiorneremo la piattaforma di Reboot per risolvere alcuni problemi con i plug-in, quindi chiediamo ancora un po' di pazienza, Lo staff di Reboot

TFT 1.8 display used with SD card (Nodemcu esp8266)

Discussione in 'ESP8266' iniziata da Tribolo1, 17 Feb 2018.

?

Are you interesting in?

Sondaggio terminato il 4 Mar 2018.
  1. Yes, so usefull.

    100,0%
  2. No, Out of my scope.

    0 voti
    0,0%
  1. Tribolo1

    Tribolo1 Livello 1

    Iscritto:
    17 Feb 2018
    Messaggi:
    2
    Like ricevuti:
    0
    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
     

    File Allegati:

    #1
  2. zoomx

    zoomx Livello 19

    Iscritto:
    12 Set 2015
    Messaggi:
    903
    Like ricevuti:
    346
    Maybe are you using a Catalex SD board?
    Because it has a known issue with SPI.
    http://www.vishnumaiea.in/projects/hardware/interfacing-catalex-micro-sd-card-module.

    Anyway TFT and SD shares the SPI bus so you have to check if the CS signal is handled properly.
     
    #2
  3. Tribolo1

    Tribolo1 Livello 1

    Iscritto:
    17 Feb 2018
    Messaggi:
    2
    Like ricevuti:
    0
    #3
  4. zoomx

    zoomx Livello 19

    Iscritto:
    12 Set 2015
    Messaggi:
    903
    Like ricevuti:
    346
    Excuse me, I didn't see the attached hardware diagram.

    I noticed that in sketch you use GPIO4 for SD CS signal but in first post diagram there is not any connection. Maybe you forgot it?

    Another hypotesis, maybe nodeMCU is not able to power SD and TFT at the same time? But in your schematic it seems that the module is powered externally.

    I have some SPI TFT modules but they use a different chip, ILI9341, and I never used SD on a ESP8266 because I used the internal flash with SPIFFS.
     
    #4
Sto caricando...

Condividi questa Pagina