Forum Discussion
With the respect to edge cpature inputs, it's clear how the IRQ is handled and cleared. But, when a PIO input is configured to generate an IRQ on a LEVEL, when/how does the IRQ assertion clear? For example, assume a PIO is configured to generate an IRQ when a level is detected. In software, the PIO interrupt handler simply reads the data register, stores it into a variable (i.e. pio_in_data), and exits. The "main" body of the program simply runs a loop printing the contents of pio_in_data when new data arrives. With this program running on a Nios dev. board with the PIO configured for the push-buttons, what if the user were to press and hold one of the buttons. The button input would remain at a "level" for a long period. The IRQ would assert, my interrupt handler would execute and exit. Is the IRQ still asserted? Would the program re-enter my interrupt handler since the input was still detected at a high "level"?
I agree that the edge capture would be the better solution for my example, but I would like to better understand the usefulness of a level detected configuration. I guess I'll have to try programming my example situation. Thanks for your time.