Pages: [1]   Go Down
Author Topic: NRF24L01 problems - Beginner - Not working  (Read 3073 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Full Member
***
Karma: 1
Posts: 129
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am trying to follow the details at http://arduino-info.wikispaces.com/Nrf24L01-2.4GHz-HowTo

I have wired up my Arduino according to the link above.

Signal
RF Module
COLOR
Arduino
GND
1
Brown
GND
VCC
2
Red
3V3
CE
3
Orange
8
CSN
4
Yellow
9 or 7(a)
SCK
5
Green
13
MOSI
6
Blue
11
MISO
7
Violet
12
IRQ
8
Gray
2(b)


I am using the RF24 Library from https://github.com/maniacbug/RF24/archives/master

I am trying the getting started sketch



It has this in the sketch

// Set up nRF24L01 radio on SPI bus plus pins 9 & 10
RF24 radio(9,10);

well pin 10 is not even connected?

PIN9 is connected to CSN

Has anyone got this working? I am new to SPI and generally everything.

If I run the script I get this in the serial monitor

RF24/examples/GettingStarted/

ROLE: Pong back

*** PRESS 'T' to begin transmitting to the other node

STATUS       = 0x00 RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=0 TX_FULL=0
RX_ADDR_P0-1   = 0x0000000000 0xffffffffff
RX_ADDR_P2-5   = 0x7f 0x3f 0x00 0x00
TX_ADDR               = 0x0000000000
RX_PW_P0-6   = 0x00 0x00 0x00 0x00 0xff 0x7f
ENAA                     = 0xff
EN_RXADDR            = 0x00
RF_CH                   = 0x00
RF_SETUP              = 0x00
CONFIG                 = 0x00
DYNPD/FEATURE = 0x7f 0xff
Data Rate            = 1MBPS
Model                   = nrf24l01
CRC Length          = Disabled
PA Power              = PA_Min

Got Payload 4294967295... Sent Response

There is nothing at the other end as I don't have the 2nd unit runing at all!


Chris
Logged

Offline Offline
Full Member
***
Karma: 1
Posts: 129
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

OK I have found that the constructor specifies the CE and CS pins - I take it CSN is CS?

Here is the constructor

RF24::RF24 (uint8_t _cepin, uint8_t _cspin )

Constructor.

Creates a new instance of this driver. Before using, you create an instance and send in the unique pins that this chip is connected to.

Parameters:

_cepin

The pin attached to Chip Enable on the RF module

_cspin

The pin attached to Chip Select


I have changed the constructor to

RF24 radio(8, 9);


But I still have no joy - here is a pic of the board with the pin outs (as I noticed some are different)



Chris
« Last Edit: July 25, 2012, 11:30:23 pm by iisfaq » Logged

Norfolk UK
Offline Offline
Edison Member
*
Karma: 66
Posts: 2473
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

According to this image the pin numbers are the same.
I don't have this hardware and the datasheet does not download but a quick look at the links you supply and I agree the sketch looks like it should read RF24 radio(8, 9); assuming your using an UNO.
Have you also tried changing the wires so CE is pin 9 and CS is pin 10 to match the sketch? A look at the ATMega datasheet shows pin 10 as SPI slave select pin so may need connecting to CS to determine if SPI mode is master (transmit) or slave (receive)
Logged

There is no such thing as a stupid question but there are a lot of inquisitive idiots.

Offline Offline
Full Member
***
Karma: 1
Posts: 129
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for your reply as it may have put me on the right track.

On an Arduino Duemilanove

SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK).

On an Arduino Mega 2560

SPI: 50 (MISO), 51 (MOSI), 52 (SCK), 53 (SS).

Also on the docs for Arduino Mega 2560 it says "The SPI pins are also broken out on the ICSP header, which is physically compatible with the Uno, Duemilanove and Diecimila."

So I have my connections on the wrong pins (as I am using Mega Boards) - I did a quick search for the ICSP header and found this image and page



ref: http://www.instructables.com/id/Adding-ICSP-header-to-your-ArduinoAVR-board/step3/ICSP-header-pinout/




I am about to go change my pins and test...

Chris
« Last Edit: July 26, 2012, 01:56:05 pm by iisfaq » Logged

Offline Offline
Full Member
***
Karma: 1
Posts: 129
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

OK I think I am better now but still not successfully transmitting/receiving.

I am getting what looks to be better data on the debug output from the radio now



The error  I get is timeout when sending a packet.

Now I am unsure about the radio pipe addresses

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

Are these some sort of hardware device id? or are they just created as random numbers?

If they are hardware ids then they look like the RX_ADDR_P0-1 from the screen snap above but the numbers are different in this case.

I tried using those numbers in this area but I still got the same timeout message!

Any ideas?

Chris
Logged

Offline Offline
Full Member
***
Karma: 1
Posts: 129
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

OK

I decided to try to run a different sketch - in this case another example - I think it was pingpong?

This worked for me.

No idea why the "getting started" sketch did not but I will try to see over the weekend - work calls now!
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I seem to have the same problem with the pingpair sketch.

Got a bad connection, but guessing that you didn't get much help?
Logged

Pages: [1]   Go Up
Jump to: