NRF24L01+ communication between arduino micro and arduino uno


I have been trying to get my arduino uno and my arduino micro to talk with each other using my two NRF24L01+'s. I have watched the video at this link (How to work with the NRF24L01+ Best Wireless Communication for Arduino - YouTube) in conjunction with looking at the datasheet to figure out how to use the module, so parts of the code I have is from his example here (

I havent been able to successfully send any data to the arduinos. I have even connected a 10uf capacitor form the 3.3V source to ground for both devices as suggested here ( if you are using jumper wires. I know I connected everything correctly because I can modify the registers in the module, and read out the registers and I can see the changed I made

Below is the code I use for my arduino micro, the code is the same for my uno I just comment out line 52. Any help would be greatly appreciated. And I also I am trying to learn how this device works, so that is why I am not using any libraries

// Define pins
#include <SPI.h>
#define CE_pin 4
#define CSN_pin 5
#define IRQ_pin 2

#define MOSI_pin 11
#define MISO_pin 12
#define SCK_pin 13

//Global variables
byte data_in;
boolean dataHere=false;
boolean dataSending=false;

void setup(){
  Serial.begin(115200);//start Serial
  Serial.println("Setting Up");
  startup();//set up the SPI and define pins 
  setRxPayload(1);  //set payload Register
  writeRegBit(0, 0, 1);// RX Mode
  writeRegBit(0, 1, 1);//PowerUP
  writeRegBit(0, 4, 1);//turns off the RT interrupt
  writeRegBit(0, 5, 1);//turns off the TX interrupt
  //flush RX
  //flush TX
  //clears any interrupts
  attachInterrupt(0, get_data, FALLING);//kick things off by attachin the IRQ interrupt

void loop(){


//flush data in RX
void flushRx() {
  digitalWrite(CSN_pin, LOW);
  SPI.transfer(B11100010);//flush RX
  digitalWrite(CSN_pin, HIGH);

//flush data in TX
void flushTx() {
  digitalWrite(CSN_pin, LOW);
  SPI.transfer(B11100001);//flush TX
  digitalWrite(CSN_pin, HIGH);

//this rountine trasnmits data
void transmit(byte value){
  //flush TX
  digitalWrite(CSN_pin, LOW);
  SPI.transfer(B10100000);//load TX payload
  digitalWrite(CSN_pin, HIGH);
  digitalWrite(CE_pin, LOW);//pull CE pin LOW for TX mode
  delay(1);//small delay
  writeRegBit(0, 0, 0);//go into TX mode
  delay(1);//small delay
  digitalWrite(CE_pin, HIGH);
  delay(1);//this is the time CE pin must be HIGH for before going back into RX mode
  //delay(1) seems to work best for this.  any longer or shorter doesn't work as well*/
  writeRegBit(0, 0, 1);//go into RX mode


void get_data(){
  digitalWrite(CSN_pin, LOW);
  SPI.transfer(B01100001);//read the payload
  data_in = SPI.transfer(B00000000);
  digitalWrite(CSN_pin, HIGH);
  //flush RX
  //clearRX interrupt

//init the device
void startup(){
  pinMode(CE_pin, OUTPUT);//chip enable set as output
  pinMode(CSN_pin, OUTPUT);//chip select pin as output
  pinMode(MOSI_pin, OUTPUT);//SPI data out
  pinMode(MISO_pin, INPUT); //SPI data in
  pinMode(SCK_pin, OUTPUT);//SPI clock out
  SPI.setBitOrder(MSBFIRST);//SPI Most Significant Bit First
  SPI.setDataMode(SPI_MODE0);// Mode 0 Rising edge of data, keep clock low
  SPI.setClockDivider(SPI_CLOCK_DIV2);//Run the data in at 16MHz/2 - 8MHz
  digitalWrite(CSN_pin, HIGH);//SPI idle
  SPI.begin();//start up the SPI library
  Serial.println("Startup Done");

//This rountine sets how many bytes we will be transfering
void setRxPayload(byte numBytes){
  digitalWrite(CSN_pin, LOW);                   //pull low to talk to it
  SPI.transfer(B00110001);                            //write command to write to register RX_PW_P0 
  SPI.transfer(numBytes);                      //num bytes you want
  digitalWrite(CSN_pin, HIGH);                 //done talking
  Serial.println("Done setting RX Payload");

//This routine clears the interrup flags
void clearInterrupts(){  
  getReg(7);//RT interrupt
  if(bitRead(data_in, 4)) {
    Serial.println("Cleared RT interrupt");
  getReg(7);//TX interrupt
  if(bitRead(data_in, 5)) {
    Serial.println("Cleared TX interrupt");
  getReg(7);//RX interrupt
  if(bitRead(data_in, 6)) {
    Serial.println("Cleared RX interrupt");

//This routine writes the contents of a register to data_in
void getReg(byte address){
  digitalWrite(CSN_pin, LOW);
  digitalWrite(CSN_pin, HIGH);
 //This routine writes a 1 or 0 to a specificed bit to a specified register
 void writeRegBit(byte address, byte theBit, byte val){ 
  if(val==1)//if we want to write a one to the bit then set the bit in the register we read
    bitSet(data_in, theBit);
    bitClear(data_in, theBit);//clear it if not
  digitalWrite(CSN_pin, LOW);//now we'll write the modified data back in
  SPI.transfer(32+address);//a write to a register adds 32
  SPI.transfer(data_in);//write the modified register
  digitalWrite(CSN_pin, HIGH);

try this library:

it is an aggravating, exceptionally aggravating, process. However, this library got me to about 65% successful completions of the "getting start" sketch (send, send back, record). Setting one of them up on a proto board got me to about 90%. I am using an UNO and a Mega.