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.

Piccolo timer interrupt outside sys/bios

Dear support,

we have application that work with sys/bios(6.33.3.33, xdctools 3.23.4.60) and have to enable timer interrupt each 50 microsec. is it possible to enable timer interrupt(hwi 14)  ouside of sys/bios?

The following code doesn't enable interrupt:
{...
InitCpuTimers();
ConfigCpuTimer(&CpuTimer1, 80, 10);
Hwi_plug(14,MMTimerIsr1);
IER |= 0x1;
...
BIOS_start();
}
Does TI provide any example of timer interrupt otside of sys/bios?

Thanks,Sabina

  • Sabina,

    'IER |= 1' will enable interrupt 1.

    To be safe, use Hwi_enableInterrupt(14);

    For interrupts handled outside of SYS/BIOS you must use the 'interrupt' keyword in the function definition:
        interrupt Void MMTimerIsr1()
        {
        }

    Furthermore, the interrupt handler SHOULD NOT CALL ANY SYS/BIOS APIs since it will not be invoked within the proper context.

    Alan

  • Hi Alan,

    Thanks, it work now!
    I use the following interrupt:

    interrupt void MMTimerIsr1()
    {
     GpioDataRegs.GPBTOGGLE.bit.GPIO34 = 1;
     CpuTimer1.InterruptCount++;
        // Acknowledge this interrupt to receive more interrupts from group 1
      PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;
    }

    Does 'PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;' is correct or exist another more safely command?

    Thanks,Sabina

  • Sabina,

    Sorry for the long delay.

    I'm not very familiar with the proper way to acknowledge a PIE interrupt so I did some googling on the topic and your code seems consistent with the various examples I saw.

    Alan