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.

how to configure hardware interrupt in DSP/BIOS

Respected all

Could somebody help me to configure H/W interrupt using DSP/BIOS for c674X DSP processor

Anu

  • Anu,

    I took the “hello” example that comes with DSP/BIOS and added a couple of ISRs to demonstrate how to configure a normal interrupt and a combined interrupt on the C6748.  For this example both of these interrupts “piggyback” on the interrupt from Timer0 that is already generating the periodic CLK ticks (i.e., a single interrupt source is used to trigger 3 separate ISRs).

    First build and run the hello example.

    Then for a non-combined interrupt, add this to the .tcf file to specify the function myIsrFxn() to be run on Timer0 interrupts (which come in on event #4):

        bios.HWI_INT10.fxn=prog.extern("myIsrFxn");
        bios.HWI_INT10.interruptSelectNumber=4;  /* select event #4 for Timer 0 */
        bios.HWI_INT10.useDispatcher = true; 

    Then add the myIsrFxn() to your C code.  Add a #include of <c64.h>.  Add this to main(), to enable HWI_INT10 in the interrupt enable register (IER):

        C64_enableIER(0x400);     /* enable HWI_INT10 */

    Build, load the program, and then set breakpoints at “myIsrFxn” and “CLK_F_isr” (which is the CLK module’s ISR function).  When you run you should see alternating activation of the two breakpoints.

    Now to add in a combined interrupt (again event #4 from Timer 0) add this to the .tcf file to enable the event combiner module (ECM), specify a different ISR function, and then connect the combined interrupt to HWI_INT8:

        bios.ECM.ENABLE = true;                                         /* enable ECM */
        bios.ECM.instance("EVENT4").fxn = prog.extern("myCombinedIsrFxn");
        bios.HWI_INT8.interruptSelectNumber=0;            /* connect combined events #4-#31 to HWI_INT8 */

    Add myCombinedIsrFxn() to your C code, and #include <ecm.h>.  In main() enable ECM to service event #4, and enable HWI_INT8:

        ECM_enableEvent(4);         /* enable servicing of event #4 */
        C64_enableIER(0x100);     /* enable HWI_INT8 */

    Add another breakpoint at “myCombinedIsrFxn”, then run and see all three interrupts firing in sequence.

    If you haven’t seen it, the HWI and ECM module configuration interfaces and APIs are described in the API reference guide: http://www.ti.com/lit/ug/spru403r/spru403r.pdf  

    Scott