
ECAN1000 User’s Manual
25
BDM-610020026 rev B
With the startup IMR saved and the interrupts temporarily disabled, you
can assign the interrupt vector to point to your ISR. Again you can over-
write the appropriate entry in the vector table with a direct memory write,
but this is not recommended. Instead use the DOS function 25h (Set In-
terrupt Vector) or, if your compiler provides it, the library routine for set-
ting up interrupt vectors. Remember that interrupt vector 8 corresponds
to IRQ0, vector 9 for IRQ1 etc.
If you need to program the source of your interrupts, do that next. For ex-
ample, if you are using transmitted or received messages as interrupt
sources, program it to do that. Finally, clear the mask bit for your IRQ in
the IMR. This will enable your IRQ.
Common Interrupt mistakes
Remember that hardware interrupts are from 8-15, XT IRQs are num-
bered 0-7. Forgetting to clear the IRQ mask bit in the IMR Forgetting to
send the EOI command after ISR code disables further interrupts.