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

What is the right configuration of registers for NRF24L01P (TX mode and RX mode)

After i test a lot of possible configurations for nrf24L01+ based on the documentation, i didn't come to the right setup for all the nRf24L01+ registers to send data from a module as an emitter and to receive as a receiver. here is the configurations i made for the initiation ( Transmitter)

config_transmiter();           // set as transmiter and power up
setRADDR();                    // address for pipe 1 
setTADDR();                    // same for receiver of pipe 0
rf_setup() ;
payload_size(8);               // 5 bytes
setRF_CH();                    // 2.431GHz
flushTX();                     // clear any data in TX FIFO
en_RXADDR(0x3F);
auto_ack(0x3F); 

address RX : 0x65646f4e32 address TX : 0x65646f4e31

( Receiver)

config_receiver();           // set as transmiter and power up
setSETUPAW();
setRADDR();                    // address for pipe 0 
setTADDR();                    // same for trasmiter
rf_setup() ;
payload_size(8);               // 5 bytes
setRF_CH();                    // 2.431GHz
flushRX();                     // clear any data in RX FIFO
en_RXADDR(0x3F);
auto_ack(0x3F);                // enable auto acknowledgment

address RX : 0x65646f4e31 address TX : 0x65646f4e31

Parents
  • Hi Mohamed

    When using the auto ACK (ESB) features of the nRF24L01+ you want to make sure that the TX and Pipe 0 address is the same on the PTX side. The reason for this is that the PTX uses pipe 0 to receive the acknowledgement sent by the PRX.

    Also, I can only see setSETUPAW(); referenced on the RX side. If you have a different address length on the TX and RX side then communication will fail.

    If you still have issues after checking these things, then it would help if you could write down the state of the configuration registers on both sides. Then I can look them over and see if I spot any more issues.

    Best regards
    Torbjørn

  • Hi Mohamed

    Your settings look good, except that you don't have the MAX_RT interrupt enabled on the PTX side. Since the MAX_RT interrupt occurs every time you don't receive an ACK from the PRX, this is something you should account for.

    That being said this shouldn't block communication completely. Could you share your source code, so I can have a look at how you send/receive packets, and process the radio interrupts?

Reply
  • Hi Mohamed

    Your settings look good, except that you don't have the MAX_RT interrupt enabled on the PTX side. Since the MAX_RT interrupt occurs every time you don't receive an ACK from the PRX, this is something you should account for.

    That being said this shouldn't block communication completely. Could you share your source code, so I can have a look at how you send/receive packets, and process the radio interrupts?

Children
No Data
Related