Forum Discussion

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

Cyclone V GPIO interrupt can not work under low level-trigger mode

Hi all,

I'm using Altera Cyclone V board (Board Info http://www.altera.com/products/devkits/altera/kit-cyclone-v-soc.html ). And tried to set User Push Button [0 :3] as low level trigger mode, but when I push these button, the interrupt handle will be called many many times.

However, it works well under low edge trigger mode, the interrupt handle was called only once.

BTW, I’ve already set the debounce clock value gpio divide register in clock manager and set it enabled in gpio_debounce register.

Any suggestion is appreciated, thanks.

4 Replies

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

    What clock frequency and clock divider settings do you use for the GPIO? In order for the edge to propogate to the interrupt logic the button active period would need to be at least 2 debounce clocks in width.

    *Sorry I just read the post again and I had it backwards, I thought you said the level interrupts worked but the edge interrupts were not. I agree with what dsl said, your finger is probably still on the button when the ISR completes and you end up re-entering the ISR again. *
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    That is what I'd expect from a level triggered interrupt.

    As soon as the ISR returns and enables interrupts, if the IRQ is still asserted (and not masked) then the ISR will be re-executed.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    That is what I'd expect from a level triggered interrupt.

    As soon as the ISR returns and enables interrupts, if the IRQ is still asserted (and not masked) then the ISR will be re-executed.

    --- Quote End ---

    Thank you for your reply, I agree with your answer, thanks!
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    What clock frequency and clock divider settings do you use for the GPIO? In order for the edge to propogate to the interrupt logic the button active period would need to be at least 2 debounce clocks in width.

    *Sorry I just read the post again and I had it backwards, I thought you said the level interrupts worked but the edge interrupts were not. I agree with what dsl said, your finger is probably still on the button when the ISR completes and you end up re-entering the ISR again. *

    --- Quote End ---

    Thanks BadOmen!