barry_sellew

When and how are interrupts enabled on the NIOS 2 core?

Discussion created by barry_sellew on Aug 8, 2012

There are two separate mechanisms involved in interrupts:

1. The enabling and disabling of external interrupts.

Either all "available" interrupts are enabled or they are not availble.  That is controlled via:

NU_Control_Interrupts()

where you can pass either

NU_DISABLE_INTERRUPTS           0x00000000
or
NU_ENABLE_INTERRUPTS            0x00000001

So this effectly controls if you have interrupts or not.  This controls the PIE bit of the status register.

2.  You can selectively enable or make available individual interrupts.

That is, you have to activate an interrupt source by setting the corresponding bit in the ienable register.  This is accomplished via two utility functions:

INT_Enable_Int_Source (INT)
INT_Disable_Int_Source (INT)

After you register a LISR, you will have to activate the interrupt source using the functions above.

Outcomes