nRF24L01 + Arduino

Hi,

I have got a nRF24L01 device (sparkfun: http://www.sparkfun.com/products/705 ), a Arduino Diecimila and a robot.

The robot is configurated with this parameters:

Channel: 10
Address: AISOY
Payload: 32
Speed: 1 Mbps
CRC ON with 1 byte

I’m using this library: http://arduino.cc/playground/InterfacingWithHardware/Nrf24L01 and I connected nRF24L01 with arduino as in this url.

Datasheet of nRF24L01 : http://www.nordicsemi.com/eng/content/download/2730/34105/file/nRF24L01_Product_Specification_v2_0.pdf

On page 54 can be seen the configurable registers.

My code:

#include <SPI.h>
#include <Mirf.h>
#include <nRF24L01.h>
#include <MirfHardwareSpiDriver.h>
#include "Arduino.h"

byte data[32];

void setup(){ 
  Serial.begin(9600);
  Mirf.spi = &MirfHardwareSpi;
  Mirf.csnPin = 8;
  Mirf.cePin = 7;
  Mirf.init();
  Mirf.payload = 32;
  Mirf.channel = 10;
  Mirf.config();
  Mirf.setRADDR((byte*)"AISAY");
  Mirf.configRegister(RF_SETUP, 0x80); //Air data rate 1Mbit, 0dBm, Setup LNA
  Mirf.configRegister(EN_AA, 0x00); //Disable auto-acknowledge
  Mirf.configRegister(SETUP_RETR, 0x00);
  Mirf.configRegister(CONFIG, 0x7B);
  Mirf.configRegister(SETUP_AW, 0x03);
  Serial.println("Configuration Success.");
  delay(500);
}


void loop(){   
  if(Mirf.dataReady()){
   
    Mirf.getData(data);
    Serial.println(data[0]);
    Mirf.flushRx();
    
  }
}

I want send from robot to nRF24L01 a string, for example “333” and read 3 with serial monitor to verify that is working well.

But when I uploaded this sketch, and I see the serial monitor I read this (robot didn’t send nothing, was off, I only was testing nRF24L01):

Why if i didn’t send nothing? Noise? bad configuration? Mirf.dataReady() should be 0…

Thanks for the replys! :slight_smile:

From the datasheet I think the following line

Mirf.configRegister(RF_SETUP, 0x80); //Air data rate 1Mbit, 0dBm, Setup LNA

should be

Mirf.configRegister(RF_SETUP, 0x07); //Air data rate 1Mbit, 0dBm, Setup LNA

I don't know if that makes a difference but give it a try.

pylon: From the datasheet I think the following line

Mirf.configRegister(RF_SETUP, 0x80); //Air data rate 1Mbit, 0dBm, Setup LNA

should be

Mirf.configRegister(RF_SETUP, 0x07); //Air data rate 1Mbit, 0dBm, Setup LNA

I don't know if that makes a difference but give it a try.

Thanks!

But I tried and did not work :(

a Arduino Diecimila

With a 168 or a 328?

Old thread, but for everyone with the same problem - this happens when you've connected the NRF chip incorrectly. Try swapping pins around (especially MOSI and MISO) until you get 14 as status - meaning no packets in the air. From then on you know it's connected correctly.