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/CC2642R: How to set counter timer

Part Number: CC2642R

Tool/software: TI-RTOS

Hello,

Im using CC26x2 MCU with SDK 2.10.0.44.

In my project I should connect sensor of gas rate and the data output given by pulse. IO want to count that pulse.

I want to connect the output line of the sensor to DIO and connect the DIO as timer input. By that I will get the tick every 1 sec.

Can anyone guide me how to configure timer, set the timer clock (input) as DIO ? and how to get the ticks ?

How can i set GPTM ??

Thanks!

  • Hi Ohad,

    Have you tried using the GPTimer driver?

    dev.ti.com/.../_g_p_timer_c_c26_x_x_8h.html

    It supports the "GPT_MODE_EDGE_COUNT_UP" mode which should be what you are looking for. There is also a small example for how the driver is used and how to select mode.

    When using this driver for this you also want to use "GPTimerCC26XX_setCaptureEdge" to set the edge you want to capture and manually connect the DIO to the Timer as such:

    GPTimerCC26XX_PinMux pinMux = GPTimerCC26XX_getPinMux(timerHandle);
    PINCC26XX_setMux(yourPinHandle, YOUR_DIO, pinMux);