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: How to change WDT clock source

Part Number: CC1310
Other Parts Discussed in Thread: SMARTRF06EBK,

Tool/software: TI-RTOS

HI

There was a no problem to run the CC1310 with the JTAG debugger SmartRF06EBK.

WDT clock was expected 1.50MHz.

But without JTAG debugger, WDT clock was around 2KHz.

How do I change WDT clock to 1.50MHz.

Best regards,

Yama

  • Hi Yama,

    Are your device using low power modes? The watchdog timer will only run when the device is active; when going into standby mode, the watchdog clock will stop counting. This could be interpreted as the watchdog clock being "slower" while in reality, it simply stops counting when in standby.

    The Watchdog timer clock source (or frequency) should not change depending on you using a debugger or not, using the debugger can however keep your device out of true standby.
  • Hi M-W
    I don't use low power modes.
    I write the program below. I use only one task.

    __________________________________________________
    Watchdog_Handle watchdogHandle;
    volatile bool watchdogExpired;

    void watchdogCallback(uintptr_t unused)
    {
    Watchdog_clear(watchdogHandle); /* Clear watchdog interrupt flag */
    watchdogExpired = true;
    }

    int main(void)
    {
    Board_initGeneral();
    Board_initUART();
    Board_initWatchdog();
    Board_initGPIO();
    Board_initSPI();
    dbgCnsl_open();

    Watchdog_Params params;
    Watchdog_init();
    Watchdog_Params_init(&params);
    params.callbackFxn = (Watchdog_Callback)watchdogCallback; /*!< Pointer to callback. Not supported on all targets. */
    params.resetMode = Watchdog_RESET_ON; /*!< Mode to enable resets. Not supported on all targets. */
    params.debugStallMode = Watchdog_DEBUG_STALL_ON; /*!< Mode to stall WDT at breakpoints. Not supported on all targets. */
    watchdogHandle = Watchdog_open(Board_WATCHDOG0, &params);

    Error_Block eb;
    Error_init(&eb);

    Task_Params_init(&u_task_params);
    u_task_params.stackSize = MAIN_TASK_STACK_SIZE;
    u_task_params.priority = MAIN_TASK_PRIORITY;
    u_task_params.stack = &u_task_stack;
    Task_construct(&u_task, MainCtrl_task, &u_task_params, &eb);

    BIOS_start();
    return 0;
    }

    void MainCtrl_task(UArg arg0, UArg arg1)
    {
    dbgCnsl_puts(PfStdout, "Main St\n");

    for (int i=0; i<(40*60); ++i)
    {
    dbgCnsl_printf(PfStdout, "%d\n", WatchdogValueGet());
    Task_sleep(100000); // 1sec
    }
    ...........
    }
    -------------------------------------------------------------------


    Result with SmartRF06EBK is
    __________________________________________________
    Main St
    89999660
    88493518
    86987527
    85481341
    83975356
    ...........
    -------------------------------------------------------------------
    89999660 - 88493518 = 1506142 : 1.5MHz


    Result without SmartRF06EBK is
    __________________________________________________
    Main St
    89999659
    89862683
    89861906
    89861129
    89860351
    ...........
    -------------------------------------------------------------------
    89999659 - 89862683 = 136976
    89862683 - 89861906 = 777
    89861906 - 89861129 = 777
    The result of this time is from 777Hz to 136976Hz.

    How can I change the above program?
  • As you do not set any constraints from what I can see, I would expect your device to go into standby during your "Task_sleep(100000)" call. 

    You can test to set a power constraint to keep the device out of standby and see if it makes a difference:

    #include <ti/drivers/Power.h>

    #include <ti/drivers/power/PowerCC26XX.h>

    Power_setConstraint(PowerCC26XX_DISALLOW_STANDBY);

  • When i add "Power_setConstraint(PowerCC26XX_SB_DISALLOW);", WDT clock reached 1.5MHz.

    So my program seems to be low power modes.

    Thank you.