How to achieve NRF52840 ESB Maximum data rate

As part of a university project I am trying to read an analog signal and transmit it at the maximum data rate over ESB. But I cant seem to get above 1700kbps without any of my payload writes failing. I have disabled acking, I am using the highest bitrate, lowest CRC and fast ramp up. Are there specific timing settings that I am missing or does anyone else have any experience trying to achieve this feat. (at the moment my timing settings are linked to ADC acquisition rate and increasing the rate above a certain amount causes payload_write issues). Aplogies if this has been properly answered before but I have tried searching.I am using the NRF Connect SDK. I am looking to get as close to 2000kbps with minimal latency.

Included is my ESB config and conf settings.

config.protocol = ESB_PROTOCOL_ESB_DPL;
config.retransmit_delay = 10;
config.retransmit_count = 1; // Default retransmit count
config.tx_output_power = ESB_TX_POWER_8DBM;
config.bitrate = ESB_BITRATE_2MBPS; // Fixed bitrate
config.event_handler = event_handler;
config.mode = ESB_MODE_PTX;
config.selective_auto_ack = true;
config.payload_length = 252
config.crc = ESB_CRC_8BIT; // NRF_ESB_CRC_OFF
config.use_fast_ramp_up = true;

CONFIG_NCS_SAMPLES_DEFAULTS=y
CONFIG_ESB=y
CONFIG_DK_LIBRARY=y
CONFIG_CLOCK_CONTROL=y

CONFIG_ESB_NEVER_DISABLE_TX=n
CONFIG_ESB_RX_FIFO_SIZE=256
CONFIG_ESB_TX_FIFO_SIZE=256
CONFIG_ESB_MAX_PAYLOAD_LENGTH=252

# Enable logging subsystem
CONFIG_LOG=y


# Enable logging for the ESB module
CONFIG_ESB_LOG_LEVEL_DBG=y
# Enable heap memory pool for dynamic memory allocation
CONFIG_HEAP_MEM_POOL_SIZE=16384

CONFIG_NRFX_SAADC=y
CONFIG_NRFX_PPI=y
CONFIG_NRFX_TIMER0=y
CONFIG_NRFX_TIMER2=y
  • Hi,

     

    You will never reach the throughput equal to the on-air data rate, as there will be overhead in general (addressing, ramp-up etc).

    When you setup your ESB configuration, this needs to match on both PRX and PTX.

    Have you set the .noack member to the struct esb_payload variable that you're using? To enable noack, you need to set this in the tx_payload variable:

    tx_payload.noack = true;
    err = esb_write_payload(&tx_payload);
    ...

     

    Kind regards,

    Håkon

  • Hi Hakon, thanks for your reply. I set .noack equal to 1 before each esb write and I have selective auto ack enabled on the PRX aswell, when i was troubleshooting the issue i tried using 32 byte packets and sending them faster, a friend has been able to achieve rates of 1650kbps using an NRF24L01 and an FPGA with 32 byte packets, but I could only send around 900kbps with that packet size so I'm wondering if the issues are with my configuration/code or if it is just the difference in overhead between the old and new devices. Please let me know if there is any information i can give you to help. 

    Doing some quick maths, 252 payload + crc byte + 4 prefix/address bytes = 257bytes

    at 2000kbps on air time = 1010.5us, with 40us ramp up, this becomes 1050.5us period or 0.952khz

    0.952*252*8=1919.2 kbits per second theoretically, I am just trying to see where i could find the extra 200 or 100kbps to squeeze every last bit out of the protocol. Again I appreicate your help, I am an embedded novice so I could easily be doing something very simple wrong.

    My code is based on the PRX and PTX examples and has addresses as follows so maybe I am just making the addresses too long?

    	uint8_t base_addr_0[4] = {0xE7, 0xE7, 0xE7, 0xE7};
    	uint8_t base_addr_1[4] = {0xC2, 0xC2, 0xC2, 0xC2};
    	uint8_t addr_prefix[8] = {0xE7, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8};

Related