nRF24L01+ not communicating

Hi All,

I have two Transceiver nRF24L01+ Module with Chip Antenna WRL-00691 each connected to a MSP430FG439. I am trying to send an 8bit character 10100110 from one two the other. However the receiver unit is not getting any data and the status register is always zero. Any help would be appreciated

Thanks in advance

Transmitter Code

#include  <msp430xG43x.h>

void initialise(void);
void nRF_setup(void);
void rx_complete(void);
void tx_complete(void);
void setup_SPI(void);

void delay_us (unsigned long time);       //Produces delay of length time in us

void w_register(int address, int data);
int r_register(int address, int length);
void flush_TX(void);
void w_TX_payload(int data);

int status=0;
int receive[20];

#define CSN 0x20;
#define CE 0x08;

//temp variables
  int i=0;
  int a=253;
  int trash=0;
  int temp=0;
//Define Ports
/*
P3.1 SIMO0
P3.2 SOMI0
P3.3 UCLK
*/

int main(void)
{
    int data=0;
    WDTCTL = WDTPW + WDTHOLD;           //stop watchdog timer
  
    initialise();                       //initialise input output ports
    setup_SPI();                        //setup SPI
    nRF_setup();                        //setup nRF24L01+
         
    flush_TX();                         //clear nRF TX buffer
    
    while(1)
    {
      status = r_register(0x07, 1);     //read status register
      if (status & (0x10 | 0x08))       //status & (TX_DS | MAX_RT)
      {
        flush_TX();                     
      }
      
      w_TX_payload(0xA6);               //transmit A6
      delay_us(150);                    //delay
    }
}//end main
    

void nRF_setup(void)
{
  w_register(0x01, 0x00);   //EN_AA Disable auto ack
  w_register(0x11, 1);      //Port 0 1 bytes
  w_register(0x00, 0x7A);   //Config Interrupt not reflected, enable CRC, Power up, PTX
  
  P5OUT &= ~CE;             //Transmitter mode
}

//********************
//  Checks for SPI transfer completion
//********************
void tx_complete(void)
{
   while (!(IFG1 & UTXIFG0));              // USART0 TX buffer ready?
}

//********************
//  Checks for SPI receive completion
//********************
void rx_complete(void)

{
  while (!(IFG1 & URXIFG0));              // USART0 RX buffer ready?
} 

//*************************
//Initialise MSP I/O ports
//************************
void initialise(void)
{
  P3SEL = 0x0E; //Set port 3.1 MOSI 3.2 MISO 3.3 UCLK   
  P5OUT = 0xFF; //Port 5 Outputs
  P5OUT = 0x00; //Set as 0
  P5OUT |= 0x20; //Set CSN P5.5 high
}

//*************************
//Setup SPI to interface with ext ADC and display driver
//*************************
void setup_SPI(void)
{
 
  UCTL0 |= SWRST;                           // Set SWRST
  UCTL0 |= CHAR + SYNC + MM;                // 8-bit SPI Master **SWRST**
  UTCTL0 |= CKPH + SSEL1  + STC;            // SMCLK, 3-pin mode
  UBR00 = 0x04;                             // Baud rate set by U0BR10 + U0BR10
  UBR10 = 0x00;                             // 0
  UMCTL0 = 0x00;                            // no modulation
  ME1 |= USPIE0;                            // Enable USART0 SPI mode
  UCTL0 &= ~SWRST;                          // Initalize USART state machine
}

//*****************************
//Reads nRF register
//Returns status register
//****************************
int r_register(address, length)
{
  int a=0;              //Temp variable to hold status
  P5OUT &= ~CSN;
  U0TXBUF = address;    //Send address of register to read
  //tx_complete();
  
  a =  U0RXBUF;         //Read status register
  P5OUT |= CSN;
  
  return a;
}

//***************************
//Writes data to nRF register 
//***************************
void w_register(address, data)
{
   address = address + 0x20; //Set bit 5 high to set write instruction
  P5OUT &= ~CSN;
  U0TXBUF = address;        //Address to be sent
  temp =  U0RXBUF;          //status register
  tx_complete();            //Wait until sent
  U0TXBUF = data;           //Data to be sent
  tx_complete();            //Wait until sent
  P5OUT |= CSN;
}

//*******************
//Writes byte to be send 
//*******************
void w_TX_payload(data)
{
  P5OUT &= ~CSN;
  U0TXBUF = 0xA0;    //Write TX command
  temp =  U0RXBUF;   //status register
  tx_complete();     //Wait until sent
  U0TXBUF = data;   //Data to be sent
  tx_complete();     //Wait until sent
  P5OUT |= CSN;
}

// *****************************************
//Produces delay in us
// ****************************************
void delay_us (unsigned long time)
{

TBCCR0 = (unsigned int)(32768 * time / 1000000);   //Set up Timer B interval
TBCCR1 = TBCCR0 - 1; //Set TBCL1 to 1 less than TBCL0
TBCCTL1 = OUTMOD_3; //OUT1 is set when the timer reaches TBCL1 and reset when it reaches TBCL0
TBCTL |= TBCLR;
TBCTL &= ~TBIFG;
TBCTL = TBSSEL_1 | MC_1;    // ALCK up mode

while ((TBCTL & TBIFG) == 0) {} // Wait till time elapses

TBCTL = MC_0;   //Stop Timer B
}

