TFT ILI9341 display interfere with SD card on ESP32 Dev Module

I am using tft_espi library and I am trying to use an SD card (external module) on the same bus(VSPI) and NRF24L01 on the other one(HSPI), but when i upload the sketch everything works fine exept the touchscreen and the RF24 initialization is failing, but somehow it sends the signal. Is it even possible to make all these components work together?

#include <TFT_eSPI.h>
#include <SD.h>
#include "WiFi.h"
#include "RF24.h"
#include <RF24Network.h>

//display pins in the userSetup.h
#define TFT_MISO 19
#define TFT_MOSI 23
#define TFT_SCLK 18
#define TFT_CS   15  
#define TFT_DC    2 
#define TFT_RST   4 
#define TOUCH_CS 16  

SPIClass* hspi = new SPIClass(HSPI);
TFT_eSPI tft = TFT_eSPI();

RF24 radio(27, 26);  //CE CSN
RF24Network network(radio);

const uint16_t master_node = 00;
const uint16_t slave_node = 01;

void init_tft() {
  tft.begin();
  tft.setRotation(3);
  tft.fillRect(0, 0, 320, 240, BLACK);
  draw_navbar();
  show_time_format(rtc.getHour(h12, AM_PM), rtc.getMinute(), rtc.getSecond(), 90, 10, 3, GRAY);
  draw_buttons(pages[0].num_of_btns, pages[0].buttons);
  digitalWrite(tft_backlight, HIGH);
}

void setup() {
  Serial.begin(115200);
  Wire.begin();
  hspi->begin();
  //pins mode
  pinMode(tft_backlight, OUTPUT);
  //tft
  init_tft();
  //card sd
  if (SD.begin()) {
    Serial.println("SD found");
  } else {
    Serial.println("SD NOT found");
  }

  //rf24
  if (!radio.begin()) {
    Serial.println("Radio hardware not responding!");
  }
  radio.setChannel(90);
  network.begin(master_node);
  //wifi
  WiFi.mode(WIFI_STA);
}

This is how i send the signsl. For now nothing is receiving it

  RF24NetworkHeader header(slave_node);
  bool ok = network.write(header, &current_time_seconds, sizeof(current_time_seconds));
  Serial.println(ok ? F("ok.") : F("failed."));

This is only a part of the code because it pretty long...

Show us a link or picture of the module.

That adapter is not suitble for use when there are other devices on the SPI bus.

And its not really designed for use on 3.3v logic micros like the ESP32 either.

ok. Thanks for the information. I tried just now with the tft built in sd slot and seems to work fine.
What adapter do you recommand?

The SD card is 3.3V Logic. The ESP32 is 3.3V logic. So you dont need an SD card adapter with logic level conversion.

Use an adapter that is designed for 3.3V logic levels, some examples below;

Screenshot - 29_02_2024 , 18_52_48

Screenshot - 29_02_2024 , 18_53_21

Thank you.

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