This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RTOS/CC2650: Latency Calculation in RTOS

Part Number: CC2650

Tool/software: TI-RTOS

Hello Everyone!

I am trying to calculate the latency in a small network consisting of one node and one concentrator( both are CC2650 Launchpads).

I am using the rfWsnNode_CC2650_LAUNCHXL_TI and rfWsnConcentrator_CC2650_LAUNCHXL_TI examples, provided with RTOS.

I am thinking of using the Timestamp to calculate the time it takes to start sending packet, from Node,  till the acknowledgment of the packet is received by the Node from the Concentrator.

I will appreciate if any one can give some useful hints.

  • Hello Syed,

    I would recommend toggling a GPIO and looking at a scope, and see the time between toggles. If you want to be very accurate you can toggle the LEDs using the HWREG() and writing directly to the toggle register. This call takes approx 3cycles to execute.

    I hope this helps,
    AB
  • Hello AB!

    The LED toggles already happens after sending packet.

    On the other hand since the mentioned examples uses EasyLink API I tried to do something like this,

    uint32_t start, stop, result;

    start = stop = result = 0;

    start = EasyLink_getAbsTime();

    if (EasyLink_transmit(&currentRadioOperation.easyLinkTxPacket) != EasyLink_Status_Success)
    {
    System_abort("EasyLink_transmit failed");
    }
    stop = EasyLink_getAbsTime();

    result = stop - start;


    I am supposing that the result stores the time spent on sending the packet, which comes out to be 10ms most of the times.
    can i count this to be the Latency?
  • Or may be this will be more precise...

       start = EasyLink_getAbsTime();

                sendDmPacket(dmSensorPacket, NODERADIO_MAX_RETRIES, NORERADIO_ACK_TIMEOUT_TIME_MS);

            

            /* If we get an ACK from the concentrator */

            if (events & RADIO_EVENT_DATA_ACK_RECEIVED)

            {

            stop = EasyLink_getAbsTime();

                result = stop - start;

                returnRadioOperationStatus(NodeRadioStatus_Success);

            }