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.

Timer_B Interrupt

Other Parts Discussed in Thread: SYSBIOS

Good day,

I want with Timer2, the Timer_B throws me a hardware interrupt.

The code is simple:

    SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER2);

    TimerClockSourceSet(TIMER2_BASE, TIMER_CLOCK_SYSTEM);
    TimerConfigure(TIMER2_BASE, TIMER_CFG_B_PERIODIC);
    TimerLoadSet(TIMER2_BASE, TIMER_B, 0xFF);

    TimerIntEnable(TIMER2_BASE, TIMER_TIMB_TIMEOUT);
    IntEnable(INT_TIMER2B);
    IntMasterEnable();

    TimerEnable(TIMER2_BASE, TIMER_B);

and in .cfg file I created a hardware interrupt having number 40:

var hwi0Params = new Hwi.Params();
hwi0Params.instance.name = "hwiTimer2";
hwi0Params.maskSetting = xdc.module("ti.sysbios.interfaces.IHwi").MaskingOption_ALL;
hwi0Params.arg = 0;
Program.global.hwiTimer2 = Hwi.create(40, "&hwiTimer2Fxn", hwi0Params);

because in file tm4c1294ncpd.h:

#define INT_TIMER2B             40          // 16/32-Bit Timer 2B

the hardware interrupt function:

extern "C" void hwiTimer2Fxn(void)
{
    TimerIntClear(TIMER2_BASE, TIMER_TIMB_TIMEOUT);

    Swi_post(swiTimer2);
}

But I never get the interrupt.

Can you tell me what is wrong with this code?

And like an additional information if I am changing the TIMER_B to TIMER_A and interrupt number to 39 it is working well.

Thanks

Horea