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/CC1310: Changing Frequency On-the-Fly w?EasyLink API

Part Number: CC1310

Tool/software: TI-RTOS

1) How do I change frequency programmatically, or "on-the-fly". The code snippet below does not work, I get EasyLinl_Cmd_errors. It attempts to alternate between 868Mhz and 900Mhz

2) Also, how do you cleanly paste code from CCS to this forum?

if(chng_freq)

{
        el_status = EasyLink_init(EasyLink_Phy_50kbps2gfsk);

        if(el_status != EasyLink_Status_Success) {
              EasyLink_abort();
       }

      /* Set frequency */
     el_status = EasyLink_setFrequency(900000000);

     if(el_status != EasyLink_Status_Success) {
             EasyLink_abort();
     }

}

else
{
     el_status = EasyLink_init(EasyLink_Phy_50kbps2gfsk);
     if(el_status != EasyLink_Status_Success) {
           EasyLink_abort();
      }

     /* Set frequency */
    el_status = EasyLink_setFrequency(868000000);
    if(el_status != EasyLink_Status_Success) {
          EasyLink_abort();
     }
}
chng_freq = !chng_freq;

  • Frank, 

    Typically to change  the frequency, one can Cancel the RF rx/tx command and then call the RF cmdFs with the new frequency. 

    Since you are using the Easylink api, can you try as below

    if(chng_freq)
    
    {
        if(EasyLink_abort() == EasyLink_Status_Success) {
                 el_status = EasyLink_init(EasyLink_Phy_50kbps2gfsk);
    
                 /* Set frequency */
                 EasyLink_setFrequency(900000000);
    
         }
    
    }
    

  • On the second question, you can enable the Rich text format and click on the Syntaxhighlighter icon that looks a bit like this [</>]. 

  • Frank,

    I tried the below code. All I did was take the example easylink Tx code and add these lines at the beginning of the while loop. And it worked with no issues.

            if (fpingpong) {
                EasyLink_setFrequency(866000000);
            }
    
            else {
                EasyLink_setFrequency(870000000);
            }
             fpingpong = !fpingpong;