Altera_Forum
Honored Contributor
22 years agoPIO INTERRUPT
i configed the pio_1 of my nios II as synchronously capture,either edge,interrupt generated by edge.
before i call the isr,i enable the irq of pio_1 by write the code as bellow: void* edge_capture_ptr = (void*) &edge_capture; /* Enable all 4 button interrupts. */ IOWR_ALTERA_AVALON_PIO_IRQ_MASK(PIO_1_BASE, 0xf); /* Reset the edge capture register. */ IOWR_ALTERA_AVALON_PIO_EDGE_CAP(PIO_1_BASE, 0x0); /* Register the interrupt handler. */ alt_irq_register(PIO_1_IRQ, edge_capture_ptr,pio_interrupt_handle ); //it is almost as same as provided in the sample program(count binary); then i connected pio_1 to the internal logic singal in the same FPGA,and expecte to read the PIO_1 edge_cap the another pio_0;but I did not found the isr run. and I found a function alt_irq_enable-all();but this function is only used when nested irq are runing. my question is: must I connect the pio to signals from out of the FPGA(I think it need not to do so); must I enable all the irq?but there is no global irq enable register in nios II,and I find there is no such code in the example count binary.c http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/ph34r.gif