Forum Discussion

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

Interrupt detection

Is it right to do so?


if (rising_edge(CLK)) then
   
      busy1 <= BUSY;
     busy2 <= busy1;
     
     if (busy1 = '1' and busy2 = '0') then
         int <= '1';
     else
         int <= '0';
     end if;  
end if; 

I thought to do (busy1 xor busy2) but this way I don't know on what edge was the interrupt - falling or rising.

1 Reply

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

    Looks fine to me. You're looking for a rising edge on BUSY...

    Cheers,

    Alex