//************************
//Flushes nRF Transmit buffer
//*********
void flush_TX()
{
  P5OUT &= ~CSN;
  U0TXBUF = 0xE1;   //Flush TX
  P5OUT |= CSN;
}

Receiver Code

#include  <msp430xG43x.h>

void initialise(void);
void nRF_setup(void);
void rx_complete(void);
void tx_complete(void);
void setup_SPI(void);

void delay_us (unsigned long time);       //Produces delay of length time in us

void w_register(int address, int data);
int r_register(int address, int length);
void flush_TX(void);
void flush_RX(void);
void w_TX_payload(int data);
int r_RX_payload(void);

int status=0;
int receive=0;

#define CSN 0x20;
#define CE 0x08;

//temp variables
  int i=0;
  int a=253;
  int trash=0;
  int temp=0;
//Define Ports
/*
P3.1 SIMO0
P3.2 SOMI0
P3.3 UCLK
*/

int main(void)
{
    int data=0;
    WDTCTL = WDTPW + WDTHOLD;           //stop watchdog timer
    initialise();                       //initialise input output ports
    setup_SPI();                        //setup SPI
    nRF_setup();                        //setup nRF24L01+

    flush_RX();                         //removes stray data from Receiver
    
    while(1)
    {
      status = r_register(0x07, 1);     //read status register
      if (status & 0x40 ) //status & RX_DR)
      {
        P5OUT &= ~CE;                     //Set CE Low
        receive = r_RX_payload();         //received data
        flush_RX();                       //clear receiver
        P5OUT |= CE;                      //Set CE High
      }
    }
       
}//end main

//********************************
//Commands to set up nRF24L01+
//********************************
void nRF_setup(void)
{
  w_register(0x01, 0x00);   //EN_AA Disable auto ack
  w_register(0x11, 1);      //Port 0 1 bytes
  w_register(0x00, 0x7B);   //Config Interrupt not reflected, enable CRC, Power up, PTX
  P5OUT |= CE;             //Receiver mode
}


//********************
//  Checks for SPI transfer completion
//********************
void tx_complete(void)
{
   while (!(IFG1 & UTXIFG0));              // USART0 TX buffer ready?
}

//********************
//  Checks for SPI receive completion
//********************
void rx_complete(void)
{
  while (!(IFG1 & URXIFG0));              // USART0 RX buffer ready?
} 

//*************************
//Initialise MSP I/O ports
//************************
void initialise(void)
{
  P3SEL = 0x0E; //Set port 3.1 MOSI 3.2 MISO 3.3 UCLK   
  P5OUT = 0xFF; //Port 5 Outputs
  P5OUT = 0x00; //Set as 0
  P5OUT |= 0x20; //Set CSN P5.5 high
}

//*************************
//Setup SPI to interface with ext ADC and display driver
//*************************

void setup_SPI(void)
{
 
  UCTL0 |= SWRST;                           // Set SWRST
  UCTL0 |= CHAR + SYNC + MM;                // 8-bit SPI Master **SWRST**
  UTCTL0 |= CKPH + SSEL1  + STC;            // SMCLK, 3-pin mode
  UBR00 = 0x04;                             // UCLK/8 = 1.048MHz/8 = 131kHz
  UBR10 = 0x00;                             // 0
  UMCTL0 = 0x00;                            // no modulation
  ME1 |= USPIE0;                            // Enable USART0 SPI mode
  UCTL0 &= ~SWRST;                          // Initalize USART state machine
}

//*****************************
//Reads nRF register
//Returns status register
//****************************
int r_register(address, length)
{
  int a=0;  //Temp variable to hold status
  P5OUT &= ~CSN;
  U0TXBUF = address; //Config
  
  
  a =  U0RXBUF;   
  P5OUT |= CSN;
  
  return a;
}

//***************************
//Writes data to nRF register 
//***************************
void w_register(address, data)
{
   address = address + 0x20; //Set bit 5 high to set write instruction
  P5OUT &= ~CSN;
  U0TXBUF = address; //Address to be sent
  temp =  U0RXBUF;   //status register
  tx_complete();     //Wait until sent
  U0TXBUF = data;   //Data to be sent
  tx_complete();     //Wait until sent
  P5OUT |= CSN;
}

//*******************
//Writes byte to be send 
//*******************
void w_TX_payload(data)
{
  P5OUT &= ~CSN;
  U0TXBUF = 0xA0;    //Write TX command
  temp =  U0RXBUF;   //status register
  tx_complete();     //Wait until sent
  U0TXBUF = data;   //Data to be sent
  tx_complete();     //Wait until sent
  P5OUT |= CSN;
}

//*******************
//Reads bytes sent 
//*******************
int r_RX_payload()
{
  int RX_data=0;      //Received data
  P5OUT &= ~CSN;
  U0TXBUF = 0xA0;    //Write TX command
  temp =  U0RXBUF;   //status register
  tx_complete();     //Wait until sent
  U0TXBUF = 0xFF;    //send nop to get received data
  temp =  U0RXBUF;   //RX data
  tx_complete();     //Wait until sent
  P5OUT |= CSN;
  return RX_data;
}

