nRF24L01+ working in Teensy++ 2.0 and Teensy 3.0

Status
Not open for further replies.
I've removed all the LED's and it hasn't made a difference.

I've used GettingStarted, pingpair and ledremote. The only edit I've made to them was to make pin 20 (SS) output
Code:
pinMode(20,OUTPUT);

The speed of the NRF was changed when I ran the Teensy at 3.3v, as the clockspeed was reduced to 8MHz. I found out that there was code in the intialising to select this.

I haven't got the 2nd one set up at the moment (with 3.3v) as it isn't able to send the packet (before waiting to receive a reply). It is failing before it even makes a ping. I am loathe to change the 2nd Teensy to 3v too as this doesn't seem to be the issue. If however, you should disagree and believe that the 2nd side is required, then I will rig the 2nd up for 3.3v

Here's the current status view
Code:
STATUS		 = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1	 = 0xf0f0f0f0e1 0xf0f0f0f0d2
RX_ADDR_P2-5	 = 0xc3 0xc4 0xc5 0xc6
TX_ADDR		 = 0xf0f0f0f0e1
RX_PW_P0-6	 = 0x20 0x20 0x00 0x00 0x00 0x00
EN_AA		 = 0x3f
EN_RXADDR	  	 = 0x03
RF_CH		 = 0x4c
RF_SETUP		 = 0x07
CONFIG		 = 0x0f
DYNPD/FEATURE	 = 0x00 0x00
Data Rate	 	 = 1MBPS
Model			 = nRF24L01+
CRC Length		 = 16 bits
PA Power	 	 = PA_HIGH

And the failure messages
Code:
Now sending 156123...[Writing 4 bytes 28 blanks]010
failed.
Failed, response timed out.
Now sending 157433...[Writing 4 bytes 28 blanks]010
failed.
Failed, response timed out.
Now sending 158744...[Writing 4 bytes 28 blanks]010
failed.
Failed, response timed out.

The 010 showing a false on tx success, a true on tx failure and a false on rx ready

Thanks again for your time and effort in assisting me. It's much appreciated
 
Tick, first of all: you are welcome. I do it because I also need help to do many things, and I know how good it feels when someone helps you and you finally get things working.

Now gets back to bussiness. The nrf24l01, and the library you are using open pipes to transmit data, maybe the other side is required too. I'm NOT saying this is the cause, because I DIDN'T read the nrf24l01 datasheet (as I should, I know), but I assume the problem you are having is expected when you only have one node working.
 
Seems like a whole lot of heartache here; why not just use the Teensy 3.1? I haven't had any trouble getting the nRF24L01+ to work on this platform...
 
Seems like a whole lot of heartache here; why not just use the Teensy 3.1? I haven't had any trouble getting the nRF24L01+ to work on this platform...

Neither did I with all the boards I listed in the original thread, but the guy has a teensy++ 2.0, which works perfectly fine with the module, he shouldn't have to buy anything else.

He was also testing the ping with only one single node, which I suppose is the problem. I assumed there was a second node working when he started to ask for help. Maybe he still has problems after adding a node, but at least he will be testing with something that should actually work.
 
RESULTS! I was wrong, you indeed require both sides to be hooked up. I'm now getting responses. I have popped my LED's on and used the ledremote example to fully ensure that they are indeed talking to each other and that the responses wasn't a glitch. All is working as it should (save for the switches making the led's do weird stuff, I think the logic needs some fixing. Will look into that)

I have tested both sets of NRF modules, the green PCB and the black PCB in all 4 permutations and it has proven to work. I will now run the teensy's at 5v again and attempt 5v signals as I am wanting to use 5v relays for this project... and for science. I'm sure this thread could use the information :)

Thanks again dc470 for suggesting that both units are required. I will look into the code and find out why a failure to transmit isn't quite what it claims to be.

@onehorse
As the teensy++ 2.0 meets all the requirements to have the NRF going, it should work regardless of what I am using. I think if I had bought another chip it would simply have avoided the problem instead of solving it. Afterall, the whole point of us doing such projects is because we don't want to buy/pay someone to have what we want, buying another chip would be walking down a misleading path.

Will update again
 
Okay, so a couple of findings which I think will help others and should probably be added to the original post or something.

1) Running one Teensy at 5v and the other at 3.3v WORKS*
2) Running both Teensy's at 5v WORKS*

* Running at 5v required a capacitor between the NRF's VCC and GND to work.

now here's the kicker. To get it to work, I had to...
1) Plug one Teensy (Teensy A) in
2) Program Teensy A
3) Unplug Teensy A
4) Plug Teensy B in
5) Program Teensy B (just press upload again or the little button)
6) Plug Teensy A back in
****Here's the good bit****
7) Bring up the console for Teensy A
8) Enter T to have it transmit, then R to have it receive
9) Change COM for Teensy B and bring it up
10) Enter T to have it transmit

