1.8" TFT combined with nRF24

Hi, i'm building a remote controle device on a MEGA with a nRF24 module and a 1.8" TFT lcd screen.
Using the nRF24 module stand alone works fine, using the 1.8" TFT screen stand alone, also works fine. Using them both together is a problem.

On startup the TFT is used to display some info, this works fine but after starting the nRF24 module (myradio.begin()) the nRF module the display stops displaying more text.

Some code:

<
#include <RF24.h>
#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Adafruit_ST7735.h>
#include "avdweb_VirtualDelay.h"

#define CLIENT_ADDRESS 1
#define SERVER_ADDRESS 2

// define some pins
<
#define TFT_RST 48
#define TFT_CS 50
#define TFT_DC 49
#define TFT_MOSI 51
#define TFT_SCLK 52

#define RF_CE 8
#define RF_CSN 9

//create some object
<
RF24 myRadio(RF_CE, RF_CSN);

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

//TFT displays text until now
<
radiotest = myRadio.begin();

The myRadio.begin() report OK but the TFT does not respond any more to any new commands.
When i remove the myRadio.begin() line and reload the TFT works fine again.

Any suggestions ?

The SPI pins on a Mega are:
MOSI 51
MISO 50
SCK 52
SS 53

Maybe there is a conflict by using pin 50 for CS for the TFT and MISO for the radio? TFT_CS is an OUTPUT from the Mega, but MISO is an INPUT.

Does it work if you switch the TFT_CS to pin 53?

Tnx for the suggestion.

The strange thing is, indevidualy de TFT and the RF module work, only when comined the TFT stop working.
Connecting both to the SPI bus does give any problems, only initialising the RF module ( myRadio.begin()) is blocking the display.

Changing TFT_CS from 50 to 53 gives no solution.

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