Pages: [1]   Go Down
Author Topic: nRF24L01 Pins to ATMega328  (Read 1399 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 2
Posts: 48
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm trying out various tutorials on the nRF24L01 transceivers but in 99% of them, how to hook up the pins are hardly ever explained.  Being a newbie, I'm a bit lost.  Is it assumed that all the pins on the nRF24L01 are hooked up to the same corresponding pins on the Arduino (e.g. MOSI, MISO, SCK) but what about the CSN, CE and IRQ pins across all libraries for this transceiver? 

I'm currently trying to figure out the "LED-Remote" tutorial by Maniacbug here:
http://arduino-info.wikispaces.com/nRF24L01-RF24-Examples

I'm assuming MOSI goes > MOSI, MISO > MISO, SCK > SCK, but what about the other pins?  In the setup, it specifies RF24 radio(9,10);  are these for CSN and CE?  If so, which pin is which?

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

//
// Hardware configuration
//

// Set up nRF24L01 radio on SPI bus plus pins 9 & 10

RF24 radio(9,10);

// sets the role of this unit in hardware.  Connect to GND to be the 'led' board receiver
// Leave open to be the 'remote' transmitter
const int role_pin = A4;

// Pins on the remote for buttons
const uint8_t button_pins[] = { 2,3,4,5,6,7 };
const uint8_t num_button_pins = sizeof(button_pins);

// Pins on the LED board for LED's
const uint8_t led_pins[] = { 2,3,4,5,6,7 };
const uint8_t num_led_pins = sizeof(led_pins);

Complete code here: http://maniacbug.github.com/RF24/led_remote_8pde-example.html
Logged

JOPIN STUDIOS | Trusted Web Design since 1998 | www.jopin.com

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

I'm trying out various tutorials on the nRF24L01 transceivers but in 99% of them, how to hook up the pins are hardly ever explained.  Being a newbie, I'm a bit lost.  Is it assumed that all the pins on the nRF24L01 are hooked up to the same corresponding pins on the Arduino (e.g. MOSI, MISO, SCK) but what about the CSN, CE and IRQ pins across all libraries for this transceiver? 

Yes generally you are correct. The IRQ pin is not needed based on what I read.

My Transmitter does not have it connected, but I do hvae it connected on my Receiver but it seems to work.

I'm assuming MOSI goes > MOSI, MISO > MISO, SCK > SCK, but what about the other pins?  In the setup, it specifies RF24 radio(9,10);  are these for CSN and CE?  If so, which pin is which?

I have recently been down this road and looking at the documentation really helps.

The docs are listed on the page you gave http://maniacbug.github.com/RF24/classRF24.html

http://maniacbug.github.com/RF24/classRF24.html#a8cd165a822c8f77e10782c6729c5b088

The first pin in the Constructor is the CE PIN followed by CS PIN

9 is CE Pin
10 is CS PIN (I assume also known as CSE)

These two pins seem to be able to be any general pins so 9 and 10 are not a hard coded set of pins.

CE = Chip Enable
CS = Chip Select

Hope this helps - I too am a newbe

chris
Logged

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

Also note that the pins are different on different hardware

See
 
http://arduino.cc/en/Main/arduinoBoardDuemilanove for Arduino Duemilanove

and for Arduino Mega 2560

http://arduino.cc/it/Main/ArduinoBoardMega2560

Chris
Logged

Offline Offline
Newbie
*
Karma: 2
Posts: 48
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

This really helps. Thanks, Chris!
Logged

JOPIN STUDIOS | Trusted Web Design since 1998 | www.jopin.com

Pages: [1]   Go Up
Jump to: