• Not Answered

About C6678's GPIO interrupt

Hello, everyone!

I  have encountered the following questions when i set the GPIO's interrupt, please help me.

My steps are as follows:

(1)INTC module initialization;

(2) Enable NMIs;

(3) Enable global interrupts;

(4) Open the INTC Module for Vector ID:4 and Event ID: 89( because I was set to GPIO_15 as an interrupt input );

(5)Register an call-back handler which is invoked when the event occurs;

   EventRecord.handler = &intIsr;
    EventRecord.arg = 89;
    if (CSL_intcPlugEventHandler(hTest,&EventRecord) != CSL_SOK)
        printf("Error: GEM-INTC Plug event handler failed\n");

(5) Enabling the events;

(6) set the GPIO_0 ----GPIO_7 to input, and GPIO_15  to input;

sets specified GPIO_15 to rising edge interrupt, and clears GPIO_15 rising edge interrupt

(7) enablethe GPIO's interrupt

(8) in the interrupt service routine I do is read from the GPIO_0 to the GPIO_7 state of the input, uses the method is to read the state of an IN_DATE register. GPIO_0 to GPIO_7 input I is through external periodic continued to enter 0 or1

Results in the cache to see is that state0 0 255 255 0 0 255 255... ... ....

The correct resultshould be 0 255 0 255 0 255 0 255 ..........Is there something miss in my steps? please help me ,Thinks!.

your sincerely

Bin Chen

1 Reply

  • Bin Chen,

    If your able to get into the GPIO ISR successfully, then I do not see any issues with the steps what you mentioned above. Comparing the current output and the expected output, I can see the GPIO_15 line toggling twice (resulting in triggering 2 interrupts), where as the GPIO0-7 lines status do not change (remains '0' or '1'). This is the reason why you get the same value twice in your capture buffer. Hence, to get the expected output, check the frequency of the signal connected to GPIO_15 and make it equal to twice the frequency of the periodic input going into GPIO0-7. Currently, the frequency of GPIO_15 signal might be 4 times of the frequency of GPIO0-7.

    I hope this helps. 




    If you need more help, please reply back. If this answers the question, please click  Verify Answer , below.