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.

CC1310: Timing of RX after TX and using of standby mode inbetween

Other Parts Discussed in Thread: CC1310

Hi,

I would like to start an RX window based on when a packet was transmitted and be able to enter low power mode.

I am using CC1310 in Prop Mode.

I know I will need to sync the RTC and RAT and have this in place, but I can not find any dokumentation on how i get an accurate timestamp of

when the TX command has been executed.

I am not using the TI-RTOS but I also do not see any support for accurately timing the RX window in the rf.c files.

Br,

Mads

  • Hi Mads,

    please understand that we provide support for TI-RTOS only. If you want to write your own driver, you can study the TI-RTOS RF driver. It's located in ${TIRTOS_INSTALL_DIR}/products/tidrivers_XXX/packages/ti/drivers/rf/.

    If you want to start RX immediately after/relative to TX, you can use command chaining:

    • Set the pNextOp pointer in a command to the address of the next command
    • Set the start trigger to something that fits your needs. You can set it for example to an absolute time or relative to the end time of the previous command or to trigger immediately after the previous command...

    Command chaining is straight forward, but TI-RTOS release 2.20 (mid June) contains a rfListenBeforeTalk example that shows command chaining. 

    The RF driver provides a function RF_getCurrentTime() that you can use as "now" to set an absolute time in the future. The RF driver and TI-RTOS handle power management automatically. If you start a command with a trigger in the future, pend on the command and have no other task running, then the RF driver will put the  cc1310 into standby.

  • Hi Richard,

    My Problem is that I can NOT use command chaining. this requires the RAT for timing, that means the HF OSC need to run. This means i can only go into IDLE mode and not standby mode.

    I assume that the RAT -> RTC sync feature is implemented to overcome this, but you will need to have timing information on when last command ended in order to time the next.

    this means you have a scenario that looks like this

    RF-Core ON, Init, Start RAT, Sync RAT Start

    TX CMD

    Get Command End RAT Time

    Sync Rat Stop

    RF-Core OFF

    Standby mode

    Wake up on RTC before required RX time

    RF-Core ON, Init, Start RAT, Sync RAT Start

    RX CMD with start time trigger 

    but i can not find any information on getting RAT information when a command has ended.

    BR,

    Mads

     

  • Hi Mads,

    The end time of a TX command is deterministic. You can measure it. Based on that, you can either set a relative or absolute time for the second command and you do not need to know the end-time of the TX command.

    You are right that with chaining alone, you can not go into stand by between two commands because the RAT is used to determine the start of the second command. However, the RF driver in TI-RTOS has a feature to go into standby between two commands when using absolute timing. It can do that because it keeps commands in an internal storage before delivering it to the RF core. Here's an example example snippet how to set up the commands with absolute timing:

        /* Convenience macros */
        #define RF_convertUsToRatTicks(microseconds) \
            ((uint32_t)(microseconds) * 4)
    
        #define RF_convertMsToRatTicks(milliseconds) \
            RF_convertUsToRatTicks((milliseconds) * 1000)
    
        #define Clock_convertMsToTicks(milliseconds) \
            (((milliseconds) * 1000) / Clock_tickPeriod)
    
    
        // The following code runs in a TI-RTOS task
        // General RF command initialization is not included here 
    
        RF_Params rfParams;
        RF_Params_init(&rfParams);
        //rfParams.nInactivityTimeout = 100 * 1000; // The inactivity timeout after which standby is allowed
        //                                          // Can also use RF_yield() directly
    
        /* Request access to the radio */
        rfHandle = RF_open(&rfObject, &RF_prop, (RF_RadioSetup*)&RF_cmdPropRadioDivSetup, &rfParams);
    
        /* Set the frequency */
        RF_postCmd(rfHandle, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, NULL, 0);
    
        /* Run two separate commands, absolute timing */
        while(1)
        {
            /* Set up TX command timing */
            RF_cmdPropTx.startTrigger.triggerType = TRIG_NOW;
            RF_cmdPropTx.startTime = 0;
    
            /* Set up RX command timing */
            RF_cmdPropRx.startTrigger.triggerType = TRIG_ABSTIME;
            RF_cmdPropRx.startTime = RF_getCurrentTime() + RF_convertMsToRatTicks(100);
            RF_cmdPropRx.endTrigger.triggerType = TRIG_REL_START;
            RF_cmdPropRx.endTime = RF_convertMsToRatTicks(200);
    
            PIN_setOutputValue(ledPinHandle, BUSY_LED, 1);
    
            /* Schedule first command, do not wait for completion */
            RF_postCmd(rfHandle, (RF_Op*)&RF_cmdPropTx, RF_PriorityNormal, NULL, 0);
    
            /* Schedule second command, do not wait for completion */
            RF_CmdHandle lastCommand = RF_postCmd(rfHandle, (RF_Op*)&RF_cmdPropRx, RF_PriorityNormal, &callback, RF_EventRxOk);
    
            /* Tell the driver that no more commands will be posted for a while and it can go to power down whenever possible */
            RF_yield(rfHandle);
    
            /* Wait for all commands to finish */
            RF_pendCmd(rfHandle, lastCommand, RF_EventLastCmdDone);
    
            PIN_setOutputValue(ledPinHandle, BUSY_LED, 0);
    
            Task_sleep(Clock_convertMsToTicks(300));
        }

    When you do not want to use TI-RTOS, then you need to re-implement this functionality and the whole power-down/power-up machinery. Please refer to the TRM, section 23.2.3.3 and the RF driver implementation. Look for "opRatSync" which shows the usage of the CMD_SYNC_START_RAT and CMD_SYNC_STOP_RAT commands.

  • Thanks Richard,

    There is still the challenge that it is software that reads the Time used for the RX and that could potentially add jitter. Also it is absolute based on "now" and not on when the TX Command is actually processed.

    I guess the only way is to start TX with a smaller delay so there is an absolute start time to use as a reference for the RX.

    /Mads
  • Mads,

    yes, that's right. When using absolute timing, you can always set the time of multiple commands in relation to a single time point and you add a small delay for the first command:

    /* Get a common timepoint */
    uint32_t currentTime = RF_getCurrentTime();
    
    /* Set up TX command timing */
    RF_cmdPropTx.startTrigger.triggerType = TRIG_ABS;
    RF_cmdPropTx.startTime = currentTime + RF_convertMsToRatTicks(10);
     
    /* Set up RX command timing */
    RF_cmdPropRx.startTrigger.triggerType = TRIG_ABSTIME;
    RF_cmdPropRx.startTime = currentTime + RF_convertMsToRatTicks(50);
    RF_cmdPropRx.endTrigger.triggerType = TRIG_REL_START;
    RF_cmdPropRx.endTime = RF_convertMsToRatTicks(200);

    This eliminates software jitter between multiple commands.