I had to toggle one to transmit and back to receive for it to be in receive mode. Again, this is using GettingStarted from the library in the original post, not the current maniacbug library.
 
Okay, so a couple of findings which I think will help others and should probably be added to the original post or something.

1) Running one Teensy at 5v and the other at 3.3v WORKS*
2) Running both Teensy's at 5v WORKS*

* Running at 5v required a capacitor between the NRF's VCC and GND to work.

now here's the kicker. To get it to work, I had to...
1) Plug one Teensy (Teensy A) in
2) Program Teensy A
3) Unplug Teensy A
4) Plug Teensy B in
5) Program Teensy B (just press upload again or the little button)
6) Plug Teensy A back in
****Here's the good bit****
7) Bring up the console for Teensy A
8) Enter T to have it transmit, then R to have it receive
9) Change COM for Teensy B and bring it up
10) Enter T to have it transmit

I had to toggle one to transmit and back to receive for it to be in receive mode. Again, this is using GettingStarted from the library in the original post, not the current maniacbug library.

That's in the code. Try the ping/pong examples. You won't have those issues. I also updated the main post with the default L78L33 schematics. I tested those and they worked at first try. As I said before, I only had problems with PICs and sdcc (there are plenty of examples for other compilers, but I wanted to use sdcc)
Good luck
 
I updated the original post with a new schematic. I used a LM317 regulator to get more than 100mA at 3v. This is required for modules with external antennas. L78L33 is enough for the small modules with the printed antennas.
 
Updated the post again. Now with more details on the power supplies.

I also finally got time to test this library: https://github.com/TMRh20/RF24
and it feels way more stable than the original library. I did a quick comparison, and I had some packet loss with the original version, and it seems to down to 0% with this newer version at the same distance. Looks like it's safe to recommend it.
 
Thanks dc740 for both posting and updating this thread! The TMRh20 lib didn't work for me "out of the box", but your previous example code did. Greatly appreciated!
 
Updated the post again. Now with more details on the power supplies.

I also finally got time to test this library: https://github.com/TMRh20/RF24
and it feels way more stable than the original library. I did a quick comparison, and I had some packet loss with the original version, and it seems to down to 0% with this newer version at the same distance. Looks like it's safe to recommend it.

Hi, I am having Trouble getting my Teensy 3.2 to run with the NRF24L01. I am using Mainiabug RF24 library and the code works fine when I use an Arduino UNO but there is no communication when I use the Teensy.
Do I have to Change a lot to get it working....?? I Need the Teensy for the space.

Would be grateful for any help!!! :)

//NRF24L01_DS18S20_RX_Temperature_Teensy3.2
#include <SPI.h> // Comes with Arduino IDE
#include <RF24.h> // Download and Install (See above)
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);
RF24 myRadio (9, 10); // "myRadio" is the identifier you will use in following methods
byte addresses[][6] = {"1Node"}; // Create address for 1 pipe.
float dataReceived; // Data that will be received from the transmitter
float temperature;
void setup() /****** SETUP: RUNS ONCE ******/
{
pinMode(20, OUTPUT);
display.begin(SSD1306_SWITCHCAPVCC, 0x3c); // initialize with the I2C addr 0x3C (for the 128x64)
Serial.begin(115200);
delay(1000);
myRadio.begin(); // Start up the physical nRF24L01 Radio
myRadio.setChannel(108); // Above most Wifi Channels
myRadio.setPALevel(RF24_PA_MAX); // Uncomment for more power
myRadio.setDataRate(RF24_250KBPS); // Fast enough.. Better range
myRadio.openReadingPipe(1, addresses[0]); // Use the first entry in array 'addresses' (Only 1 right now)
myRadio.startListening();
}
void loop(){
if ( myRadio.available()) // Check for incoming data from transmitter
{
{
myRadio.read( &dataReceived, sizeof(dataReceived) ); // Get the data payload (You must have defined that already!)
temperature = dataReceived;
}
display.clearDisplay();
display.setTextSize(1);
display.setTextColor(WHITE);
display.setCursor(20, 0);
display.println("Temperature");
display.setCursor(20, 7);
display.println("in degrees C");
display.setTextSize(1);
display.setCursor(40, 20);
display.println(temperature);
display.display();
}
}
 
@OE8PCK - I see you've posted essentially the same question 3 times on 3 different thread, all within a several hours of each other. Which should I try to answer? And which get left unanswered for people to find in the future? I'm going to post this same reply on all 3 locations. Please, if you reply, keep it all on 1 thread, ok?

First, look at this thread where a similar problem was recently solved.

https://forum.pjrc.com/threads/42711-Teensy-3-2-with-NRF24L01?p=137080&viewfull=1#post137080

The code originally written for Arduino Uno prints all the info too quickly, before you can open the Arduino Serial Monitor. Read that thread for the solution, and more followup about things needed to make this really work communicating between 2 boards.
 
Status
Not open for further replies.
Back
Top