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.

Getting GPIO HWI working using DSP/BIOS

I have set up in the .tcf file HWI6 set with input selection# 62 which points to GPIO6[14] on the DSP interrupt field.  I have the function pointing to _gps1PPS and I am using the dispatcher with arg 0x0 and the int. mask is a bitmask to 0x40 which I assume points to HWI6.  In main I configure the interrupts for rising edge and enable Bank6 by writing directly to their registers.  The HWI never fires even though I see a pending interrupt in the intstat67.  I don't see a pending interrupt in the IFR register although the IER register has HWI6 enabled.  Am I missing something? 

Will

  • This sounds like you don't have the interrupt #6 routed to the event associated with GPIO6[14].

    You'll have to do some digging to determine the event ID associated with that GPIO pin, but once you know what it is, you can either do the mapping statically in your .tcf file using:

        bios.HWI_INT6.interruptSelectNumber=32;  /* sets the event ID associated with interrupt #6 to 32 */

    or dynamically using:

      HWI_eventMap(32, 6);    /* sets the event ID associated with interrupt #6 to 32 */

    Alan

  • Hi Alan,

    This is what I have in my .tcf associated with interrupts:

    bios.HWI.instance("HWI_INT6").interruptSelectNumber = 62;
    bios.HWI.instance("HWI_INT6").useDispatcher = 1;
    bios.HWI.instance("HWI_INT6").fxn = prog.extern("gps1PPS");

    Also, what I have found is that if I init my GPIO interrupt registers from main() then I can get the ISR.  If I configure the GPIO in my dataprocessing task, then the ISR never fires, but all the registers in the GPIO look correct.  Any thoughts?


    Will

  • Will,

    Seems like you're doing it correctly.

    Are you sure the IER is the same whether you initialize the GPIO in main() or the task?

    Is there a chance that you're missing an edge when you initialize the GPIO in the task?

    Are you sure the GPIO configuration code is IDENTICAL in both scenarios?

    Alan

  • Alan,

    Found the problem.  I was using HWI6 which was being overwritten by the ethernet stack.  That is why it worked from main but not after the stack was initialized.  The stack uses HWI5 and HWI6.  Set up the dispatcher on HWI4 and everything works fine.

    Thanks,

    Will