Problem in ILI9341 TFT LCD display with nRF24L01 radio module

The issue is that after initializing radio module the display doesn't print anymore. The first line prints fine. With commented fragment of radio module set up second line also prints. I'm using Arduino Nano clone.

This is code:

#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#include  "Wire.h"

#include <Adafruit_GFX.h>
#include <Adafruit_ILI9341.h>

#define TFT_CS 4
#define TFT_DC 3
#define TFT_RST 2

#define TFT_MOSI 11
#define TFT_MISO 12
#define TFT_CLK 13

RF24 radio(8, 7); //CE, CSN
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_MOSI, TFT_CLK, TFT_RST, TFT_MISO);

const byte address[6] = "00001";


void setup() {

  tft.begin();
  tft.fillScreen(ILI9341_BLUE);
  tft.println("test");

  radio.begin();
  radio.openReadingPipe(0, address);
  radio.setPALevel(RF24_PA_MIN);
  radio.startListening();
  delay(500);
  radio.stopListening();
  radio.powerDown();


  delay(1000);
  tft.setTextColor(ILI9341_GREEN);
  tft.setCursor(10,10);
  tft.setTextSize(10);
  tft.println("HELLO");

}

What output do you get when you compile? Could be enough memory usage to not let the sketch run.

Find a smaller tft library that can work without Adafruit. Adafruit uses 40% of memory when used with the OLED .95". I found a library for text only, used ASCII for graphics, and the library only used 8%.

Or... could be insufficient power issues.

the majority of ILI9341 TFT modules use 3.3V logic (even if powered from 5V) - the Classic Nano uses 5V logic - if you have connected the Nano directly to the TFT you could damage the TFT

as @xfpd suggests the Nano could have insufficient power output - try an external power supply?

Can you post the entire code?

Could be related to the RF24 wanting to default to 100KHz SPI while the display used 400KHz, or the RF24 re-initializing the SPI bus.

That's the entire code. I have empty loop function.

Thats the output: "Sketch uses 11860 bytes (38%) of program storage space. Maximum is 30720 bytes.
Global variables use 302 bytes (14%) of dynamic memory, leaving 1746 bytes for local variables. Maximum is 2048 bytes." And using external power supply doesnt change anything. It seems that this radio module blocks SPI line once its initialized.

I have found solution here:

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