When an IRQ interrupt is received, the CPU should follow these steps if not using the
Vector Interface.
- Read the IRQ Vector Address (Base Address + 0x18) and jump to that address
to service the ISR
- Reading this register will mask all interrupts of an equal or lower
priority and de-assert the IRQn output. If another interrupt of a
higher priority becomes available, the IRQn will re-assert, allowing
priority interruption of an interrupt.
- Reading this register will cause the value from the Prioritized IRQ
(Base Address + 0x08) (which corresponds to the vector address) to
be loaded into the Active IRQ (Base Address + 0x20) and the valid
bit to be set
- Service the interrupt
- Depending on whether the original source of the interrupt was a pulse or a
level (Determined by reading the Active IRQ (Base Address + 0x20) to
determine number and reading the Group M Type Map Register (Base Address +
0x200 + M*0x20 + 0x1C) to determine type)
- Pulse
- Clear the status by writing a 1 to the appropriate bit in
the Group M Interrupt Enabled Status/Clear Register
(Base Address + 0x400 + M*0x20 + 0x04) or Group
M Interrupt IRQ Enabled Status/Clear Register
(Base Address + 0x400 + M*0x20 + 0x10)
- Clear the interrupt at the source
- This way, the source can generate another pulse if
it needs to and the VIM will process this as a new
interrupt
- Level
- Clear the interrupt at the source
- Clear the status by writing a 1 to the appropriate bit in
the Group M Interrupt Enabled Status/Clear Register
(Base Address + 0x400 + M*0x20 + 0x04) or Group
M Interrupt IRQ Enabled Status/Clear Register
(Base Address + 0x400 + M*0x20 + 0x10)
- This way, the level should be gone at the input to
the VIM, it will avoid falsely re-calling the
interrupt
- If the source maintains the level, then it means
there is another interrupt
- Write any value to the IRQ Vector Address (Base Address + 0x18)
- This will clear the priority mask and all interrupts to be
re-evaluated for the new highest priority interrupt.
- This will clear the valid bit of the Active IRQ (Base Address +
0x20)