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: CC1310 beginner questions

Part Number: CC1310


Hello!

I'am planning to use CC1310 for the new device.
I have a similar question around CC1310 Sub-1 GHz Ultra-Low Power Wireless Microcontroller.
1) Is it possible to use one of the internal Timers for external frequency counting? Freq = 50...600Hz

Will Timer work in Shutdown mode? And if NO, Why? I'm clocking Timer from external freq.

Which of GPIO pins i will use as Timer CountPin?

2) Is it possible to use internal RTC to wake up CPU from Standby every 250mS for 2-3mS Active mode


3) In CC1310 datasheet I found following:

The Brown Out Detector is disabled between recharge periods in STANDBY. Lowering the supply voltage below the BOD threshold
between two recharge periods while in STANDBY may cause the BOD to lock the device upon wakeup until a Reset/POR releases it.

Is the WDT timer will solve this problem or it will Hang too untill RESET?
What is WDT power consuption?


Thanks a lot.

Alex

  • Hi,

    alex post said:
    1) Is it possible to use one of the internal Timers for external frequency counting? Freq = 50...600Hz

    Yes. You could use the edge detection feature of the general purpose timer. There is no high-level driver in the SDK for that, but you can implement that in your application:

        #include <ti/sysbios/hal/Hwi.h>
        #include <driverlib/timer.h>
        #include <ti/drivers/power/PowerCC26XX.h>
        #include <ti/drivers/pin/PINCC26XX.h>
    
        /* Set up a hardware interrupt for the general purpose timer. You will need to define a Hwi_Struct decodeEdgeHwi */
        Hwi_Params hwiParams;
        Hwi_Params_init(&hwiParams);
        hwiParams.arg = (UArg)handle;
        hwiParams.enableInt = true;
        Hwi_construct(&decodeEdgeHwi, INT_GPT0A, &handleEdgeTimerHwi, &hwiParams, NULL);
    
        /* Enable GPT for edge detection */
        Power_setDependency(PowerCC26XX_PERIPH_GPT0); // Turn on PERIPH power domain and clock for GPT0
        Power_setConstraint(PowerCC26XX_SB_DISALLOW ); // while the timer is running, we can't power down the perph domain.
    
        TimerConfigure(GPT0_BASE, TIMER_CFG_SPLIT_PAIR | TIMER_CFG_A_CAP_TIME_UP);
        TimerEventControl(GPT0_BASE, TIMER_A, TIMER_EVENT_NEG_EDGE);
        TimerIntEnable(GPT0_BASE, TIMER_CAPA_EVENT);
    
        /* Route a button PIN to the GPT0A event input */
        PINCC26XX_setMux(pinHandle, Board_BUTTON0, IOC_PORT_MCU_PORT_EVENT0);
    
        /* Finally enable the timer */
        TimerEnable(GPT0_BASE, TIMER_A);

    The interrupt handler:

    void handleEdgeTimerHwi(UArg arg)
    {
        /* Clear the timer interrupt. Otherwise it will occur immediately again */
        TimerIntClear(GPT0_BASE, TIMER_CAPA_EVENT);
    
        /* Read the timer value. There is no driverlib function for that */
        uint32_t capturedTimerValue = HWREG(GPT0_BASE + GPT_O_TAR);
    }

    I've hacked this code quickly together from another project. I hope it helps and you will be able to make it work with little effort.

    alex post said:
    Will Timer work in Shutdown mode? And if NO, Why? I'm clocking Timer from external freq.

    The general purpose timer can only run in IDLE mode. Not in standby and not in shutdown. This is because the general purpose timer is not in the "always on" power domain. Nothing is activated in shutdown, only simple edge interrupts and even then they would just cause a reset.

    alex post said:
    Which of GPIO pins i will use as Timer CountPin?

    You can route any pin to the general purpose timer. See code above.

    alex post said:
    2) Is it possible to use internal RTC to wake up CPU from Standby every 250mS for 2-3mS Active mode

    Yes. This is natively supported in TI-RTOS. This is the easiest way:

    #include <ti/sysbios/knl/Clock.h>
    #include <ti/sysbios/knl/Task.h>
    
    for (;;) {
        // Do something short
        // ...
        // Sleep for X milliseconds (goes to standby if possible)
        Task_sleep(250000 / Clock_tickPeriod);
    }

    If you need very accurate wake-ups, use the Clock module instead. You may also look into the TI-RTOS kernel user guide.