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

nRF51 to 24L01P ESB duplicate packet

Hello,

I am currently testing the nRF51 series as a possible upgrade to our products that use the 24L01P. For testing I have the nRF51 dev board setup as the PRX and a custom board with an 24L01P as the PTX. I have quite a bit of experience with ESB and the 24L01P so getting the two boards communicating required minimal effort. The issue I am seeing is on the nRF51 side. When the first packet is received from the 24L01P everything is correct and the payloads match. However, on every subsequent transmission the payload received on the nRF51 is not updated and remains the same as the very first packet, even the PID is the same The esb event callback is being called correctly on the nRF51 side so I know that the transmission was successful, I also receive the ACK back on the PTX). The RSSI field is being updated however the payload is not. I am confident that the issue is on the nRF51 side as I have tried resetting the PTX side, which performs a complete re-init, and sending a new packet. The transmission is successful but the payload is not updated. If I reset the nRF51 side the first packet is received correctly with the correct payload however it never updates the payload after the first transmission.

Here are my settings:

  • 5 byte address widths
  • dynamic payload length
  • 16bit CRC
  • 250kbps
  • Date pipe 0
  • Auto ack with 10 retries 1500us intervals

Before every transmission I flush the tx buffer on the PTX side to ensure the new data is transmitted. I also flush the rx buffer and tx buffer on the prx side after a successful packet is received. I have tried turning off auto-ack to see if that was the cause but it had the same effect. I have also check the OBSERVE_TX register on the 24L01 side and the retry count is 0 so I doesn't seem like and auto-ack problem.

I am using the SDK v11, Keil uVision, PCA10028 dev board and a modified esb_prx example project.

PTX nrf24l01P Init code

  Radio.address.bytes.byte5 = 0x65;     //Static for now but will be read from NVM
  Radio.address.bytes.byte4 = 0x10;
  Radio.address.bytes.byte3 = 0xE1;
  Radio.address.bytes.byte2 = 0xA5;
  Radio.address.bytes.byte1 = 0x03;
  
  Radio.channel = 0x53;                 //Static for now but will be read from NVM
  Radio.myId = 0x22;                    //Static for now but will be read from NVM
  
  hal_nrf_set_power_mode(HAL_NRF_PWR_DOWN);     //Power down for config
  hal_nrf_set_crc_mode(HAL_NRF_CRC_16BIT);      //Set to 16-bit CRC 
  hal_nrf_set_address_width(HAL_NRF_AW_5BYTES); //set 5 byte address width
  hal_nrf_set_address(HAL_NRF_PIPE0,Radio.address.byteArray);   //Set our address
  //hal_nrf_get_address(HAL_NRF_PIPE0,temp);
  
  hal_nrf_set_rf_channel(Radio.channel);        //Set the Channel
  hal_nrf_set_datarate(HAL_NRF_250KBPS);        //Set the data rate to 250kbps
  hal_nrf_close_pipe(HAL_NRF_ALL);              //Shut down all the pipes
  hal_nrf_open_pipe(HAL_NRF_PIPE0,TRUE);        //Enable pipe0 with auto ACK
  hal_nrf_set_address(HAL_NRF_TX,Radio.address.byteArray);      //Set the address for TX'n
  hal_nrf_set_auto_retr(10U,1500U);     //Retry 10 times at 1500uS intervals
  hal_nrf_setup_dynamic_payload(1U);    //Enable Dynamic Payload for pipe0
  hal_nrf_enable_dynamic_payload(TRUE);
  hal_nrf_enable_ack_payload(TRUE);

PRX nRF51 ESB init code

uint32_t err_code;
uint8_t base_addr_0[4] = {0x10, 0xE1, 0xA5, 0x03};
uint8_t base_addr_1[4] = {0x65, 0xA5, 0xE1, 0x10};
uint8_t addr_prefix[8] = {0x65, 0x03, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8 };
nrf_esb_config_t nrf_esb_config         = NRF_ESB_DEFAULT_CONFIG;
nrf_esb_config.payload_length           = 32;
nrf_esb_config.protocol                 = NRF_ESB_PROTOCOL_ESB_DPL;
nrf_esb_config.bitrate                  = NRF_ESB_BITRATE_250KBPS;
nrf_esb_config.mode                     = NRF_ESB_MODE_PRX;
nrf_esb_config.event_handler            = nrf_esb_event_handler;
nrf_esb_config.selective_auto_ack       = false;

err_code = nrf_esb_init(&nrf_esb_config);
VERIFY_SUCCESS(err_code);

err_code = nrf_esb_set_base_address_0(base_addr_0);
VERIFY_SUCCESS(err_code);

err_code = nrf_esb_set_base_address_1(base_addr_1);
VERIFY_SUCCESS(err_code);

err_code = nrf_esb_set_prefixes(addr_prefix, 8);
VERIFY_SUCCESS(err_code);
	
err_code = nrf_esb_set_rf_channel(0x53);
VERIFY_SUCCESS(err_code);

return err_code;

Thanks!

Parents Reply Children
No Data
Related