Forum Discussion
Altera_Forum
Honored Contributor
13 years agohaving trouble with interrupt
Hello everyone , I'm try for a very long time to do a simple interrupt with nios ii. this is my problem: i have button in sratix ii dev kit and all i want to do in nios is just to turn on ...
Altera_Forum
Honored Contributor
13 years agoAdd these before alt_irq_register:
IOWR_ALTERA_AVALON_PIO_IRQ_MASK(button_IRQ, <irq_bit_mask>); // enable irq IOWR_ALTERA_AVALON_PIO_EDGE_CAP(button_IRQ, <irq_bit_mask>); // clear irq You also need to clear the edge capture bit in irq handler function, otherwise the irq will keep on retriggering. Also make sure of these points: - in qsys/sopc button pio must be defined with interrupt capability enabled - the button pio is correctly routed to fpga pin and pio is working: begin with polling the pio in while loop to test this point.