Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs

nRF52840 dongle & nRF24L01 Pipe Config

Hi,

I'm confused about ESB settings. I'm trying to renew our board with new nRF520840 chip and we must need to provide backward compatibility that the existing board has nRF24L01.

In the ESB example of NRF5 SDK the pipe settings is set by:

static struct esb_payload tx_payload = ESB_CREATE_PAYLOAD(0, 0x01, 0x00, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08);

As I understand from the function definition Red is the pipe index, blue is the data size, greens are the pipe bytes. Is it correct?

In our nRF24 application the pipe settings are like below:

const uint64_t pipes[2] = { 0xABCDEFABCDLL, 0xAABBCCDDEELL };  // pipe[0] is for RX, pipe[1] is for TX
Data size Is 24 bytes. So do I need to set "blue" parameter to 24?
Is there only one pipe for both transmitting and receiving in new SDK (ESB)?
Look like new SDK is require 7 pipe bytes if I'm correct. How can I set 5 byte pipe number? Is it like ESB_CREATE_PAYLOAD(0240xAA, 0xBB, 0xCC, 0xDD, 0xEE);  ?
Thanks in advance.
Parents
  • Thanks a lot. Devices were successful paired according to the description in the links. To match, I needed to change NRF24 parameters like below to be suited to the example code of PTX. I'm sharing below what I did.

    NRF24 

     
    const byte addr[5] = {0xE7, 0xE7, 0xE7, 0xE7, 0xE7};   // Pipe address
    
      RF.setChannel(80);                    // Custom channel. Same as NRF5
      RF.setDataRate(RF24_1MBPS);           // NRF52840 doens't support 250KBs
      RF.openWritingPipe(addr);
      RF.openReadingPipe(1, addr);
      RF.enableAckPayload();
      RF.enableDynamicPayloads();
      RF.setRetries(2, 10);                 // Whatever
      RF.setCRCLength(RF24_CRC_16);
    NRF5
    For the certain data package, I changed the code like below in the main function:
    static struct esb_payload test_payload;
    
    short rf_data[25];
    /* some stuff with rf_data */
    
    test.length = 25;
    test.noack = true;
    for(i=0; i<25; i++)
         test.data[i] = rf_data[i];  // Data copy
    
    err = esb_write_payload(&test);
Reply
  • Thanks a lot. Devices were successful paired according to the description in the links. To match, I needed to change NRF24 parameters like below to be suited to the example code of PTX. I'm sharing below what I did.

    NRF24 

     
    const byte addr[5] = {0xE7, 0xE7, 0xE7, 0xE7, 0xE7};   // Pipe address
    
      RF.setChannel(80);                    // Custom channel. Same as NRF5
      RF.setDataRate(RF24_1MBPS);           // NRF52840 doens't support 250KBs
      RF.openWritingPipe(addr);
      RF.openReadingPipe(1, addr);
      RF.enableAckPayload();
      RF.enableDynamicPayloads();
      RF.setRetries(2, 10);                 // Whatever
      RF.setCRCLength(RF24_CRC_16);
    NRF5
    For the certain data package, I changed the code like below in the main function:
    static struct esb_payload test_payload;
    
    short rf_data[25];
    /* some stuff with rf_data */
    
    test.length = 25;
    test.noack = true;
    for(i=0; i<25; i++)
         test.data[i] = rf_data[i];  // Data copy
    
    err = esb_write_payload(&test);
Children
Related