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 use the interrupts of GIO

Other Parts Discussed in Thread: HALCOGEN, TMS570LS3137

Hi,all

    I want to usr GIO_A0 and GIO_A3 as input interrupt signal ,How can I use this two pins ,the interrupt may come together or one after another in very short time. I check the "gioREG->FLG"?Do I need to configure "gioREG-> ENASET "?

  • Jiaming,

    I've attached a simple GIO project using a GIO pin as interrupt.
    Please have a look and let me know if this is helpfull.

    3124.GIO_Interrupt_be.zip

  • Dear Jean,

    I tried some parts of your code and it did not work for me. Here it is what I do in Halcogen:

    • Enable GIO, disable other drivers
    • IRQ set to vector mode
    • Enable GIO INT A Channel 9 IRQ
    • GIO BIT 7 Input, pull down, falling edge, enabled, low prio

    sys_main.c:

    _enable_IRQ();
    
    gioInit();
    
    gioEnableNotification(gioPORTA,7);
    
    while(1);

    When I try to debug, I use a breakpoint in notifications.c, gioNotification(). Debugger can not reach the breakpoint. Thanks for your help.

  • It works for me when I use high priority. I still have to find out why my program does not call the event handler on low priority. I've filmed my attempt to use the interrupts via GIO: http://youtu.be/Kih2YKvk8Cw When I do the same steps with low priority selected, it won't work.
  • My problem is I have two interrupt from GPIO ,one is from GIOA0 ,and the other is from GIOA3,the two interrupts may come together.I do the test

    void gionotify(gioPORT_t *port, sint32 bit)

     {

        if(port==gioPORTA && bit==0)

           {   Message[0] = 0x01;  

               fpgaBlockRead( &Message[0], 0, 140);  

                WriteComQ(&TGMQABufApp, &Message[0], 140);   

           }

           else if(port==gioPORTA && bit==3)

          {   

             Message1[0] = 0x02;  

              

              fpgaBlockRead_1( &Message1[0], 0, 140);  

              WriteComQ(&TGMQBBufApp, &Message1[0], 140);       

                 }

     

    }

    and when I create the conditon that the GIOA0 and GIOA3 encounter with interrupt signal (rising edge)together,I find the error pin of TMS570LS3137 is low which means something wrong with the TMS570.

    How can I solve this problem?Hope to get answer soon.Thanks a lot !

  • Jan,

    I've create 2 projects using your code example.

    Push_Button_High to demonstrate the High level GIO interrupt and Push_Button_Low to demonstrate the Low level GIO interrupt.

    I think your mistake is because of a naming in HalCogen.

    The GIO module has 2 interrupt lines connected to the VIM module.

    1 line is connected as request request 9 and named in Halcogen GIO int A and the other to request 23 and named GIO int B. In the GIO tab in Halcogen, you can select for each GIO input used for interrupt generation if they will activate the High or Low priority. By concept, the VIM module prioritize interrupt with the following scheme.
    Request 0 > Request 1 > .... > Request 95.

    So in order to make the GIO low interrupt to work, you have to select for the pin you want to use, "Low Priority" and enable at the VIM level the request 23 named GIO int B.

    The rest of your code stay the same. 

    Please have a try and let me know if it is clear now.

    4442.Push_Button_High.zip

    7080.Push_Button_Low.zip

  • Jean-Marc, You are right. When I enabled VIM channel 23, the event was triggered and the code works. Thank you!
  • Jan,

    If your question has been answered, could you please mark my reply as verified so we can close this thread.

  • Is it possible that only the original poster sees that button? I'm unable to locate it next to your reply.