Forum Discussion
Altera_Forum
Honored Contributor
20 years agoHow to use interrupt?
Hello. I want to use interrupt from USER_PIO, but I don't know how to use. I tried this sample code , but it seems that ISR is not executed. (I modified two point. *definition of...
Altera_Forum
Honored Contributor
20 years agoIt is not exactly the same
I use the isr and dsr routine The source of interrupt is masked in the isr "cyg_interrupt_mask(vector);" and unmasked in the dsr " cyg_interrupt_unmask(vector);" In your code you use only the isr routine so mask and unmask in the isr or do not mask the source of the interrupt, the edgecapture register masks for you until it is reset the isr could be : cyg_uint32 isr_pio( cyg_vector_t vector ,cyg_addrword_t data) { // cyg_interrupt_mask(vector); cyg_interrupt_acknowledge(vector); IOWR(BUTTON_PIO_BASE , 3, 0x00); // Reset the edgecapture register ledpio = 0x8; // IOWR (LED_PIO_BASE , 0, ledpio); return(CYG_ISR_HANDLED); }