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.

TMS320F28069: Using timer1 interrupts with HAL

Part Number: TMS320F28069
Other Parts Discussed in Thread: MOTORWARE

Hello,

In the "motorware_hal_tutorial.pdf"  there's a nice example on how to toggle a LED on timer0 interrupt, however no information is given on what parameters to change for timer1 interrupt.

I'm especially worried about PIE_enableTimer1Int(*) function. That's how it looks like for Timer0:

void PIE_enableTimer0Int(PIE_Handle pieHandle)
{
    PIE_Obj *pie = (PIE_Obj *)pieHandle;

    // set the value
    pie->PIEIER_PIEIFR[0].IER |= PIE_IERx_INTx7_BITS;

    return;
} // end of PIE_enableTimer0Int() function

But what bits to set for Timer1?

Another question regards "HAL_enableTimer0Int" function. "CPU_IntNumber_1" is used for TINT0, what about TINT1?

And then acknowledgement. Are both interrupts in PIE_GroupNumber_1 or is there a difference?

  • Jakub

    If you look at table 1-120 (page 177) of this document (www.ti.com/.../spruh18g.pdf), you'll see that TINT1 and TINT2 get mapped "outside" of the PIE Mux'd Vector table. They are available as CPU INT13 and INT14. The correct function call here would be

    CPU_enableInt(cpuHandle, intNumber)

    with intNumber set to INT13 (type enum is CPU_IntNumber_13) for Timer 1 interrupt.

    Also, to clear up some confusion, Timer0 interrupt (TINT0) is in PIE Group 1, Interrupt number 7 (PIE1.7). The PIEIER_PIEIFR[] index will be the group number (array entry 0 == group 1 for TINT0), and the logical OR value is the individual interrupt number

    Hope that clears things up a bit

    Sean