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.

TMS320F280025: TMS32F280025

Part Number: TMS320F280025

Hi

There are 3 ISR functions and I call it as A/B/C in my project. Their toggle source is different and timing is random. However A should have a high priority than B and C. I would like to know that how to set A with high priority, no matter B and C is running.

FYI. I am using driverlib

BR

HK Woo

  • Hi HK Woo,

      

    Thanks for your question. Please see the following nesting guide, it will walk you through both (1) custom prioritization of interrupts and (2) nesting of interrupts:

    https://software-dl.ti.com/C2000/docs/c28x_interrupt_nesting/html/index.html

      

    There is also a SW example in driverlib for this under the interrupts folder (interrupts_ex1_sw_prioritization)

      

    Regards,

    Vince

  • Thanks for your information. I went over the demo code but I still do not understand that which ISR is most high priority.

  • Hi HK Woo,

    Please review the "driverlib\f28002x\examples\interrupt\sw_prioritized_isr_levels.h" file from the example code. This allows you to write the priority you want for each interrupt. It is fully explained in the comments.

    Regards,

    Vince

  • Sorry....I still don't understand after review the h file. I don't see any code in c refer to this h file. Actually, I  want EPWM1 is in high priority. It runs @ 300K Hz. There is other EPWM2 running @ 586Hz. They acts as timer. I don't know their interrupt belong to which interrupt group.

    My idea is that no matter the code in EPWM2 ISR is running, it is necessary to run the EPWM1 ISR immediately once the interrupt is generated by EPWM1

    Below is my code in ISR for EPWM2

        uint16_t TempPIEIER;
        TempPIEIER = PieCtrlRegs.PIEIER2.all;
        IER |= M_INT1;
        IER &= MINT1;                         // Set "global" priority
        PieCtrlRegs.PIEIER2.all &= MG1_1;     // Set "group" priority
        PieCtrlRegs.PIEACK.all = 0xFFFF;      // Enable PIE interrupts
        asm("       NOP");                    // Wait one cycle
        EINT;    

        my code

        Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP3);


        DINT;

        HWREGH(PIECTRL_BASE + PIE_O_IER2) = TempPIEIER;

    I was using above code in EPWM2 ISR for nesting. In EPWM1 ISR. I toggle a debug pin in EPWM1 ISR to monitor it is running in 300K Hz or not. It is found that the pulse width longer the 3.3us sometime e.g. 4.0us. Is seem that nesting does not work in my EPWM2 ISR code.

  • From interrupt_ex3_sw_prioritiztion.c

    //! For most applications, the hardware prioritizing of the interrupts is
    //! sufficient. For applications that need custom prioritizing, this example
    //! illustrates how this can be done through software.User specific priorities
    //! can be configured in sw_prioritized_isr_level.h header file.

    From sw_prioritized_isr_levels.h

    //
    // Set "Global" Interrupt Priority Level (IER register):
    //
    // The user must set the appropriate priority level for each of the CPU
    // interrupts. This is termed as the "global" priority. The priority level
    // must be a number between 1 (highest) to 16 (lowest). A value of 0 must
    // be entered for reserved interrupts or interrupts that are not used.
    //
    // Note: The priority levels below are used to calculate the IER register
    //       interrupt masks MINT1 to MINT16.
    //
    // Note: The priority levels shown here may not make sense in a
    //       real application.  This is for demonstration purposes only!!!
    //
    //       The user should change these to values that make sense for
    //       their application.
    //
    // 0  = not used
    // 1  = highest priority
    // ...
    // 16 = lowest priority
    //
    #define INT1PL      16       // Global Priority for Group1 Interrupts
    #define INT2PL      0        // Global Priority for Group2 Interrupts
    #define INT3PL      0        // Global Priority for Group3 Interrupts
    #define INT4PL      0        // Global Priority for Group4 Interrupts
    #define INT5PL      0        // Global Priority for Group5 Interrupts
    #define INT6PL      0        // Global Priority for Group6 Interrupts
    #define INT7PL      0        // Global Priority for Group7 Interrupts
    #define INT8PL      0        // Global Priority for Group8 Interrupts
    #define INT9PL      0        // Global Priority for Group9 Interrupts
    #define INT10PL     0        // Global Priority for Group10 Interrupts
    #define INT11PL     0        // Global Priority for Group11 Interrupts
    #define INT12PL     0        // Global Priority for Group12 Interrupts
    #define INT13PL     7        // Global Priority for INT13 (TINT1)
    #define INT14PL     1        // Global Priority for INT14 (TINT2)
    #define INT15PL     0        // Global Priority for DATALOG
    #define INT16PL     0        // Global Priority for RTOSINT

    //
    // Set "Group" Interrupt Priority Level (PIEIER1 to PIEIER12 registers):
    //
    // The user must set the appropriate priority level for each of the PIE
    // interrupts. This is termed as the "group" priority. The priority level
    // must be a number between 1 (highest) to 16 (lowest). A value of 0 must
    // be entered for reserved interrupts or interrupts that are not used.
    //
    // Note: The priority levels below are used to calculate the following
    //       PIEIER register interrupt masks:
    //       MG1_1 to MG1_16
    //       MG2_1 to MG2_16
    //       MG3_1 to MG3_16
    //       MG4_1 to MG4_16
    //       MG5_1 to MG5_16
    //       MG6_1 to MG6_16
    //       MG7_1 to MG7_16
    //       MG8_1 to MG8_16
    //       MG9_1 to MG9_16
    //       MG10_1 to MG10_16
    //       MG11_1 to MG11_16
    //       MG12_1 to MG12_16
    //
    // Note: The priority levels shown here may not make sense in a
    //       real application.  This is for demonstration purposes only!!!
    //
    //       The user should change these to values that make sense for
    //       their application.
    //
    // 0  = not used
    // 1  = highest priority
    // ...
    // 16  = lowest priority
    //
    #define G1_1PL      0       // ADCA1_INT
    #define G1_2PL      0       // Reserved
    #define G1_3PL      0       // ADCC1_INT
    #define G1_4PL      0       // XINT1_INT
    #define G1_5PL      0       // XINT2_INT
    #define G1_6PL      0       // Reserved
    #define G1_7PL      4       // TIMER0_INT
    #define G1_8PL      0       // WAKE_INT
    #define G1_9PL      0       // Reserved
    #define G1_10PL     0       // Reserved
    #define G1_11PL     0       // Reserved
    #define G1_12PL     0       // Reserved
    #define G1_13PL     0       // Reserved
    #define G1_14PL     0       // Reserved
    #define G1_15PL     0       // Reserved
    #define G1_16PL     0       // Reserved
    
    #define G2_1PL      0       // EPWM1_TZ_INT
    #define G2_2PL      0       // EPWM2_TZ_INT
    #define G2_3PL      0       // EPWM3_TZ_INT
    #define G2_4PL      0       // EPWM4_TZ_INT
    #define G2_5PL      0       // EPWM5_TZ_INT
    #define G2_6PL      0       // EPWM6_TZ_INT
    #define G2_7PL      0       // EPWM7_TZ_INT
    // ETC...

    Please try running this example unmodified to see if it works on your system. Then modify a little at a time to learn how to do interrupt nesting and prioritization.

  • I don't know how to start it. EPWM belong to which interrupt group?

  • Hi,

    Please import the project into CCS and press "Debug" button.

    Regards,

    Vince

  • Can ISR with int 3.3 interrupted by ISR with int10.10?

  • No, not by default. This is explained in the interrupts chapter of the TRM.

  • I mean that if nesting configuration set correctly….Can ISR with int3.3 interrupted by the one with int10.10?

  • I have changed my code to below

        IER |= M_INT10;
        IER &= MINT10;
        HWREGH(PIECTRL_BASE + PIE_O_IER2) &= MG10_10; The timing improved a lot but still not 3.3us exactly.

    Is there are any information about what is delay time between 2 ISR during a nesting?