Go Down

Topic: nrf24L01+ in combination with Arduino 1.8" TFT (Read 927 times) previous topic - next topic

dupolas

Hi there,

I am having issues with my nrf24L01+ (RF) in combination with the Arduino 1.8" TFT screen.

Working on an UNO
Both are connected through SPI (pins 11-13).
Both work individually from each other.

When I run my code without the TFT powered up the   radio.printDetails(); gives me some nice details about the RF configuration.
But when I power up the TFT it seems it can no longer communicate with the RF. ( it gives all the 0000 codes after the same radio.printDetails() command ). But I can still write stuff to the screen.

I tried to explicitly set the CS pin to high for my TFT screen before sending stuff over to my RF (and setting the RF pin to LOW). No luck..

CS for the TFT is on pin 10.
I use pin 6 and 7 for the RF module.

any help would be appreciated....

Code: [Select]

#include <SPI.h>
#include <RF24.h>
#include "printf.h"
#include <TFT.h>

//
// Hardware configuration
//

#define ssTFTpin  10
#define dc   9
#define rst  8 

#define ssRFpin  7

// Set up nRF24L01 radio on SPI bus plus pins 6 & 7
RF24 radio(6,ssRFpin);

// set up the tft screen
TFT TFTscreen = TFT(ssTFTpin, dc, rst);


// Radio pipe addresses for the 2 nodes to communicate.
const uint64_t pipes[2] = { 0xF0F0F0F0E1LL, 0xF0F0F0F0D2LL };


void setup() {
  pinMode(ssTFTpin, OUTPUT);
  pinMode(ssRFpin, OUTPUT);

  // set the pins HIGH for both the RF24 pin and the TFT pin
  digitalWrite(ssTFTpin,HIGH);
//  digital.Write(7,HIGH);
  TFTscreen.begin();

  TFTscreen.background(0, 0, 0);

  TFTscreen.stroke(255,255,255);
  TFTscreen.setTextSize(2);
  TFTscreen.text("new test",0,0);
  TFTscreen.setTextSize(5);
  digitalWrite(ssTFTpin,HIGH);
  digitalWrite(ssRFpin,LOW);
  Serial.begin(57600);
  printf_begin();
  printf("\n\rRF24 - initialization starts \n\r");
 
  radio.begin();
  radio.setPayloadSize(8);

  // set up the pipes
  radio.openWritingPipe(pipes[1]);
  radio.openReadingPipe(1,pipes[0]);
 
  // set up the radio
  radio.enableDynamicPayloads() ;
  radio.setAutoAck( true ) ;
  radio.powerUp() ;
  radio.startListening();

  // debug some radio details
  radio.printDetails();
}

void loop() {
}

PaulS

Code: [Select]
#define ssRFpin  7

// Set up nRF24L01 radio on SPI bus plus pins 6 & 7
RF24 radio(6,ssRFpin);

This doesn't have anything to do with your problem but I'm curious why one pin get a name and the other remains anonymous.

pico


But when I power up the TFT it seems it can no longer communicate with the RF.

How are you powering the nRF24L01+ module? Via the Uno 3v3 pin?

If so, I wouldn't be surprised if that's your problem. The feeble power available on the Uno 3v3 pin is not really sufficient to power a nRF24L01+ reliably at the best of times. (It will often "kind of" work, but typically with reduced range.) In this case, I suspect the additional power demand of the TFT might be pushing things over the edge.

Try to get 3v3 to the nRF24L01+ module via a different means (e.g., a  low drop LD1117 3v3 voltage regulator running off either the 5V or Vin pins). At a pinch, you can use 3 silicon diodes in series off the 5V to drop the voltage into an acceptable range for the nRF24L01+ modules. A nominal 2.9V (i.e., 5V - 3*0.7V) is fine for powering these modules.
WiFi shields/Yun too expensive? Embeddedcoolness.com is now selling the RFXduino nRF24L01+ <-> TCP/IP Linux gateway: Simpler, more affordable, and even more powerful wireless Internet connectivity for *all* your Arduino projects! (nRF24L01+ shield and dev board kits available too.)

8of10

#3
Oct 18, 2013, 01:06 am Last Edit: Oct 18, 2013, 01:11 am by 8of10 Reason: 1
Hey there
I just wanted to ask if you got it working ??  The reason is because i have the same problem but in combination with (arduino TFT ,CAN bus shield,and a Eathernet shield. Everything works ok until i power up the TFT display.
I dont think it has to do with the power supply , all of my devices run over a separate power supply (5 Amps).


best regards Simon

pico


I dont think it has to do with the power supply , all of my devices run over a separate power supply (5 Amps).

The nRF24L01+ modules are fairly sensitive to noise on the power supply. So you need the requisite amps, but it also needs to be a fairly clean supply. So if you have a 'scope you might want to look at the condition of the rail with everything connected.
WiFi shields/Yun too expensive? Embeddedcoolness.com is now selling the RFXduino nRF24L01+ <-> TCP/IP Linux gateway: Simpler, more affordable, and even more powerful wireless Internet connectivity for *all* your Arduino projects! (nRF24L01+ shield and dev board kits available too.)

8of10

Hi Again
So after a lot of testing with the osci i found out that the eathernet and can modules if they have no information to send to the SPI master then the MISO pin is left LOW but with the TFT its the other way around , so thats why if every thing is connected together only the  Arduino TFT with SD is going to work. If i remove the MISO cabel from the TFT then everything works together except  for the SD slot in the TFT display .

Im just wondering why is that so ? isn't SPI communication standardized ?

best regards Simon

8of10

Ok
Soooo after i look't up some things about SPI transmission it look's like the problem has to do with the  (modes of transmission) between  the devices . So i guess i cant use them together.
just for fun i connected the TFT display to Software SPI and guess what ,,,,, everything is working  :smiley-roll:

regards Simon

Go Up