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.

Question about C6678 ISR

Hello,

While debugging my board I have some questions, hope you could help me. 

1.    I wanna call an ISR function  for my DSP by detecting rising(or falling) edge from an external FPGA. I was setting GPIO1 as input, the interrupt works when I only print out my flag value after capture an interrupt, but when I increase the flag value in my main(), and put it in an infinite loop, it always got stuck(sometimes it can count for a couple of times but never run infinitely). and also the system becomes extremly unstable. thats just really wierd

here is my code: 

interrupt void intIsr()
{
a = 1;
Uint8 data_in;
CSL_GPIO_getInputData (hGpio, pinNum, &data_in);

return ;
}

void main()

{

.......configure INTC

.......configure GPIO

while(a!=1){ }
printf("GPIO interrupt occurs\n");
for(;;)
{
printf("a = %d\n",a);
a++;
}
return 0:

}

is there anyone know whats possibly the problem? 

2.    and for another question. because I am using EMIF to connect DSP & FPGA, to get the signal I wanna use interrupt. if GPIO interrupt doesnt work, I have to use another way.  I saw from the EMIF datasheet, in section 3.10 there's <Interrupt Support>. It said one can generate interrupt from rising edge on the WAIT pin. 

Could you please tell me how to configure it if you know it? Or is there example codes for example among those materials that TI offers?

Thank you in advance. 

  • Hi,

    Could you elaborate what does "got stuck" exactly mean?  Could you please show your code in the interrupt vector to call the ISR?

    Have you defined the variable "a" as volatile?  What is the optimization option given to the compiler?

    Regards,
    Atsushi

  • Thank you very much for your respond Atsushi,

    I modified the code instead of increase my a but another variable, now it can run in an endless loop. 

    But I still have a question, from the data manual of 6678, in the Table 7-38 System Event Mapping, I could find my GPIO event ID is 90(GPINTn), but how can I find the event ID of EMIF16? and how to define which event vector is it? I read in the chapter that we could use EMIF WAIT to check interrupt. but in the configuration of INTC I think I still need to declare the event ID and vector ID.

    Thanks for the response.

    Best wishes,

    Wendy

  • Hi Wendy,

    It is good to hear that the problem has been resolved.

    > But I still have a question, from the data manual of 6678, in the
    > Table 7-38 System Event Mapping, I could find my GPIO event ID is
    > 90(GPINTn), but how can I find the event ID of EMIF16? and how to
    > define which event vector is it? I read in the chapter that we could
    > use EMIF WAIT to check interrupt. but in the configuration of INTC I
    > think I still need to declare the event ID and vector ID.

    We see 'EASYNCERR (EMIF16 error interrupt) ' in the section "7.9 Interrupts" of the C6678 User Guide.  My understanding is it corresponds to the interrupt signal.  (I'm afraid that I've never used it, so I don't know how it works.)

    I hope it helps.

    Regards,
    Atsushi

  • Hello Atsushi,

    since I could use ISR from GPIO properly, for this moment I think i will just use it. unless I have problem with it in the future that I have to use other interrupt pins. 

    but Thank you for your patience and the fast responce, really helped me a lot :) 

    Best wishes,

    Wendy