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.

TM4C1290NCPDT: Full width TIMER_CFG_PERIODIC used to toggle a CCP0 output pin

Part Number: TM4C1290NCPDT

See original thread: e2e.ti.com/.../471743

This issue still hasn't been fixed in TivaWare_C_Series-2.1.4.178 though the original thread is closed.

I want to use a full width 32 bit timer in periodic mode to toggle a CCP0 pin:
TimerConfigure(TIMER2_BASE, TIMER_CFG_PERIODIC | TIMER_CFG_A_ACT_TOGGLE);

timer.h:
#define TIMER_CFG_PERIODIC 0x00000022 // Full-width periodic timer
#define TIMER_CFG_SPLIT_PAIR 0x04000000 // Two half-width timers
#define TIMER_CFG_A_ACT_TOGGLE 0x00020000 // Timer A compare action toggle.

In TimerConfigure(), the following assert will not allow any other config bit to be set if TIMER_CFG_PERIODIC is selected. It works fine without the assert.
ASSERT(
(ui32Config == TIMER_CFG_ONE_SHOT) ||
(ui32Config == TIMER_CFG_ONE_SHOT_UP) ||
(ui32Config == TIMER_CFG_PERIODIC) ||
(ui32Config == TIMER_CFG_PERIODIC_UP) ||
(ui32Config == TIMER_CFG_RTC) ||
((ui32Config & 0xff000000) == TIMER_CFG_SPLIT_PAIR));

This doesn't look correct. But if it is correct: how is TimerConfigure() supposed to be used to get a full width 32 bit timer in periodic mode to toggle a CCP0 pin?

  • Sorry, it sure looks like we dropped the ball on this one. To properly allow the time out pin functions when the timer is used in full width mode, I think that lines 354-359 of timer.c (version 2.1.4.178) should be changed from:

        ASSERT((ui32Config == TIMER_CFG_ONE_SHOT) ||
               (ui32Config == TIMER_CFG_ONE_SHOT_UP) ||
               (ui32Config == TIMER_CFG_PERIODIC) ||
               (ui32Config == TIMER_CFG_PERIODIC_UP) ||
               (ui32Config == TIMER_CFG_RTC) ||
               ((ui32Config & 0xff000000) == TIMER_CFG_SPLIT_PAIR));
    

    to:

        ASSERT(((ui32Config & 0xfff0ffff) == TIMER_CFG_ONE_SHOT) ||
               ((ui32Config & 0xfff0ffff) == TIMER_CFG_ONE_SHOT_UP) ||
               ((ui32Config & 0xfff0ffff) == TIMER_CFG_PERIODIC) ||
               ((ui32Config & 0xfff0ffff) == TIMER_CFG_PERIODIC_UP) ||
               ((ui32Config & 0xfff0ffff) == TIMER_CFG_RTC) ||
               ((ui32Config & 0xff000000) == TIMER_CFG_SPLIT_PAIR));
    

    I am working with the team on trying to get a TivaWare patch release out. I am logging this into our bug tracking system now.