// *****************************************
//Produces delay in us
// ****************************************
void delay_us (unsigned long time)
{

TBCCR0 = (unsigned int)(32768 * time / 1000000);   //Set up Timer B interval

TBCCR1 = TBCCR0 - 1; //Set TBCL1 to 1 less than TBCL0
TBCCTL1 = OUTMOD_3; //OUT1 is set when the timer reaches TBCL1 and reset when it reaches TBCL0
TBCTL |= TBCLR;
TBCTL &= ~TBIFG;
TBCTL = TBSSEL_1 | MC_1;    // ALCK up mode

while ((TBCTL & TBIFG) == 0) {} // Wait till time elapses

TBCTL = MC_0;   //Stop Timer B
}
  
void flush_TX()
{
  P5OUT &= ~CSN;
  U0TXBUF = 0xE1;   //Flush TX
  P5OUT |= CSN;
}

void flush_RX()
{
  P5OUT &= ~CSN;
  U0TXBUF = 0xE2;   //Flush RX
  P5OUT |= CSN;
}

Does anyone have any ideas? Am I not initialising the nRF24L01+ properly?

Any help will be appreciated

Here is some test code I wrote for a PIC:

/*
** Tx.c
** Transmit test program for PIC18F4520 and nRF24L01 or nRF24L01+
** Uses the Microchip C18 compiler
** Based on SFE code for the CC5X compiler in 24L01demo_V01.c
*/

#include <p18cxxx.h>
#include <spi.h>
#include <timers.h>

// Pragmas
#pragma config OSC = INTIO67
#pragma config PWRT = ON
//#pragma config MCLRE = OFF
#pragma config BOREN = OFF


//function prototypes
void init(void);
void transmit_data(void);
void configure_transmitter(void);
unsigned char spi_Send_Read(unsigned char);
unsigned char spi1_send_read_byte(unsigned char byte);
void dly(unsigned int);


// Defines
#define SPI_SCK		LATCbits.LATC3		// Clock pin, PORTC pin 3 
#define SPI_SO		LATCbits.LATC5		// Serial output pin, PORTC pin 5 
#define SPI_SI		PORTCbits.RC4		// Serial input pin, PORTC pin 4 
#define SPI_CSN		LATCbits.LATC2		// CSN output pin, PORTC pin 2
#define SPI_CE		LATCbits.LATC1		// CE output pin, PORTC pin 1
#define SPI_IRQ		PORTBbits.RB0		// IRQ input pin, PORTB pin 0
#define SPI_SCALE	4              		// postscaling of signal 
#define LED			LATAbits.LATA0
#define PB			PORTAbits.RA1

// Macros
#define nop() _asm nop _endasm

void main(void)
{
	init();
	configure_transmitter();  
	while (1)  
	{
		transmit_data();
		LED = 1;
		dly(63973);	
		LED = 0;           
		dly(40000);		
		nop();          
	}
}


void init(void)
{
	// run internal oscillator at 8 MHz
	OSCCON = OSCCON | 0x70;
	while (!OSCCONbits.IOFS)	// osc. is stable when IOFS = 1
		;
	PORTA = 0x00;
	ADCON1 = 0x0F;		// set up PORTA to be digital I/Os
	TRISA = 0x02;		// PORTA<7.2,0> outputs PORTA<1> input
	TRISCbits.TRISC3 = 0;	// SDO output
	TRISCbits.TRISC5 = 0;   // SCK output
	TRISCbits.TRISC2 = 0;	// CSN output
	TRISCbits.TRISC1 = 0;	// CE output
	TRISBbits.TRISB0 = 1;	// IRQ input
	OpenSPI(SPI_FOSC_16, MODE_00, SMPMID); //open SPI1
	OpenTimer0( TIMER_INT_OFF &
            	T0_16BIT &
            	T0_SOURCE_INT &
            	T0_PS_1_256 );
}

void configure_transmitter(void)
{
	int  i, j;
    unsigned char data, cmd;

    SPI_CE = 0;
    SPI_CSN = 0;

	// PTX, CRC enabled, mask a couple of ints    
 	spi_Send_Read(0x20);
  	spi_Send_Read(0x38);
	SPI_CSN = 1; 
    SPI_CSN = 0;
    
	//auto retransmit off
 	spi_Send_Read(0x24);    
   	spi_Send_Read(0x00);    
    SPI_CSN = 1;
    SPI_CSN = 0;
    
	//address width = 5
   	spi_Send_Read(0x23);
 	spi_Send_Read(0x03);    
    SPI_CSN = 1;
    SPI_CSN = 0;
    
	//data rate = 1MB
   	spi_Send_Read(0x26);
 	spi_Send_Read(0x07);
    SPI_CSN = 1; 
    SPI_CSN = 0;
    
	//set channel 2, this is default but we did it anyway...
   	spi_Send_Read(0x25);
 	spi_Send_Read(0x02);
    SPI_CSN = 1;
    SPI_CSN = 0;
    
	//set address E7E7E7E7E7, also default...
   	spi_Send_Read(0x30);    
    for (j = 0; j < 5; j++)
    {
        spi_Send_Read(0xE7);
    }  
    SPI_CSN = 1;
    SPI_CSN = 0;
    
    //disable auto-ack, RX mode
    //shouldn't have to do this, but it won't TX if you don't
   	spi_Send_Read(0x21);
 	spi_Send_Read(0x00);
    SPI_CSN = 1;
}

