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.

WTimer capture - edge time mode and timeout interrupt

Other Parts Discussed in Thread: TM4C123GH6PGE

I'm using WTimer4A on a Tiva TM4C123GH6PGE in capture mode, input edge-time mode.
But I also need an interrupt on that timer timeout, so I've configured WTIMER4A in the following way:

    // Configure and enable  WTimer4A; period = 100 Hz --> 10msec.
    TimerConfigure(WTIMER4_BASE, TIMER_CFG_SPLIT_PAIR | TIMER_CFG_A_CAP_TIME_UP);
    TimerLoadSet(WTIMER4_BASE, TIMER_A, (SysCtlClockGet() / 100));
    TimerIntEnable(WTIMER4_BASE, (TIMER_TIMA_TIMEOUT | TIMER_CAPA_EVENT );
    IntEnable(INT_WTIMER4A);
    TimerEnable(WTIMER4_BASE, TIMER_A);

The capture event interrupt is correctly triggered, but not the 10 ms timeout interrupt.

Timeout interrupt is triggered  changing the configuration:

TimerConfigure(WTIMER4_BASE, TIMER_CFG_SPLIT_PAIR | TIMER_CFG_A_PERIODIC_UP);

loosing the capture event.
Is there something wrong in my configuration, or the TM4C123GH6PGE cant have both.

Any suggestion is appreciated.
Regards,

Claudio

  • Hi Claudio,

    Since you are using SPLIT mode, the WTIMER is effectively 2x32-bit timers. You can enable Timer A in edge time mode and Timer-B in Periodic mode with separate interrupt handlers.

    As per the datasheet the Timeout is triggered one-shot or periodic mode and not in event modes.

    Also since you have to time the two together, it would be advisable that the TimerEnable be set for both

    TimerEnable(WTIMER4_BASE, (TIMER_A|TIMER_B));

    Amit

  • Amit,
    now it works as expected.
    Thank you for your quick reply.

    Regards,

    Claudio