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.

TM4C1231H6PZ: No (Timer) Interrupts

Part Number: TM4C1231H6PZ

Hello,

we have an custom board with an TM4C1231.

The Problem is, that we can't see any interrupt ....

We have reduced the code to

://*****************************************************************************
//
// The interrupt handler for the Timer0B interrupt.
//
//*****************************************************************************
void
Timer0BIntHandler(void)
{
    //
    // Clear the timer interrupt flag.
    //
    TimerIntClear(TIMER0_BASE, TIMER_TIMB_TIMEOUT);

    g_ui32Counter++;


}

//*****************************************************************************
//
// Configure Timer0B as a 16-bit periodic counter with an interrupt
// every 1ms.
//
//*****************************************************************************
int
main(void)
{

    uint32_t ui32PrevCount = 0;

    SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ);


    SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER0);
    TimerConfigure(TIMER0_BASE, TIMER_CFG_SPLIT_PAIR | TIMER_CFG_B_PERIODIC);
    TimerLoadSet(TIMER0_BASE, TIMER_B, SysCtlClockGet() / 1000);
    IntMasterEnable();
    TimerIntEnable(TIMER0_BASE, TIMER_TIMB_TIMEOUT);
    IntEnable(INT_TIMER0B);
    TimerEnable(TIMER0_BASE, TIMER_B);

    //
    // Loop forever while the Timer0B runs.
    //
    while(1)
    {

    }
}

If i place an breakpoint in the int handler, the int was never fired.

In the Register i can see, that the counter will count.

In the startup file i add :

 Timer0BIntHandler,                      // Timer 0 subtimer B

Can a hardware problem cause this behavior ?

Any Suggestions?

Andreas

  • Hello Andreas,

    I suspect the interrupt is firing, but your g_ui32Counter is not updating.

    Have you declared g_ui32Counter as a volatile like this?

    volatile uint32_t g_ui32Counter++;

    Best Regards,

    Ralph Jacobi

  • Hi Ralph,

    no that is not the Problem,

    I have done "run to " and set Breakpoint with the Debugger.

    The interrupt service routine was never reached.

    I have the same problem with the systick timer.

    I have a global interrupt problem, i think.

    Or maybe a problem with the Hardware?

    Andreas

  • Hello Andreas,

    So you can confirm you have it set as volatile? Compilers can optimize code out and then breakpoints won't trigger.

    The code looked fine but I can run it on my EVM on Tuesday to verify. Delay is due to US holidays.

    Best Regards,
    Ralph Jacobi

  • Hi Ralph,

    yes i can confirm ...

    It is from the example :

    C:\ti\TivaWare_C_Series-2.2.0.295\examples\peripherals\timer

    I strip it down to the minimal possible version to figure out the problem.

    So maybe something is wrong with my project, or Hardware.

    I haven't found any example for the TM4C1231 ...

    //*****************************************************************************
    //
    // Counter to count the number of interrupts that have been called.
    //
    //*****************************************************************************
    static volatile uint32_t g_ui32Counter = 0;

  • Hi Ralph,

    i solved my Problem ...

    It was a hardware issue.

    In the schematic Tiva TM4C123G LaunchPad  the Port PF0 was only named

    PF0 and not  "PF0/NMI".

    I have take the schematic for my own design, and i wanted to use the Pin as PWM Out.

    A resitor pulled this Port low ....

    Andreas