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

nrf24 address setup

Hi I have successfully set up my ARM SPI interface to use the nRF24 chip. At this time I'm trying to establish connection but I'm not sure I under stand the setup for comm. 

on the receiver I use an ardunio and I see this

const uint64_t pipes[2] = { 0xABCDABCD71LL, 0x544d52687CLL };              // Radio pipe addresses for the 2 nodes to communicate.

There is no mention of a channel but in the config dump it claims the channel is 0xff.

On the host per the data sheet I see this.

R_REGISTER 000A AAAA 1 to 5 LSByte first Read command and status registers. AAAAA = 5 bit Register Map Address
W_REGISTER 001A AAAA 1 to 5 LSByte first Write command and status registers. AAAAA = 5 bit Register Map Address

This is confusing be because it looks like I need to set a 5 bit address on the host but a 5 byte address on the receiver? I also do not see how you set a channel?

My working host is sending

testdata_out[8] = { 0x25, 1  };

Is this an address of 0,0,0,0,0,0,0,0,0,5 ? and sending a payload of 1 with no specific channel.

Parents
  • Hi

    The 5-bit address you refer to is the address of the configuration register that you want to read/write in the nRF24L01+ radio. The same as the address column in the register map table on page 57 of the nRF24L01+ product specification. 

    This is not to be confused with the 3, 4 or 5 byte TX/RX address used when sending and receiving packets. 

    Sending {0x25, 1} over the SPI bus basically means "set configuration register 0x05 to 1", which means you are setting the RF channel to 1. 

    The TX address is configured through configuration register 0x10, and the RX pipe 0 address is set through configuration register 0x0A. 

    Hopefully that made it clearer. If not just let me know what you are still unsure about ;)

    Best regards
    Torbjørn

  • Yes that does explain things. So I'd want to do this sort of thing.

    Send {0x25, 1}// send only once to set channel. using spi command 0x20 address 5, channel 1.

    Send {0x3A,0xBC,0xDA,0xBC,0xD7,0x01} // send only once to set tx pipe address. ABCDABCD71

    send {0xA0,1,2,3,4,5}//loop this to send 1,2,3,4,5 constantly.

    Do I have that about right?

  • Hi

    Yes, that looks correct, just a couple of things to keep in mind:

    1) To use the radio remember to set the PWR_UP bit in the CONFIG register. Without this the radio will not start up, but you can still access the config registers. 

    2) After uploading a TX packet to the FIFO you need to pulse the CE line for at least 10us to send the packet. Alternatively you can keep CE high all the time, and the radio will automatically send any packet as soon as you upload it to the TX FIFO. 

    Best regards
    Torbjørn

Reply
  • Hi

    Yes, that looks correct, just a couple of things to keep in mind:

    1) To use the radio remember to set the PWR_UP bit in the CONFIG register. Without this the radio will not start up, but you can still access the config registers. 

    2) After uploading a TX packet to the FIFO you need to pulse the CE line for at least 10us to send the packet. Alternatively you can keep CE high all the time, and the radio will automatically send any packet as soon as you upload it to the TX FIFO. 

    Best regards
    Torbjørn

Children
No Data
Related