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.

TMS320F280039C: How to implement F280039 tripzone interrupt

Part Number: TMS320F280039C
Other Parts Discussed in Thread: C2000WARE

I have a program (for F280039C) that has 3 interrupt routines. 

Timer1 interrupt in 100KHz (generating tripzone signals low 10us every 1ms)
PWM1 interrupt in 10KHz (simply set PWM duty cycle)
PWM tripzone interrupt in cycle by cycle

When I run this program, the program only enters tripzone interrupt again and again but doesn't enter the other interrupt routines.

I have writen a similar program in F280049, it works fine.

Here is the code in tripzone interrupt routine:

interrupt void Task_2()
{
 
    IER &= 1;
    asm(" nop;");
    EINT;
    CPU_PIEACK |= 2;
    PieCtrlRegs.PIEACK.all = 2;
    ...
    EALLOW;
    EPwmRegs.TZCLR.all = 3;   // clear TZCLR.CBC and TZCLR.INT
    EDIS;
}


Is there a sample program that performs the same fuction?

  • Hi Jiakai,

    Are you trying to implement interrupt nesting? Do you want to have the PWM1 and Timer1 interrupts nest inside this one if they are flagged during the ISR execution? If so, you will want to follow the order of the code steps shown in C28x Interrupt Nesting to implement this properly. We also have an example in the SDK showing this: [C2000ware install]/driverlib/f28003x/examples/interrupt/interrupt_ex3_sw_prioritization.

    Best Regards,

    Delaney

  • Hi Delaney,

    I may ask you about nesting interrupt in another post.

    I want an example that shows me the way to avoid the reentering of tripzone interrupt in a PWM period.

    My issue is when tripzone interruption keeps reentering, the other interruption routines have no time to execute.

    Thanks

  • Hi Jiakai,

    If you use the code steps shown in C28x Interrupt Nesting, the trip zone ISR should be disabled once entered the first time. This means only the PWM1 and Timer1 interrupts can actually nest inside. This line is what enabled only other higher priority interrupts inside the group:

    Best Regards,

    Delaney

  • Sorry for the late replay.

    The issue has been fixed.

    I need to put a code segment in normal PWM timely interrupt (not the PWM tripzone interrupt) as interrupt return code.

        EALLOW;
        EPwmRegs.TZCLR.all = 3;   // clear TZCLR.CBC and TZCLR.INT
        EDIS;

    My issue is I put this code segment as PWM tripzone interrupt return code.

    Thanks.