250 Computer Architecture and Organization
and in that situation these remaining signals (CAS0 and so on) would be necessary for the purpose of
interfacing. Does it sound very complicated? As a matter of fact, we have encountered only half of the
story. Note that the hardware interfacing must be followed by software initialization to make any 8259
a working unit. And to avoid complexity, we shall take up only one 8259 initially, assuming the maxi-
mum number of external interrupting devices would not exceeding eight. Once we have gone through
its initialization details and working mechanism, the more complex situation involving multiple 8259
would be discussed.
8.7.1 8259 Without Cascading
If the number of interrupting devices is eight or less, then interrupt generating signal from each device
may be connected with IR0 through IR7 inputs of the interrupt controller, 8259. From the processor
side, the necessary interfacing would be INT connected with the interrupt input of the processor and
INTA from its interrupt acknowledgement output. Remaining address, data and control signals interfac-
ing also must be completed. As only one 8259 is used in the system, its SP/EN input should be pulled
high (connected with Vcc). Remaining three pins, CAS0, CAS1 and CAS2 may be left without any
connection (NC or no connection). All these complete the essential hardware interfacing.
Now comes the software part. To make 8259 completely operational, some initialization through
software commands are essential. Note that unlike 8255, 8259 does not have any reset input to initialize
some default functions. The most critical matter for this initialization procedure is to convey to 8259 to
generate and communicate separate branching address for each interrupt input to 8259. These branching
addresses are extracted by the processor from 8259 with the help of INTA signal. Whenever the INTA
goes low, 8259 sends the related branching address to the processor. But how does 8259 generate differ-
ent branching addresses for each individual interrupt attached with it through IR0 – IR7? The answer is,
a base address and its offset bytes are communicated by the processor to 8259, during the initialization
process. For this purpose, a total of four ICW (Initialization Command Word) may be sent to 8259 in
sequence, by the processor. These are designated as ICW1, ICW2, ICW3 and ICW4. If only one 6259 is
in the circuit, as in the present case, then ICW3 is not necessary and ICW4 may be communicated right
after ICW2. A15 to A8 of the base address of interrupt vector are passed to 8259 through ICW2. A7 to
A5 of the base address are communicated through ICW1. Note that A4 to A0 of the base address are
always represented by 0s. The reader may go through the data sheets of 8259 for further initialization
details of 8259.
8.7.2 8259 with Cascading
When the number of interrupting devices is more than eight, multiple 8259s must be used in cascade
con guration, as indicated in the schematic of Figure 8.11 . We may observe from this diagram that a
maximum of 64 external devices may be interfaced with eight numbers of 8259, which we designate as
follower 8259s. The INT output of these eight follower 8259s are to be interfaced with a leader 8259.
Finally, the INT output of the leader 8259 is interfaced with the interrupt input pin of the processor
(INTR). Note that all other addresses, data and control signals from the processor must be properly
interfaced with the leader as well as all eight follower 8259s. Each 8259 must be separately initialized
by the processor, as indicated in Section 8.6. In this case, ICW3 would be necessary to be sent, which
was not so in our single 8259 case.
M08_GHOS1557_01_SE_C08.indd 250M08_GHOS1557_01_SE_C08.indd 250 4/29/11 5:15 PM4/29/11 5:15 PM