A SERVICE OF

logo

44
4.4) Configuring the Opto-Isolators using Normal Interrupt Mode
Each Opto-isolator can be configured to an Interrupt Line. However, since only 8 IRQ
Lines are available, only eight can be vectored to an individual IRQ. The rest can be
vectored to one common IRQ line using Shared IRQ Mode (see section 4.2). To
configure the IRQ lines proceed as follows:
a) Set the appropriate bit for each opto-isolator (max 8 at any one time) in the IGATE
Register.
b) Select the appropriate IRQ by writing to IMUXP0, IMUXP1 and IMUXP2.
c) Setup an ISR for each IRQ
d) When a positive edge is seen on one of the Opto-isolators, an interrupt will be
generated.
e) An ISR should take the necessary action.
f) Clear the Interrupt Enable flip-flops after all the necessary action is taken. You can
clear either each individual flip-flips by writing to the ISETX Register (Offset or
reset the first eight or last 8 flip-flops by writing a 0 and then a 1 to the GRES0 (bit
0) or GRES1 (bit1) in the GLOBAL Register (Offset 2).
g) Issue an End of Interrupt (EOI) command to the Interrupt controller. Note that an
EOI command must be issued to both Interrupt controllers.
h) Repeat the above cycle from d) to g).
II Warning
Do not configure both IRQ MUXes in the GLCNTRL Register and the
IMUXP0, IMUXP1, IMUXP2 to the same Interrupt. This will lead to two
open collector lines driving each other and can yield inexplicable results.