This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

minimal nRF24L01 setup problem

Hello,

I am having difficulty having two nRF24L01P's communicate with one another. I have set up the devices in what I thought was a minimal system. I will appreciate any help in identifying the problem.

Both units are initialized with the following register assingments:

00 - 00001000 ; to transmit, 1 byte CRC, power-down

01 - 00000000 ; auto ack disabled on all channels

02 - 00000001 ; only data pipe 0 enabled

03 - 00000001 ; 3 byte address field

04 - 00000000 ; retransmits disabled

05 - decimal-60 ; selects frequency channel

06 - 00100110 ; 240Kbps, 0dBm, LNA gain on

11 - 00000001 ; pipe 0 number of bytes (1) in payload

All other registers are left alone with their reset values.

Interrupts reset, fifo's flushed, and the units are then powered up using

00 - 00001011 ; receiver powerup

00 - 00001010 ; transmitter powerup

CE=1 on both units.

The transmitter-mcu issues a W_TX_PAYLOAD command followed by a single byte into the spi every second. (The byte is incremented at each transmission.)

The transmitter seems to be transmitting, as TX_DS is set (from a reset) after each command.

On the receiver side, I check RX_DR, RX_P_NO, RX_EMPTY bits every second, but they never indicate any reception.

What could be wrong? Thanks in advance..

Parents
  • Hi, if you are using our hal_nrf library the minimum setup should be:

    // Configure radio as primary receiver (PRX)
    hal_nrf_set_operation_mode(HAL_NRF_PRX);
        
    // Set payload width to 3 bytes
    hal_nrf_set_rx_payload_width((int)HAL_NRF_PIPE0, 3);
        
    // Power up radio
    hal_nrf_set_power_mode(HAL_NRF_PWR_UP);
    
    // Add a delay of 1.5ms
        
    // Enable receiver
    CE_HIGH();
    

    and for primary transmitter (PTX)

    // Power up radio   
    hal_nrf_set_power_mode(HAL_NRF_PWR_UP);
    
    // Add a delay of 1.5ms
        
    // Write payload to radio TX FIFO
    hal_nrf_write_tx_payload(payload, 3U);
        
    // Toggle radio CE signal to start transmission
    CE_PULSE();
    

    However in this case it might be a hardware issue, do you have access to a spectrum analyzer to measure on an carrier or have you bought nRF24L01+ modules from a distributor of us?

Reply
  • Hi, if you are using our hal_nrf library the minimum setup should be:

    // Configure radio as primary receiver (PRX)
    hal_nrf_set_operation_mode(HAL_NRF_PRX);
        
    // Set payload width to 3 bytes
    hal_nrf_set_rx_payload_width((int)HAL_NRF_PIPE0, 3);
        
    // Power up radio
    hal_nrf_set_power_mode(HAL_NRF_PWR_UP);
    
    // Add a delay of 1.5ms
        
    // Enable receiver
    CE_HIGH();
    

    and for primary transmitter (PTX)

    // Power up radio   
    hal_nrf_set_power_mode(HAL_NRF_PWR_UP);
    
    // Add a delay of 1.5ms
        
    // Write payload to radio TX FIFO
    hal_nrf_write_tx_payload(payload, 3U);
        
    // Toggle radio CE signal to start transmission
    CE_PULSE();
    

    However in this case it might be a hardware issue, do you have access to a spectrum analyzer to measure on an carrier or have you bought nRF24L01+ modules from a distributor of us?

Children
  • You were so right, it was a hardware issue! (A bad connection resulting in intermittent problems.) Your suggestion of detecting the carrier was very useful in identifying the problem. Well, this question & answer may still be useful for people (like me) who prefer to write individual registers themselves - yes the register set up works.

    Thanks for your response, I appreciate it.

Related