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.

TMS570LC4357: TMS570LC43x HDK GIO Interrupt read external Rising edge using Halcogen

Part Number: TMS570LC4357
Other Parts Discussed in Thread: HALCOGEN

Hi,

I am still new using TMS570LC4357 HDK, my goal is to trigger an ISR if there's a falling or a rising edge on GIOA[2] & [3].

After I setting in Halcogen as below, I need some example code to call the interrupt function.

Is there any example for that?

Thanks & Regards,

Lukman

  • Hi Lukman,

    You did the first step for triggering the interring with the falling edge:

    2nd step is to enable the VIM channel for GIO High (high priority is selected in your configuration):

    You will see the GIO ISR is generated in gio.c.

    Since the IRQ is selected, please enable the IRQ interrupt in your code:

    /* Enable CPU Interrupts */
    _enable_IRQ();

  • Hi QJ,

    Thanks for the reply, after I enable the _enable_IRQ(), which address I should look into to check the event triggering?

    And do I need to do clearing those address as well after the event triggering?

    Because I saw this interrupt in gio.c

    void gioHighLevelInterrupt(void)
    {
       uint32 offset = gioREG->OFF1;

       if (offset != 0U)
       {
           pin_bit= 1;
           offset = offset - 1U;
           if (offset >= 8U)
           {
              gioNotification(gioPORTB, offset - 8U);
           }
          else
           {
              gioNotification(gioPORTA, offset);
           }
        }
       else
       {
          pin_bit=0;
       }

    }

    But when I check the offset variable, it never changed or triggered.

    Or I can just use gioGetBit(gioPORTA, 2); ?

    Please kindly advise.

    I appreciate your reply.

    Thanks & Regards,

    Lukman

  • Hi QJ,

    I already solved my problem.

    Thanks & Regards,

    Lukman