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.

SIMPLELINK-CC13X2-26X2-SDK: Timer reconfiguration on runtime

Part Number: SIMPLELINK-CC13X2-26X2-SDK

I am using a split GPT timer in my product. On startup it is configured as follows:

    TimerConfigure(GPT2_BASE, TIMER_CFG_A_CAP_TIME | TIMER_CFG_B_CAP_TIME | TIMER_CFG_SPLIT_PAIR);
    TimerEventControl(GPT2_BASE, TIMER_BOTH, TIMER_EVENT_BOTH_EDGES);
    TimerPrescaleSet(GPT2_BASE, TIMER_BOTH, 0xFF);
    TimerLoadSet(GPT2_BASE, TIMER_BOTH, 0xFFFF);

    IOCPortConfigureSet(CHANNEL_DIO_C0, IOC_PORT_MCU_PORT_EVENT4, IOC_STD_INPUT);
    EventRegister(EVENT_O_GPT2ACAPTSEL, EVENT_GPT2ACAPTSEL_EV_PORT_EVENT4);
    IOCPortConfigureSet(CHANNEL_DIO_C1, IOC_PORT_MCU_PORT_EVENT5, IOC_STD_INPUT);
    EventRegister(EVENT_O_GPT2BCAPTSEL, EVENT_GPT2BCAPTSEL_EV_PORT_EVENT5);

    TimerIntEnable(GPT2_BASE, TIMER_CAPA_EVENT | TIMER_CAPB_EVENT);
    TimerEnable(GPT2_BASE, TIMER_BOTH);

At some point in my application I need to reconfigure the TIMER_A to stop capturing and instead running in compare mode.
After x ms timeout it should pull the pin high for x ms.
How can I reconfigure the timer at runtime using the Timer API?

  • Please provide information regarding which device you are using.

    Siri

  • I am using CC1352P1F3

  • We strongly recommend to use the TI drivers (not driverlib) when developing your code.

    Please see the documentation for the GPTimer Driver here:

    GPTimerCC26XX.h File Reference

    Siri

  • Why do you recommend the TI drivers?

  • First of all, I realized that there is a driver called Timer driver as well, where we have code examples for in the SDK.

    Timer.h File Reference

    While the driverLib is a set of low-level drivers for accessing the registers found on the CC13xx/CC26xx device, TI-Drivers is a collective of peripheral drivers for TI's SimpleLink portfolio. The drivers are centered around a portable application programming interface (API) which enables seamless migration across the SimpleLink SDK portfolio.

    The TI Drivers is a wrap over driverlib. It is essentially an extra layer in order to create easier code portability across SimpleLink platform devices.   

    When using the drivers, you do not need to know all the details of every peripheral, and keep track of which registers to set and clear, what power domains to turn on/off etc.

    When using the drivers you will run on known goes SW that has been tested, and that when used together with the power driver will ensure the lowest power consumption.

    From a SW perspective, we support the TI drivers, and will not be able to debug customer code or give examples using driverlib unless we suspect that there are bugs in driverlib.

  • The Timer.h you mentioned is not suitable as it states that it does not support capturing.
    I will look into the GPTimerCC26XX driver.

    Thank you