void transmit_data(void)
{
    unsigned char i, data, cmd;   
    
    SPI_CSN = 0;
    
	//clear previous ints
  	spi_Send_Read(0x27);
 	spi_Send_Read(0x7E);
	SPI_CSN = 1;
    SPI_CSN = 0;
    
	//PWR_UP = 1
   	spi_Send_Read(0x20);
 	spi_Send_Read(0x3A);
    SPI_CSN = 1;
    SPI_CSN = 0;
    
    //clear TX fifo
    //the data sheet says that this is supposed to come up 0 after POR, but that doesn't seem to be the case
   	spi_Send_Read(0xE1);
    SPI_CSN = 1;
    SPI_CSN = 0;
    
	//4 byte payload
   	spi_Send_Read(0xA0);
   	spi_Send_Read(0x34);
  	spi_Send_Read(0x33);
   	spi_Send_Read(0x32);
  	spi_Send_Read(0x31);
    SPI_CSN = 1;
    
    //Pulse CE to start transmission
    SPI_CE = 1;
    dly(65000);			//delay 69 ms
    SPI_CE = 0;
}


unsigned char spi_Send_Read(unsigned char byte)
{
	SSPBUF = byte;	
	while(!DataRdySPI())
		;	
	return SSPBUF;
}	

void dly(unsigned int c)
{
	INTCONbits.TMR0IF = 0;
	WriteTimer0(c);
	while (!INTCONbits.TMR0IF)
		;
}
/*
** Rx.c
** Receive test program for PIC18F4520 and nRF24L01 or nRF24L01+
** Uses the Microchip C18 compiler
** Based on SFE code for the CC5X compiler in 24L01demo_V01.c
**
** The LED is flashed five times when data are received.
** The received data in the buffer may be checked using the 
** debugger Watch window.*/

#include <p18cxxx.h>
#include <spi.h>
#include <timers.h>

// Pragmas
#pragma config OSC = INTIO67
#pragma config PWRT = ON
#pragma config MCLRE = OFF
#pragma config BOREN = OFF

//function prototypes
void init(void);
void reset_RX(void);
void configure_RX(void);
unsigned char spi_Send_Read(unsigned char);
void dly(unsigned int);

// Defines
#define SPI_SCK		LATCbits.LATC3		// Clock pin, PORTC pin 3 
#define SPI_SO		LATCbits.LATC5		// Serial output pin, PORTC pin 5 
#define SPI_SI		PORTCbits.RC4		// Serial input pin, PORTC pin 4 
#define SPI_CSN		LATCbits.LATC2		// CSN output pin, PORTC pin 2
#define SPI_CE		LATCbits.LATC1		// CE output pin, PORTC pin 1
#define SPI_IRQ		PORTBbits.RB0		// IRQ input pin, PORTB pin 0
#define SPI_SCALE	4              		// postscaling of signal 
#define LED			LATAbits.LATA0
#define PB			PORTAbits.RA1

// Macros
#define nop() _asm nop _endasm

void main(void)
{
	unsigned char i;

	init();
	configure_RX();
	while(1)
	{
   		if (SPI_IRQ == 0)    //wait for anything
        {
            for (i = 0; i < 5; i++)  //flash LED 5 times if data received
            {
                LED = 1;
                dly(63973);		// 200 ms delay
                LED = 0;
                dly(63973);		// 196 ms
            }
            dly(63973);			// 196 ms
            reset_RX();            
        }
	}
}

// initialise 18F4520
void init(void)
{
	// run internal oscillator at 8 MHz
	OSCCON = OSCCON | 0x70;
	while (OSCCONbits.IOFS == 0)
		;

	PORTA = 0x00;
	ADCON1 = 0x0F;		// set up PORTA to be digital I/Os
	TRISA = 0x02;		// PORTA<7.2,0> outputs PORTA<1> input
	TRISCbits.TRISC3 = 0;	// SDO output
	TRISCbits.TRISC5 = 0;   // SCK output
	TRISCbits.TRISC2 = 0;	// CSN output
	TRISCbits.TRISC1 = 0;	// CE output
	TRISBbits.TRISB0 = 1;	// IRQ input
	OpenSPI(SPI_FOSC_16, MODE_00, SMPMID); //open SPI1
	OpenTimer0( TIMER_INT_OFF &
            	T0_16BIT &
            	T0_SOURCE_INT &
            	T0_PS_1_256 );
}

