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.

EK-TM4C123GXL: Create a countdown timer

Part Number: EK-TM4C123GXL

Hello,

I'm struggling to attempt to create a countdown timer. I'm pretty sure I need to use TimerEnable and TimerConfigure functions.

  • Hello Bernard,

    I would recommend you review our timer examples in TivaWare located at [Install Path]\TivaWare_C_Series-2.1.4.178\examples\peripherals\timer

    If you need the timer to run only once, look at oneshot_16bit.c, but if you need the down counter to continuously run then look at periodic_16bit.c

    Note that you have configuration options such as TIMER_CFG_A_PERIODIC and TIMER_CFG_A_PERIODIC_UP, as the _UP name implies, TIMER_CFG_A_PERIODIC_UP is an up counter, and thus while it's not explicitly stated, TIMER_CFG_A_PERIODIC is the down counter setting. The same applies for ONE_SHOT.

    If that isn't enough to get your timer running then you should share what code you've written and we can provide further feedback.