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

Communication between nrf24l01P+ and nrf52840

Hi,

 I want to communicate with a legacy device nrf24l01p+ based using a nrf52840 DK.

Firmware of legacy device setup the card in this way:

uint8_t rx_address[5] = {0xc7, 0xa6, 0x37, 0xc7, 0xa6};

nRF24L01P_disableAutoAcknowledge();
nRF24L01P_disableAutoRetransmit();
nRF24L01P_setRfOutputPower(NRF24L01P_TX_DEFAULT_PWR);
nRF24L01P_setRfFrequency(2446);
nRF24L01P_setAirDataRate(1000);
nRF24L01P_setCrcWidth(16);
nRF24L01P_setTxAddress(rx_address, 5);
nRF24L01P_setRxAddress(rx_address, 5, 0);
nRF24L01P_setAddressNull();
nRF24L01P_setTransferSize(13, 0);

I take the esb_ptx esample from nrf52 SDK and I change setup in this way:

uint8_t base_addr_0[4] = {0xa6, 0x37, 0xc7, 0xa6};
uint8_t base_addr_1[4] = {0xa6, 0x37, 0xc7, 0xa6};
uint8_t addr_prefix[8] = {0xc7, 0xc2, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5};

nrf_esb_config_t nrf_esb_config = NRF_ESB_LEGACY_CONFIG;
nrf_esb_config.protocol = NRF_ESB_PROTOCOL_ESB;
nrf_esb_config.bitrate = NRF_ESB_BITRATE_1MBPS;
nrf_esb_config.mode = NRF_ESB_MODE_PTX;
nrf_esb_config.event_handler = nrf_esb_event_handler;
nrf_esb_config.selective_auto_ack = true;
nrf_esb_config.payload_length = 13;
nrf_esb_config.crc = NRF_ESB_CRC_16BIT;

nrf_esb_init(&nrf_esb_config);
nrf_esb_set_rf_channel(46);
nrf_esb_set_address_length(5);
nrf_esb_set_base_address_0(base_addr_0);
nrf_esb_set_base_address_1(base_addr_1);
nrf_esb_set_prefixes(addr_prefix, 1);
    

But it doesn't work. Can you help me?

  • Hi

    Address configuration is quite different between the older and newer devices, so I would suggest using the default 0xE7E7E7E7E7 address at the start to verify if things are working. This address is a palindrome of sorts, in that it looks the same even if the bit or byte direction is reversed. 

    If that doesn't work make sure the configured packet length is identical to the length of the TX payload. 

    Also, I think you need to enable auto acknowledge on your receiver side to be compatible with the nrf_esb library. 
    By disabling auto acknowledge you are reverting back to the legacy ShockBurst mode, which is not supported by the nrf_esb library. 

    Best regards
    Torbjørn

Related