//configure nRF24L01 for receive
void configure_RX(void)
{
    unsigned char i, j;

    SPI_CSN = 0;
    SPI_CE = 0;
    
	//PRX, CRC enabled
	spi_Send_Read(0x20);
	spi_Send_Read(0x39); 
	SPI_CSN = 1;   
	SPI_CSN = 0;
    
	//disable auto-ack for all channels      
	spi_Send_Read(0x21);
	spi_Send_Read(0x00);     
	SPI_CSN = 1;    
	SPI_CSN = 0;
    
	//address width = 5 bytes  
  	spi_Send_Read(0x23);
	spi_Send_Read(0x03);    
    SPI_CSN = 1;    
    SPI_CSN = 0;
    
	//data rate = 1MB   
  	spi_Send_Read(0x26);
	spi_Send_Read(0x07);    
    SPI_CSN = 1;
  	SPI_CSN = 0;

	//4 byte payload  
 	spi_Send_Read(0x31);
	spi_Send_Read(0x04);    
    SPI_CSN = 1;    
    SPI_CSN = 0;

    //set channel 2 
   	spi_Send_Read(0x25);
	spi_Send_Read(0x02);    
    SPI_CSN = 1;     
    SPI_CSN = 0;

    //set address E7E7E7E7E7
    spi_Send_Read(0x30);
    for (j = 0; j < 5; j++)
 		spi_Send_Read(0xE7); 
    SPI_CSN = 1;  
    SPI_CSN = 0;
    
	//PWR_UP = 1   
 	spi_Send_Read(0x20);
	spi_Send_Read(0x3B);   
    SPI_CSN = 1;    
    SPI_CE = 1;     
}

void reset_RX(void)
{
    unsigned char i, j;
    unsigned char buffer[4];    
    
	//Read RX payload   
    SPI_CSN = 0;    
   	spi_Send_Read(0x61);    
    for (j = 0; j < 4; j++)
    {        
       	buffer[j] = spi_Send_Read(0);        
    }    
    SPI_CSN = 1;    
    
	//Flush RX FIFO    
    SPI_CSN = 0;    
 	spi_Send_Read(0xE2);    
    SPI_CSN = 1;
    SPI_CSN = 0;
 
	//reset int    
  	spi_Send_Read(0x27);
	spi_Send_Read(0x40);    
    SPI_CSN = 1;
}




unsigned char spi_Send_Read(unsigned char byte)
{
	SSPBUF = byte;	
	while(!DataRdySPI())
		;	
	return SSPBUF;
}	


void dly(unsigned int c)
{
	INTCONbits.TMR0IF = 0;
	WriteTimer0(c);
	while (INTCONbits.TMR0IF == 0)
		;


}

Thanks for your help Leon,

I have followed your code, manipulating it for the MSP430, it has helped a lot.

I still don’t have the two devices communicating, the receiver device constantly has on the status register 0x0E stating that the RX FIFO is empty, however the IRQ Pin is constantly high.

Any ideas will be appreciated

The IRQ pin is active-low, so it will be high so long as you haven’t gotten an interrupt. Are you getting the TX_DS interrupt on your TX unit? If not, you won’t be getting an interrupt at the receiver, either. Make sure that you are operating the CE pin properly at both the TX and the RX unit. It must be logic high at the TX to send data that you write to the TX FIFO, and it must also be logic high at the RX to be able to receive packets.

I’m trying to make two AVRs talk to each other, so the Nordic FOB (WRL-08602) code samples were very useful for me.

As there is no way to know if a problem is with the TX or the RX side (unless you have got an RF sniffer) I suggest to start with something that’s working and then test that things still work after every small change!

Hi All,

I’ve been playing around with two nrf24L01+ transceivers for a while now with no success. I have confirmed that data is transferring between the micro controllers and the nrf24L01+ and that the CE and CSN pins are high/low when appropriate.

I have been following the code examples on the website as well as the code that Leon Heller posted with no success.

If anyone could look over my code and point anything out it would be appreciated

Transmitter Code

#include  <msp430xG43x.h>

void initialise(void);
void nRF_setup(void);
void rx_complete(void);
void tx_complete(void);
void setup_SPI(void);

void delay_ms (unsigned long time);       //Produces delay of length time in ms
void delay_us (unsigned long time);       //Produces delay of length time in us

void w_register(int address, int data);
int r_register(int address, int length);
void flush_TX(void);
void w_TX_payload(int byte1, int byte2, int byte3, int byte4);

void Transmit_data(void);

int status=0;
int receive[20];

#define CSN 0x20;
#define CE 0x10;

//temp variables
  int i=0;
  int a=253;
  int trash=0;
  int temp=0;
  int data=0;
//Define Ports
/*
P3.1 SIMO0
P3.2 SOMI0
P3.3 UCLK
*/

int main(void)
{
    
    WDTCTL = WDTPW + WDTHOLD;           //stop watchdog timer
  
    initialise();                       //initialise input output ports
    setup_SPI();                        //setup SPI
    nRF_setup();                        //setup nRF24L01+
         
    flush_TX();                         //clear nRF TX buffer
      
    while(1)
    {
      w_register(0x00, 0x3A);
      P5OUT |= 0x02;    //LED on
      Transmit_data();
     
      delay_ms(1000);
      P5OUT &= ~0x02;   //LED off
      delay_ms(1000);
    }
        
}//end main

void Transmit_data(void)
{
  w_register(0x07, 0x7E);   //Resets Status
  w_register(0x00, 0x7A);   //Power Up
  r_register(0x00, 1);      //Read CONFIG
  r_register(0x17, 1);
  flush_TX();
  w_TX_payload(0x34, 0x33, 0x32, 0x31);
 
  P5OUT |= CE;
  delay_ms(70);
  P5OUT &= ~CE;
  
}

