NRF24L01+ with Arduino Micro

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
PilotC150
 
Posts: 132
Joined: Sun May 04, 2014 9:39 pm

NRF24L01+ with Arduino Micro

Post by PilotC150 »

I'm trying to get wireless communication going with two Arduinos. An UNO and a Micro (the only two I have right now). I'm able to get the wireless module working perfectly fine on the UNO. At least I think it is. It works enough to output the details when I call radio.printDetails().

On the Micro, though, I'm not having any luck. I tried wiring it on the Micro the exact same way as on the UNO but didn't have any luck.

Then I tried wiring it a bit differently when I saw the SCK, MI, MO pins. I left the CSK and CE pins to the 9 and 10 pins, just like on the UNO. Still not having any luck.

I also tried putting a 10uF capacitor between GND and VCC (because 10uF is the only one I have around). I read that suggestion somewhere but that didn't change anything, either.

Has anybody ever hooked this chip up to a Micro?

Anything I could be missing or anything specific to check?

User avatar
Franklin97355
 
Posts: 23910
Joined: Mon Apr 21, 2008 2:33 pm

Re: NRF24L01+ with Arduino Micro

Post by Franklin97355 »

What code are you running on the micro and which nrf board are you using?

User avatar
PilotC150
 
Posts: 132
Joined: Sun May 04, 2014 9:39 pm

Re: NRF24L01+ with Arduino Micro

Post by PilotC150 »

The board: http://www.amazon.com/gp/product/B00E59 ... UTF8&psc=1

The code is from here, and my code is based heavily off the examples on this page: https://arduino-info.wikispaces.com/Nrf ... 4GHz-HowTo

User avatar
Franklin97355
 
Posts: 23910
Joined: Mon Apr 21, 2008 2:33 pm

Re: NRF24L01+ with Arduino Micro

Post by Franklin97355 »

my code is based heavily off the examples on this page:
could you post the actual code you are using? use the code button above the message text box (</>) to encapsulate your code.

User avatar
PilotC150
 
Posts: 132
Joined: Sun May 04, 2014 9:39 pm

Re: NRF24L01+ with Arduino Micro

Post by PilotC150 »

Right now I'm just trying to do the most basic thing: Get the radio details to print to the Serial monitor.

Code: Select all

#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#include <printf.h>

#define CE_PIN   9
#define CSN_PIN 10

const uint64_t pipe = 0xE8E8F0F0E1LL; // Define the transmit pipe

RF24 radio(CE_PIN, CSN_PIN); // Create a Radio

void setup() 
{
  Serial.begin(57600);
  while(!Serial);
  Serial.println("Nrf24L01 Receiver Starting");
  
  printf_begin();
  printf("\n\rRF24/examples/GettingStarted/\n\r");
  
  radio.begin();
  radio.openReadingPipe(1,pipe);
  radio.startListening();
  
  radio.printDetails();
}

void loop()
{

}
The while(!Serial) idea came straight from the Arduino site: http://arduino.cc/en/Guide/ArduinoLeona ... nardo#toc4

User avatar
PilotC150
 
Posts: 132
Joined: Sun May 04, 2014 9:39 pm

Re: NRF24L01+ with Arduino Micro

Post by PilotC150 »

Like I said, it works perfect on the UNO, just not on the Micro. Or at least it will print the details. I haven't gotten as far as finding out if it will trasmit and receive.

I'm mostly wondering if there's anything particularly different about how this needs to be wired up on the Micro. Should I be using the same pins that I'm using on the UNO (as indicated here (http://arduino-info.wikispaces.com/Nrf2 ... 4GHz-HowTo), about halfway down the page) or should I be using the SCK, MI and MO pins on the Micro. At least answering that question would be the first step to debugging this since I've actually tried it in both configurations already.

