Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
20 years ago

IRQ handler problem

Hi all,

I have build an application on Stratix II, with three CPU's. I have ONE (!) pio line connected to the system of three CPU's.

In the SOPC builder I connected the three CPU's to the PIO module. I enabled the IRQ on edge capture.

All three CPU's are handling the interrupt. Now i'm experiencing problems. My system hangs sometimes in the alt_irq_register.c file in the while loop below.

I think it is because all CPU's are handling the interrupt and using this method to reset the register:

      
IOWR_ALTERA_AVALON_PIO_EDGE_CAP(SYNC_CLOCK_BASE, 0x00);

Can this be the problem? Does anyone have experienced the same problems before?

I need to have the interrupts on all CPU&#39;s. http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/sad.gif

The code in alt_irq_register.c (158)

    
    do
    {
      if (active & mask)
      { 
        alt_irq(alt_irq_arg, i); 
        break;
      }
      mask <<= 1;
      i++;
    } while (1);

12 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Using 3 PIOs will enable you to turn off each signal in turn. However you need the logic to disable/clear the original interrupting hardware, plus once all 3 CPUs have handled the IRQ you need to re-enable all 3 of your PIOs. This could be done in software, but you&#39;d be much better off desiging a bit of logic to solve the problem.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Ok, I think i&#39;ve misunderstood the original problem: i didn&#39;t think that i had to:

    <div class='quotetop'>QUOTE </div>

    --- Quote Start ---

    disable/clear the original interrupting hardware[/b]

    --- Quote End ---

    but only to "edge-capture" an input signal, without having to clear some extern register.

    bye