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

nRF24L01+ can't read data from other pipes

Hi,

Master device is whole the time in receive mode and I have a problem with read data from device which address is in Pipe1. IRQ appear and status is 0x4e and FIFO status is 0x11. When I switch addresses between Pipe0 and Pipe1 everything is working correctly. Modules are on my desk in range about 30 cm.

Here is transmitter configuration:

#define C_RFM_CONFIG             0x02  //0
#define C_RFM_EN_AA              0x00	//1
#define C_RFM_EN_RXADDR          0x3F	//2
#define C_RFM_SETUP_AW           0x03	//3
#define C_RFM_SETUP_RETR         0x03	//4
#define C_RFM_RF_CH              0x02	//5
#define C_RFM_RF_SETUP           0x0F	//6
#define C_RFM_RX_ADDR_P0         0xC2C2C2C2C2LL	//7
#define C_RFM_RX_ADDR_P1         0xE7E7E7E7E7LL	//8
#define C_RFM_RX_ADDR_P2         0xC3	//9
#define C_RFM_RX_ADDR_P3         0xC4	//10
#define C_RFM_RX_ADDR_P4         0xC5	//11
#define C_RFM_RX_ADDR_P5         0xC6	//12
#define C_RFM_TX_ADDR            0xC2C2C2C2C2LL	//13
#define C_RFM_RX_PW_P0           0x04	//14
#define C_RFM_RX_PW_P1           0x04	//15
#define C_RFM_RX_PW_P2           0x00	//16
#define C_RFM_RX_PW_P3           0x00	//17
#define C_RFM_RX_PW_P4           0x00	//18
#define C_RFM_RX_PW_P5           0x00	//19

Receiver config:

#define C_NRF24_CONFIG             0x02  //0
#define C_NRF24_EN_AA              0x00	//1
#define C_NRF24_EN_RXADDR          0x3F // enabled P0, P1
#define C_NRF24_SETUP_AW           0x03	//3
#define C_NRF24_SETUP_RETR         0x03	//4
#define C_NRF24_RF_CH              0x02	//5
#define C_NRF24_RF_SETUP           0x0F	//6
#define C_NRF24_RX_ADDR_P0         0xC1C1C1C1C1LL	//7 0xC2C2C2C2
#define C_NRF24_RX_ADDR_P1         0xC2C2C2C2C2LL	//8 0xC1C1C1C1
#define C_NRF24_RX_ADDR_P2         0xC3	//9
#define C_NRF24_RX_ADDR_P3         0xC4	//10
#define C_NRF24_RX_ADDR_P4         0xC5	//11
#define C_NRF24_RX_ADDR_P5         0xC6	//12
#define C_NRF24_TX_ADDR            0xE7E7E7E7E7LL	//13
#define C_NRF24_RX_PW_P0           0x04	//14
#define C_NRF24_RX_PW_P1           0x04	//15
#define C_NRF24_RX_PW_P2           0x00	//16
#define C_NRF24_RX_PW_P3           0x00	//17
#define C_NRF24_RX_PW_P4           0x00	//18
#define C_NRF24_RX_PW_P5           0x00	//19

Read function:

__u8 NRF24L::receive(__u8 *buf, __u8 Lenght)
{
    __u8 status = 0;
    do
    {
        status = getStatus();
    } while(status == 0xE);

    if(status & NRF24_RX_DR)
    {
        //Odczyt Bufora
        readRegister(NRF24_R_RX_PAYLOAD, 4, buf);

        //Kasowanie flagi
        buffor_[0] = NRF24_RX_DR;
        readRegister(NRF24_W_REGISTER | NRF24_STATUS, 1, buffor_);
        clearAllFlags();
        return 0;

    }
    return 1;
}
  • I assume you are using ACK. ACK is sent back to the transmitter to the same address the original payload was received on. On the transmitter side it's important that pipe0 is configured with the same address as the package was sent with. ACKs are received on pipe0. So it seems like you may have a mismatch between your TX address and pipe0 address on your transmitter.

Related