(Sorry for the double post, it wouldn't let me edit my last post.)

User avatar
Franklin97355
 
Posts: 23910
Joined: Mon Apr 21, 2008 2:33 pm

Re: NRF24L01+ with Arduino Micro

Post by Franklin97355 »

Well there is a difference in the processor used. The UNO is a 328 and the micro is a 32u4 and acts like a Leonardo. How are you connecting to the micro? Which pins are you using?

User avatar
PilotC150
 
Posts: 132
Joined: Sun May 04, 2014 9:39 pm

Re: NRF24L01+ with Arduino Micro

Post by PilotC150 »

There are seven pins that are used on the chip (the IRQ isn't needed, at least from everything I've been reading).

On the UNO:
GND -> GND
VCC -> 3.3V
CE -> 9
CSN -> 10
SCK -> 13
MOSI -> 11
MISO -> 12

I've tried that exact same configuration on the Micro with no luck. I've also tried:
GND -> GND
VCC -> 3.3V
CE -> 9
CSN -> 10
SCK -> SCK
MOSI -> MO
MISO -> MI

User avatar
PilotC150
 
Posts: 132
Joined: Sun May 04, 2014 9:39 pm

Re: NRF24L01+ with Arduino Micro

Post by PilotC150 »

If anybody's curious, I did get it working. The correct pin configuration was:
GND -> GND
VCC -> 3.3V
CE -> 9
CSN -> 10
SCK -> SCK
MOSI -> MO
MISO -> MI

I'm not 100% sure what the problem was, but after rewiring it a couple times and double, triple, quadruple checking everything, I was finally able to see the details of the chip. Now on to making it actually send and receive data...

User avatar
Franklin97355
 
Posts: 23910
Joined: Mon Apr 21, 2008 2:33 pm

Re: NRF24L01+ with Arduino Micro

Post by Franklin97355 »

Thanks for the info. I'm sure others will be using this nice little combo in their projects. Let us know what you are doing so we can play along.

User avatar
pattoj79
 
Posts: 8
Joined: Tue Aug 26, 2014 2:38 am

Re: NRF24L01+ with Arduino Micro

Post by pattoj79 »

PilotC150 wrote:If anybody's curious, I did get it working. The correct pin configuration was:
GND -> GND
VCC -> 3.3V
CE -> 9
CSN -> 10
SCK -> SCK
MOSI -> MO
MISO -> MI


I'm not 100% sure what the problem was, but after rewiring it a couple times and double, triple, quadruple checking everything, I was finally able to see the details of the chip. Now on to making it actually send and receive data...
Hi PilotC150,
I'm curious..... I cannot for the life of me get mine going. I have nRF24L01+ connected to the Adafruit Flora with the same pin configuration as you but when I paste your code in I get nothing!!
Is something supposed to appear?

I'm trying to talk to my raspberry pi and I can't get either of them to talk... I'm not sure which one is the issue.
I've been at it for days now and everything I read doesn't help.

Can you advise any helpful tips to get this thing going or at least be able to check to see if it's working correctly.

User avatar
PilotC150
 
Posts: 132
Joined: Sun May 04, 2014 9:39 pm

Re: NRF24L01+ with Arduino Micro

Post by PilotC150 »

Sorry, I don't think I can help. I haven't played around with getting the nRF chip working on the Raspberry Pi (that's a possible future project for me) and I have no experience at all with the Flora. A brief look at the product page for the Flora, though, makes me think it won't work, anyway. While it uses the same microcontroller as the Arduino Micro, I don't see pinouts for the SPI pins (SCK, MISO, MOSI), which are necessary for the nRF chip to communicate.

Maybe somebody with more Flora experience can speak to the SPI capabilities of that MCU.

User avatar
pattoj79
 
Posts: 8
Joined: Tue Aug 26, 2014 2:38 am

Re: NRF24L01+ with Arduino Micro

Post by pattoj79 »

Thanks for the response. The pins you mentioned are in a location which isn't exactly clear. They are in the middle of the board in a group of 6 pins adjacent to GND and D6. It should work because the CC3000 module works and it's essentially the same and is an ATmega32u4.

I realise you're not able to help with raspberry pi end but was wondering if you are able to send me a copy of your code for the arduino.
I have another flora and hopefully I can get them both talking.

My email address is [email protected] No problems if you can't.

Thanks

User avatar
pattoj79
 
Posts: 8
Joined: Tue Aug 26, 2014 2:38 am

Re: NRF24L01+ with Arduino Micro

Post by pattoj79 »

It's all good. The Arduino is not he problem. I wired up another one and got them both talking so it is only my raspberry pi that has the issue.
I don't need you code any more.
Thanks

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”