//*******************
//  Instructions to setup nRF24L01 as a transmitter
//*******************
void nRF_setup(void)
{
  
  w_register(0x00, 0x78);   //Config
  w_register(0x04, 0x00);   //Setup_Retr  - Disabled
  w_register(0x03, 0x03);   //Setup_AW    - 5 bytes
  w_register(0x06, 0x07);   //RF Setup    - 1 Mbit 0dBm
  w_register(0x05, 0x02);   //RF_CH       - 2 
  
  //Address
  P5OUT &= ~CSN;
  U0TXBUF = 0x30;           //Tx_Addr
  temp =  U0RXBUF;          //status register
  tx_complete();            //Wait until sent
  //Address byte 1
  U0TXBUF = 0xE7;           //Data to be sent
  temp =  U0RXBUF;          //status register
  tx_complete();            //Wait until sent
  //Address byte 2
  U0TXBUF = 0XE7;           //Data to be sent
  temp =  U0RXBUF;          //status register
  tx_complete();            //Wait until sent
  //Address byte 3
  U0TXBUF = 0XE7;           //Data to be sent
  temp =  U0RXBUF;          //status register
  tx_complete();            //Wait until sent
  //Address byte 4
  U0TXBUF = 0XE7;           //Data to be sent
  temp =  U0RXBUF;          //status register
  tx_complete();            //Wait until sent
  //Address byte 5
  U0TXBUF = 0XE7;           //Data to be sent
  temp =  U0RXBUF;          //status register
  tx_complete();            //Wait until sent
  P5OUT |= CSN;
  //End Address 
  
  w_register(0x11, 0x04);
  w_register(0x01, 0x00);   //EN_AA   - Disabled
  w_register(0x00, 0x7A);   //Config  - Powerup
   
  P5OUT &= ~CE;             //Transmitter mode
}

//********************
//  Checks for SPI transfer completion
//********************
void tx_complete(void)
{
   while (!(IFG1 & UTXIFG0));              // USART0 TX buffer ready?
}

//********************
//  Checks for SPI receive completion
//********************
void rx_complete(void)
{
  while (!(IFG1 & URXIFG0));              // USART0 RX buffer ready?
} 

//*************************
//Initialise MSP I/O ports
//************************
void initialise(void)
{
  P3SEL = 0x0E; //Set port 3.1 MOSI 3.2 MISO 3.3 UCLK   
  P5DIR = 0xFF; //Port 5 Outputs
  P5OUT = 0x00; //Set as 0
  P5OUT |= 0x20; //Set CSN P5.5 high
}

//*************************
//Setup SPI to interface with ext ADC and display driver
//*************************
void setup_SPI(void)
{
  UCTL0 |= SWRST;                           // Set SWRST
  UCTL0 |= CHAR + SYNC + MM;                // 8-bit SPI Master **SWRST**
  UTCTL0 |= CKPH + SSEL1  + STC;            // SMCLK, 3-pin mode
  UBR00 = 0x02;      //4                       // Baud rate set by U0BR10 + U0BR10
  UBR10 = 0x00;                             // 0
  UMCTL0 = 0x00;                            // no modulation
  ME1 |= USPIE0;                            // Enable USART0 SPI mode
  UCTL0 &= ~SWRST;                          // Initalize USART state machine
}

//*****************************
//Reads nRF register
//Returns status register
//****************************
int r_register(address, length)
{
  int a=0;              //Temp variable to hold status
  P5OUT &= ~CSN;
  U0TXBUF = address;    //Send address of register to read
  tx_complete();
  status = U0RXBUF;
  
  U0TXBUF = 0xFF;       //NOP to read data
  tx_complete();
  a =  U0RXBUF;         //Read status register
  temp = U0RXBUF;
  P5OUT |= CSN;
  
  return a;
}

//***************************
//Writes data to nRF register 
//***************************
void w_register(address, data)
{
   address = address + 0x20; //Set bit 5 high to set write instruction
  P5OUT &= ~CSN;
  U0TXBUF = address;        //Address to be sent
  temp =  U0RXBUF;          //status register
  tx_complete();            //Wait until sent
  U0TXBUF = data;           //Data to be sent
  tx_complete();            //Wait until sent
  P5OUT |= CSN;
}

//*******************
//Writes byte to be send 
//*******************
void w_TX_payload(byte1, byte2, byte3, byte4)
{
  P5OUT &= ~CSN;     //CSN 0
  U0TXBUF = 0xA0;    //Write TX command
  temp =  U0RXBUF;   //status register
  tx_complete();     //Wait until sent
  U0TXBUF = byte1;   //Data to be sent
  tx_complete();     //Wait until sent
  U0TXBUF = byte2;   //Data to be sent
  tx_complete();     //Wait until sent
  U0TXBUF = byte3;   //Data to be sent
  tx_complete();     //Wait until sent
  U0TXBUF = byte4;   //Data to be sent
  tx_complete();     //Wait until sent
  P5OUT |= CSN;      //CSN 1
}

//*******************************************
//Produces delay in ms
//******************************************

void delay_ms (unsigned long time)
{

TBCCR0 = (unsigned int)(32768 * time / 1000);     //Set up the Timer B interval

TBCCR1 = TBCCR0 - 1; //Set TBCL1 to 1 less than TBCL0
TBCCTL1 = OUTMOD_3; //OUT1 is set when the timer reaches TBCL1 and reset when it reaches TBCL0
TBCTL |= TBCLR;     //CLear TBR
TBCTL &= ~TBIFG;    //Clear IFG
TBCTL = TBSSEL_1 | MC_1;  // ALCK up mode

while ((TBCTL & TBIFG) == 0) {} // Wait till time elapses

TBCTL = MC_0;   //Stop Timer B
}

