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.

LP-CC1352P7: How to change the frequency and transmit power, radio Rx bandwidth and data rate in software and during the run-time?

Part Number: LP-CC1352P7

Tool/software:

Hello my friends,

I was wondering if it is possible to change the transmit power, frequency, data rate, and Rx filter bandwidth on the fly, I mean dynamically during the run-time? If so, could you please tell me how I can do that?


Thanks.

  • Thanks Theo for your answer, but still I do not know if it is possible to change the data rate and consequently the Rx filter bandwidth during the run time. 

  • Hi Omid,

    yes this is possible. When you change the radio parameters you are basically changing the phy. 

    The implementation that I would recommend you is to close the radio driver 'RF_close(RF_Handle h)' and then to open it again with a new setup command as parameter. You can find examples on how the driver is opened in our prop rf examples and the documentation of the APIs can be found here: https://dev.ti.com/tirex/explore/node?node=A__AIW3BFKR-3ew-wxtbzaH-A__com.ti.SIMPLELINK_CC13XX_CC26XX_SDK__BSEc4rl__LATEST

    If you don't want to close and reopen the driver please have a look at this thread: https://e2e.ti.com/support/wireless-connectivity/sub-1-ghz-group/sub-1-ghz/f/sub-1-ghz-forum/1388789/cc1352p7-waking-up-radio-after-updating-settings

    If you change between the phys at runtime you should also activate the multi protocol patch (rf_patch_cpe_multi_protocol) in .syscfg -> custom -> custom phy setting -> code export -> rf patches -> CPE Patch.

    Please let me know if you could implement it.

    Kind regards,
    Theo


  • Thanks Leo, I went over the API documentation and found a data structure that is called rfc_CMD_PROP_RADIO_SETUP_s.  This data structure seems to be the one holding the radio settings in the properitery mode. However, I am still not sure what function to use to update the settings. Is it just manipulating the data structure's elements? what do you mean by "new setup command as parameter", what function is used to post a set up command?

    Could you just give me simple example for posting a set up command with updated settings, for example for the data rate.

  • Hi Omid,

    when you look in the rfEchoTx example for your board then you will see in mainThread() in rfEchoTx.c the configuration of the radio with the initialization of the RF params, the customization with RF_cmdPropTx and RF_cmdPropRx commands and then opening the radio and starting the operation. With the function 'RF_close(RF_Handle h)' you can clod the radio again. Then you would perform your adjustment by creating new parameters and opening a new handle and yuo have a different radio setup running.

    Let me know if this example code helps you.

    Kind regards,
    Theo

  • Thanks, but here is the structure of RF_params:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    typedef struct {
    uint32_t nInactivityTimeout; ///< Inactivity timeout in microseconds.
    ///< The default value is 0xFFFFFFFF (infinite).
    uint32_t nPowerUpDuration; ///< A custom power-up duration in microseconds.
    ///< If 0, the RF driver will start with a conservative value and measure the actual time during the first power-up.
    ///< The default value is 0.
    RF_Callback pPowerCb; ///< \deprecated Power up callback, will be removed future versions, see RF_Params::pClienteventCb instead.
    ///< The default value is NULL.
    RF_Callback pErrCb; ///< \deprecated Callback function for driver error events.
    uint16_t nPowerUpDurationMargin; ///< An additional safety margin to be added to #RF_Params::nPowerUpDuration.
    ///< This is necessary because of other hardware and software interrupts
    ///< preempting the RF driver interrupt handlers and state machine.
    ///< The default value is platform-dependent.
    uint16_t nPhySwitchingDurationMargin; ///< An additional safety margin to be used to calculate when conflicts shall be evaluated run-time.
    RF_ClientCallback pClientEventCb; ///< Callback function for client-related events.
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


    I do not see any parameter regarding transmit power, data rate, frequency, rx bandwidth whatsoever in RF_Prams.

    The question is how to do "Then you would perform your adjustment by creating new parameters" part specifically.

    what I am simply asking is where and how I should change the aforementioned physical-layer parameters.
    Could you please just write 4 lines of codes that just uses the required APIs and data-structures.

  • Hi Omid,

    if you check the thread that I linked previously and look at the second answer from Siri: https://e2e.ti.com/support/wireless-connectivity/sub-1-ghz-group/sub-1-ghz/f/sub-1-ghz-forum/1388789/cc1352p7-waking-up-radio-after-updating-settings you'll see a code example where center frequency and tx power are changed on the fly without closing the radio driver.

    Please go again through the documentation of our radio driver: https://dev.ti.com/tirex/content/simplelink_cc13x0_sdk_2_40_00_20/docs/tidrivers/doxygen/html/_r_f_8h.html It explains the different parts of the open command and other command options. I'm sorry for the confusion about the params. I was referring to the radio parameters that you want to change which are part of the radio setup. The data structures that you need to adjust are defined in ti_radio_config.h (RF_cmdPropRadioDivSetup, RF_cmdPropTx, RF_cmdPropRx) and you can change them in code before opening the radio driver. You can see it also in the code example as some parameters are changed before opening the driver. This is why I told you it is the easiest way to close the driver, modify the structures and open it again. 

    Kind regards,
    Theo