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

NRF24l01p hang....

Hello everyone,

I am using nrf24l01p. It works fine but some times gets hang, doesn't receive data at all. I am sure that this is not the problem of micro controller because I have checked that uc works that time.

If I remove the nrf module connections and again connects, it works fine. So please tell me what could be the problem or way to find the problem and suggest me the solution if possible.

Parents
  • Hi,

    The RX_DR IRQ is asserted by a new packet arrival event. The procedure for handling this interrupt should be:

    1. Always check if the packet width reported is 32 bytes or shorter by using the R_RX_PL_WID command. If its width is longer than 32 bytes then the packet contains errors and must be discarded. Discard the packet by using the Flush_RX command.
    2) read entire payload through SPI (as indicated by the payload width),
    3) clear RX_DR IRQ,
    4) read FIFO_STATUS to check if there are more payloads available in RX FIFO,
    5) if there are more data in RX FIFO, repeat from step 1).

    Best regards,
    Kenneth

  • Hi,

    I have taken register values while nrf24l01p hang and while it was working

    1. while NRF working (receiving mode)

    STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
    RX_ADDR_P0-1 = 0x3030303052 0x3030303052
    RX_ADDR_P2-5 = 0xc3 0xc4 0xc5 0xc6
    TX_ADDR = 0x3030303052
    RX_PW_P0-6 = 0x04 0x04 0x00 0x00 0x00 0x00
    EN_AA = 0x3f
    EN_RXADDR = 0x03
    RF_CH = 0x78
    RF_SETUP = 0x0f
    CONFIG = 0x0e
    DYNPD/FEATURE = 0x00 0x00
    Data Rate = 2MBPS
    Model = I⸮4L01+
    CRC Length = 16 bits
    PA Power = PA_MAX

    2. while hang NRF(receiving mode)

    STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
    RX_ADDR_P0-1 = 0x3030303052 0x3030303052
    RX_ADDR_P2-5 = 0xc3 0xc4 0x19 0xc6
    TX_ADDR = 0xa048ff0707
    RX_PW_P0-6 = 0x00 0x04 0x12 0x1e 0x02 0x00
    EN_AA = 0x03
    EN_RXADDR = 0x13
    RF_CH = 0x78
    RF_SETUP = 0x0f
    CONFIG = 0x0e
    DYNPD/FEATURE = 0x00 0x00
    Data Rate = 2MBPS
    Model = ⸮⸮RF24L01+
    CRC Length = 16 bits
    PA Power = PA_MAX

    here I am able to read these registers but data is not available rx_buffer. How is this possible??

    Please somebody look int my given data and help me find out the problem.

    And is there any register value or something by which I can find that NRF is working or in hanging condition??

Reply
  • Hi,

    I have taken register values while nrf24l01p hang and while it was working

    1. while NRF working (receiving mode)

    STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
    RX_ADDR_P0-1 = 0x3030303052 0x3030303052
    RX_ADDR_P2-5 = 0xc3 0xc4 0xc5 0xc6
    TX_ADDR = 0x3030303052
    RX_PW_P0-6 = 0x04 0x04 0x00 0x00 0x00 0x00
    EN_AA = 0x3f
    EN_RXADDR = 0x03
    RF_CH = 0x78
    RF_SETUP = 0x0f
    CONFIG = 0x0e
    DYNPD/FEATURE = 0x00 0x00
    Data Rate = 2MBPS
    Model = I⸮4L01+
    CRC Length = 16 bits
    PA Power = PA_MAX

    2. while hang NRF(receiving mode)

    STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
    RX_ADDR_P0-1 = 0x3030303052 0x3030303052
    RX_ADDR_P2-5 = 0xc3 0xc4 0x19 0xc6
    TX_ADDR = 0xa048ff0707
    RX_PW_P0-6 = 0x00 0x04 0x12 0x1e 0x02 0x00
    EN_AA = 0x03
    EN_RXADDR = 0x13
    RF_CH = 0x78
    RF_SETUP = 0x0f
    CONFIG = 0x0e
    DYNPD/FEATURE = 0x00 0x00
    Data Rate = 2MBPS
    Model = ⸮⸮RF24L01+
    CRC Length = 16 bits
    PA Power = PA_MAX

    here I am able to read these registers but data is not available rx_buffer. How is this possible??

    Please somebody look int my given data and help me find out the problem.

    And is there any register value or something by which I can find that NRF is working or in hanging condition??

Children
  • I did more digging on this problem and I found that some register values changes that causes nrf doesn't receive data(hangs). If these registers having particular value then it works fine.

    right values for registers:

    EN_AA = 0x3f
    EN_RXADDR = 0x03
    RF_CH = 0x78
    RF_SETUP = 0x0f
    CONFIG = 0x0e

    while my nrf hangs some of these register values changes and if I reinitialize nrf with all settings these register values changes to right values and nrf works fine but sometimes some of these registers values doesn't change even after reinitialization(like EN_RXADDR val changes to required but EN_AA reg val doesn't change ) and nrf does receive data. So please make me understand the means of these reg values for and suggest me the best method to restore these register values. 

  • These registers will be retrained as long as power is supplied. Can it be some kind of ESD event occurring here that impact the nRF24L01? What is the power supply level, and is the power supply steady?

  • So my nrf24l01p is connected to spi of micro-controller and same spi pads are used for programing and during programing ce and csn pins are not connected to the programer. when I upload program most of the time these register values changes that causes no data receive at receiver. When I power off device and power up again then it works. So I am not understanding, how does these values change even if power is not fluctuating.

  • Floating inputs may be the problem here. I suggest to connect external pull-up resistor on the CSN line and external pull-down resistor on the CE pin.

Related