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.

CC1312R: How to dynamically set the RF frequency in the code?

Part Number: CC1312R

Hi Team,

// CMD_FS
// Frequency Synthesizer Programming Command
rfc_CMD_FS_t RF_cmdFs_slr2500bps2gfsk433mhz_0 =
{
    .commandNo = 0x0803,
    .status = 0x0000,
    .pNextOp = 0,
    .startTime = 0x00000000,
    .startTrigger.triggerType = 0x0,
    .startTrigger.bEnaCmd = 0x0,
    .startTrigger.triggerNo = 0x0,
    .startTrigger.pastTrig = 0x0,
    .condition.rule = 0x1,
    .condition.nSkip = 0x0,
    .frequency = 0x01BC,
    .fractFreq = 0x0000,
    .synthConf.bTxMode = 0x0,
    .synthConf.refFreq = 0x0,
    .__dummy0 = 0x00,
    .__dummy1 = 0x00,
    .__dummy2 = 0x00,
    .__dummy3 = 0x0000
};

This paragraph in ti_radio_config.c contains the frequency-related information. If I want to set it dynamically in the code, how should I do it? Is there a step limit for the frequency setting?

Kind regards,

Katherine

  • Hi Katherine, 

    How much change do you need in the frequency? And how often do you want to do this change?

    Regards,

    Sid

  • Hi Sid,

    I used the parameters in NVS for the initialization after the start-up. I did not modify the frequency when I ran normally and only set the RF when the on-site frequency was occupied to avoid busy channels.

    Regards,

    Katherine

  • Hi Katherine, 

    The method to update the frequency depends on how big the change in frequency you need. The frequency is controlled by the setup command(CMD_RADIO_SETUP) and the frequency synthesizer command(CMD_FS). 

    The best way to check the differences in the commands needed is to use SmartRf studio. 

    If the change is less than 1 MHz from the centerFreq defined in the setup command, you could just modify the fractFreq field in the CMD_FS. Once you update the fractFreq field, you should run the cmdFs again. 

    After you run the CMD_FS, the radio will transmit or receive with the new frequency, It will keep this frequency setting even between sleeps. 

    But it is different when you need to change the center frequency in the setup command every time you increment > 1MHz from the initial centerFreq in the setup command. This needs an update to the setup command itself.

    Whenever you need to change the setup command, you need to do the following sequence. 

    1. Update the fields in the setup command that you need. In your case centerFreq.

    2. Use the RF_control() API to let the radio know that the setup command needs to be updated at the next radio power up. 

    RF_control(handle, RF_CTRL_UPDATE_SETUP_CMD, 0);

    3. Then perform RF_yield(). This should power down the radio. 

    4. Then schedule your TX command. Now, the radio will wake up and then transmit with the new frequency you need. Once the above sequence is performed the radio will have this new settings even between the sleeps until you change the settings again.

    Hope this helps.

    Regards,

    Sid

     

     

  • Hi Sid,

    Thanks for your reply. Is there a step limit for the frequency to be set, or can it be set freely within the range allowed by frequency and fractFreq?

    In addition, for the long range mode of 433M, its default frequency is 433.9203M while those for other modes are 433M. Does this frequency have special indications?

    Regards,

    Katherine

  • Hi Sid,

    Thanks for your reply. Is there a step limit for the frequency to be set, or can it be set freely within the range allowed by frequency and fractFreq?

    In addition, for the long range mode of 433M, its default frequency is 433.9203M while those for other modes are 433M. Does this frequency have special indications?

    Regards,

    Katherine

  • Hi Katherine, 

    I will notify our RF experts. They will get back to you soon. 

    Regards,
    Sid

  • Hi Sid,

    Are there any updates on my issue?

    Regards,

    Katherine

  • could you share the code you wrote?

  • - The frequency has to be set within the bands defined in 8.9 RF Frequency Bands" in the datasheet. The frequency can be set freely within the bands. This is from a radio perspective. For practical usage you have to check the regulations for the country(s) you want to operate in and find which frequencies you are allowed to use (etc).  433.92 MHz is a typical frequency in this band, if you look at a lot or garage openers etc you will see that they use this frequency. 

    - The VCO has finite resolution, see https://e2e.ti.com/support/wireless-connectivity/sub-1-ghz-group/sub-1-ghz/f/sub-1-ghz-forum/792488/cc1310-frequency-resolution-of-the-modulator

    Can't remember if the the CC1312R has a different resolution or not but it gives you an indication. Also see www.ti.com/.../swra682.pdf