// *****************************************
//Produces delay in us
// ****************************************
void delay_us (unsigned long time)
{

TBCCR0 = (unsigned int)(32768 * time / 1000000);   //Set up Timer B interval
TBCCR1 = TBCCR0 - 1; //Set TBCL1 to 1 less than TBCL0
TBCCTL1 = OUTMOD_3; //OUT1 is set when the timer reaches TBCL1 and reset when it reaches TBCL0
TBCTL |= TBCLR;
TBCTL &= ~TBIFG;
TBCTL = TBSSEL_1 | MC_1;    // ALCK up mode

while ((TBCTL & TBIFG) == 0) {} // Wait till time elapses

TBCTL = MC_0;   //Stop Timer B
}

//************************
//Flushes nRF Transmit buffer
//*********
void flush_TX()
{
  P5OUT &= ~CSN;
  U0TXBUF = 0xE1;   //Flush TX
  tx_complete();     //Wait until sent
  P5OUT |= CSN;
}

Receiver Code

#include  <msp430xG43x.h>

void initialise(void);
void nRF_setup(void);
void rx_complete(void);
void tx_complete(void);
void setup_SPI(void);

void delay_ms (unsigned long time);       //Produces delay of length time in ms
void delay_us (unsigned long time);       //Produces delay of length time in us

void w_register(int address, int data);
int r_register(int address, int length);
void flush_TX(void);
void flush_RX(void);
void w_TX_payload(int data);
int r_RX_payload(void);

void reset_RX(void);

int status=0;
int receive=0;

#define CSN 0x20;
#define CE 0x10;

//temp variables
  int i=0;
  int a=253;
  int trash=0;
  int temp=0;
  int rx_data=0;
//Define Ports
/*
P3.1 SIMO0
P3.2 SOMI0
P3.3 UCLK
*/

int main(void)
{
    
    WDTCTL = WDTPW + WDTHOLD;           //stop watchdog timer
    initialise();                       //initialise input output ports
    setup_SPI();                        //setup SPI
    nRF_setup();                        //setup nRF24L01+

    flush_RX();                         //removes stray data from Receiver
      
    while(1)
    {
    
      flush_RX();
      w_register(0x07, 0x50);
 
      r_register(0x17, 1);
      reset_RX();
     }
            
}//end main

//********************************
//Commands to set up nRF24L01+
//********************************
void nRF_setup(void)
{
  P5OUT &= ~CE;
  w_register(0x00, 0x39);   //CONFIG  - Receiver
  w_register(0x01, 0x00);
  w_register(0x03, 0x03);
  w_register(0x06, 0x07);
  w_register(0x11, 0x04);
  w_register(0x05, 0x02);
  //Address
  
  P5OUT &= ~CSN;
  U0TXBUF = 0x2A;           //Rx_Addr_P0
  temp =  U0RXBUF;          //status register
  tx_complete();            //Wait until sent
  U0TXBUF = 0xE7;           //Data to be sent
  temp =  U0RXBUF;          //status register
  tx_complete();            //Wait until sent
  U0TXBUF = 0XE7;           //Data to be sent
  temp =  U0RXBUF;          //status register
  tx_complete();            //Wait until sent
  U0TXBUF = 0XE7;           //Data to be sent
  temp =  U0RXBUF;          //status register
  tx_complete();            //Wait until sent
  U0TXBUF = 0XE7;           //Data to be sent
  temp =  U0RXBUF;          //status register
  tx_complete();            //Wait until sent
  U0TXBUF = 0XE7;           //Data to be sent
  temp =  U0RXBUF;          //status register
  tx_complete();            //Wait until sent
  P5OUT |= CSN;
  //End Address 
  
  w_register(0x00, 0x3B);
    
  P5OUT |= CE;              //Receiver
  
}

//**************
//
//***************
void reset_RX(void)
{
  P5OUT &= ~CE;
  rx_data=r_RX_payload();
  
  flush_RX();
  w_register(0x07, 0x50);
 
  P5OUT |= CE;
}

//********************
//  Checks for SPI transfer completion
//********************
void tx_complete(void)
{
   while (!(IFG1 & UTXIFG0));              // USART0 TX buffer ready?
}

//********************
//  Checks for SPI receive completion
//********************
void rx_complete(void)
{
  while (!(IFG1 & URXIFG0));              // USART0 RX buffer ready?
} 

//*************************
//Initialise MSP I/O ports
//************************
void initialise(void)
{
  P3SEL = 0x0E; //Set port 3.1 MOSI 3.2 MISO 3.3 UCLK   
  P5DIR = 0xFF; //Port 5 Outputs
  P5OUT = 0x00; //Set as 0
  P5OUT |= 0x20; //Set CSN P5.5 high
}

//*************************
//Setup SPI to interface with ext ADC and display driver
//*************************

