
ECAN1000 User’s Manual
20
BDM-610020026 rev B
INTERRUPTS
What is an interrupt
?
An interrupt is an event that causes the processor in your computer to
temporarily halt its current process and execute another routine. Upon
completion of the new routine, control is returned to the original routine at
the point where its execution was interrupted.
Interrupts are a very flexible way of dealing with asynchronous events.
Keyboard activity is a good example; your computer cannot predict when
you might press a key and it would be a waste of processor time to do
nothing whilst waiting for a keystroke to occur. Thus the interrupt scheme
is used and the processor proceeds with other tasks. When a keystroke
finally occurs, the keyboard then 'interrupts' the processor so that it can
get the keyboard data .It then places it into the memory, and then returns
to what it was doing before the interrupt occurred. Other common devices
that use interrupts are A/D boards, network boards, serial ports etc.
Your ECAN1000HR can interrupt the main processor when a message is
received or transmitted if interrupts are enabled on the ECAN1000HR
board. By using interrupts you can write powerful code to interface to
your CAN network.
Interrupt request lines
To allow different peripheral devices to generate interrupts on the same
computer, the PC AT bus has interrupt request channels (IRQs). A rising
edge transition on one of these lines will be latched into the interrupt con-
troller. The interrupt controller checks to see if the interrupts are to be ac-
knowledged from that IRQ and, if another interrupt is being processed, it
decides if the new request should supersede the one in progress or if it
has to wait until the one in progress has been completed. The priority
level of the interrupt is determined by the number of the IRQ as follows;
IRQ0 has the highest priority whilst IRQ15 has the lowest. Many of the
IRQs are used by the standard system resources, IRQ0 is dedicated to
the internal timer, IRQ1 is dedicated to the keyboard input, IRQ3 for the
serial port COM2, and IRQ4 for the serial port COM1. Often interrupts 2,5
and 7 are free for the user.