Nios II interrupt

Oct 05, 2006 1 Replies

Hi,



I am new to the Nios II core. I have built a simple system with a timer which is set as periodically timer. I have registered an interrupt service routine:



alt_irq_disable(TIMER_0_IRQ); res = alt_irq_register(TIMER_0_IRQ, NULL, timer_isr);



With this code I still come in my installed ISR. So registering is also enable the interrupt. Is that correct, is there a way to register an ISR and leave the interrupt disabled (until you decide to enable it manually)?



Another question: where can I find a list with available routines for the peripheral. For instance, I saw in an example the call IOWR_ALTERA_AVALON_PIO_DATA to write to my io-pins. But where can I find a complete list. It not in the software developer's handbook.



best regards, Frank


Normally, you'll use the generated alt_sys_init() to set up the timers in alt_main(). This wants to happen after the call to alt_irq_init(ALT_IRQ_BASE). Take a look at the macros in alt_sys_init() to see the underlying process.

Take a look in the components directory. For example, for pios, take a look at components/altera_avalon_pio/inc/altera_avalon_pio_regs.h.

Mark

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required