void setup_SPI(void)
{
 
  UCTL0 |= SWRST;                           // Set SWRST
  UCTL0 |= CHAR + SYNC + MM;                // 8-bit SPI Master **SWRST**
  UTCTL0 |= CKPH + SSEL1  + STC;            // SMCLK, 3-pin mode
  UBR00 = 0x02;                             // UCLK/8 = 1.048MHz/8 = 131kHz
  UBR10 = 0x00;                             // 0
  UMCTL0 = 0x00;                            // no modulation
  ME1 |= USPIE0;                            // Enable USART0 SPI mode
  UCTL0 &= ~SWRST;                          // Initalize USART state machine
}

//*****************************
//Reads nRF register
//Returns status register
//****************************
int r_register(address, length)
{
  int a=0;  //Temp variable to hold status
  P5OUT &= ~CSN;
  U0TXBUF = address;    //Send address of register to read
  tx_complete();
  status = U0RXBUF;
  U0TXBUF = 0xFF;       //NOP to read data
  tx_complete();
  a =  U0RXBUF;         //Read status register
  P5OUT |= CSN;
  
  return a;
}

//***************************
//Writes data to nRF register 
//***************************
void w_register(address, data)
{
   address = address + 0x20; //Set bit 5 high to set write instruction
  P5OUT &= ~CSN;
  U0TXBUF = address; //Address to be sent
  status =  U0RXBUF;   //status register
  tx_complete();     //Wait until sent
  U0TXBUF = data;   //Data to be sent
  temp =  U0RXBUF;   //status register
  tx_complete();     //Wait until sent
  P5OUT |= CSN;
}

//*******************
//Writes byte to be send 
//*******************
void w_TX_payload(data)
{
  P5OUT &= ~CSN;
  U0TXBUF = 0xA0;    //Write TX command
  temp =  U0RXBUF;   //status register
  tx_complete();     //Wait until sent
  U0TXBUF = data;   //Data to be sent
  tx_complete();     //Wait until sent
  P5OUT |= CSN;
}

//*******************
//Reads bytes sent 
//*******************
int r_RX_payload()
{
  int RX_data=0;      //Received data
  P5OUT &= ~CSN;
  U0TXBUF = 0x61;    //Write TX command
  status =  U0RXBUF;   //status register
  tx_complete();     //Wait until sent
  U0TXBUF = 0x00;    //send nop to get received data
  tx_complete();     //Wait until sent
  temp =  U0RXBUF;   //RX data
  U0TXBUF = 0x00;    //send nop to get received data
  tx_complete();     //Wait until sent
  temp =  U0RXBUF;   //RX data
  U0TXBUF = 0x00;    //send nop to get received data
  tx_complete();     //Wait until sent
  temp =  U0RXBUF;   //RX data
  U0TXBUF = 0x00;    //send nop to get received data
  tx_complete();     //Wait until sent
  RX_data =  U0RXBUF;   //RX data
  P5OUT |= CSN;
  return RX_data;
}

// *****************************************
//Produces delay in us
// ****************************************
void delay_us (unsigned long time)
{

TBCCR0 = (unsigned int)(0.032768 * time);   //Set up Timer B interval

TBCCR1 = TBCCR0 - 1; //Set TBCL1 to 1 less than TBCL0
TBCCTL1 = OUTMOD_3; //OUT1 is set when the timer reaches TBCL1 and reset when it reaches TBCL0
TBCTL |= TBCLR;
TBCTL &= ~TBIFG;
TBCTL = TBSSEL_1 | MC_1;    // ALCK up mode

while ((TBCTL & TBIFG) == 0) {} // Wait till time elapses

TBCTL = MC_0;   //Stop Timer B
}
  
void flush_TX()
{
  P5OUT &= ~CSN;
  U0TXBUF = 0xE1;   //Flush TX
  tx_complete();     //Wait until sent
  P5OUT |= CSN;
}

void flush_RX()
{
  P5OUT &= ~CSN;
  U0TXBUF = 0xE2;   //Flush RX
  tx_complete();     //Wait until sent
  P5OUT |= CSN;
}

//*******************************************
//Produces delay in ms
//******************************************

void delay_ms (unsigned long time)
{

TBCCR0 = (unsigned int)(32768 * time / 1000);     //Set up the Timer B interval

TBCCR1 = TBCCR0 - 1; //Set TBCL1 to 1 less than TBCL0
TBCCTL1 = OUTMOD_3; //OUT1 is set when the timer reaches TBCL1 and reset when it reaches TBCL0
TBCTL |= TBCLR;     //CLear TBR
TBCTL &= ~TBIFG;    //Clear IFG
TBCTL = TBSSEL_1 | MC_1;  // ALCK up mode

while ((TBCTL & TBIFG) == 0) {} // Wait till time elapses

TBCTL = MC_0;   //Stop Timer B
}

Once again, if you’re not getting the TX_DS (or even the MAX_RT) interrupt at the transmitter, then you either don’t have the registers set up properly, you aren’t writing the payload correctly, or you aren’t operating the CE pin correctly. You have to fix this in code first, unless, of course, you have a hardware problem. I would suggest looking at tutorial 1 that is available at my website, as it has extensive sample code.

It would also be helpful if you could do a register dump of the TX nRF24L01+ before and after you attempt to send a packet.

Thanks Brennen I will give your tutorial 1 a go