Latency minimum round-trip latency for network using nRF52840

Hello,

We've a design/arch question about the performance of nRF52840 device (dongle/EVK).

In our system, we've a PC connected to a PTX that communicates with multiple PRXs (via ESB), collect data and send it back to the PC (via cdc_acm, ACK + Payload). Our objective is to measure latency (how much time from the moment the PC requests data until it gets the data from all the PRXs devices).

I'm currently testing packets of 128 bytes (payload, not considering the protocol overhead) and I get the following results:

Wifi (transmit to ACK): ~0.97ms
UART Latency (response time from uart_irq_tx_enable until the callback is reached): ~0.36ms
Round-trip (on PC side, from request to reception of the PRXs payloads): ~1ms + ~1ms for each PRX device

The test case was performed as follows:

  • PC requests PTX to collect data from all the PRXs
  • PC start to measure time
  • PTX parses the command
  • Performs the following for each connected device: 
    • PTX sends to each PRX a request
    • PRX reply ACK+Payload
    • PTX copies the data to a buffer and trigger the UART IRQ
    • PTX UART callback is triggered (after delay of ~0.36ms)
    • PTX UART send serial Data to PC
    • PC measure time and plot it to the graph

Questions:

  1. Is the writing/reading from UART a blocking function call (esb_read_rx_payload/uart_fifo_fill)? What about ESB (esb_write_payload)?
    1. or the buffer is copied somewhere else and the tx/rx is done in parallel?
  2. Are the results plausible (~6ms for my example to retrieve data from all 4 RX devices)?
  3. Any suggestion/technique to reduce this latency? (perhaps invert the roles, so the device connected to the PC will be PRX and remaining devices PTX ?)

Thank you in advance for your time,

Parents
  • Hello,

    1. I do not believe the functions in questions are blocking, they (uart and radio) should be able to operate in parallell.

    2. Yes, given there are no packet loss (e.g retransmi), in which case it likely will increase.

    3. You can consider using noack for all communication, where the PTX send a noack command on-air that all PRX can receive, then each PRX can send a noack in reverse direction with a fixed latency (e.g. prx1 after 0us, prx2 after 400us, prx3 after 800us and so forth), this should speed things up. But it would require you to switch operation modes, e.g. the PTX then intermittently become an PRX for e.g. 2-3ms to receive the noack packets from the "PRX's". You should be able to reduce the ~6ms to about the half this way.

    Best regards,
    Kenneth

  • Great! Thank you for your proposal, I'll check this option of switching roles (PTX<=>PRX). It may suit our needs.

    Another option I've checked is to use 2x PTXs paired with 2x PRXs each.

    I've also gave distinct channels to each pair (1 and 50).

    I'm calling this function during the initialization stage:

    esb_set_rf_channel(50);

    I've managed to improve the performance by this. But we're aiming for better results.

  • Vagner Landskron said:
    Another option I've checked is to use 2x PTXs paired with 2x PRXs each.

    That might work, but you should be aware that if one PTX while the other PRX, then even if you use frequencies far apart the signal strength from the nearby PTX antenna will impact the sensitivity of the PRX. Presuming I understand it correctly you want to place the two PTX on the same PCB.

    Kenneth

Reply Children
No Data
Related