Microprocessors and Microcontrollers: Unit IV: (b) Programmable Interrupt Controller (PIC) - 8259

Priority Modes and Other Features

The various modes of operation of the 8259 are : 1. Fully Nested Mode, 2. Special Fully Nested Mode (SFNM) 3. Rotating Priority Mode, 4. Special Masked Mode, and 5. Polled Mode.

Priority Modes and Other Features

AU : May-11, Dec-19

The various modes of operation of the 8259 are : 1. Fully Nested Mode, 2. Special Fully Nested Mode (SFNM) 3. Rotating Priority Mode, 4. Special Masked Mode, and 5. Polled Mode.

1. Fully Nested Mode (FNM) : After initialization, the 8259A operates in fully nested mode so it is called default mode. The 8259 continues to operate in the Fully Nested Mode until the mode is changed through Operation Command Words. In this mode, IRQ has highest priority and IR7 has lowest priority. When the interrupt is acknowledged, it sets the corresponding bit in ISR. This bit will inhibit all interrupts of the same or lower level, however it will accept higher priority interrupt requests. The vector address corresponding to this interrupt is then sent. The bit in the ISR will remain set until an EOI command is issued by the microprocessor at the end of interrupt service routine. But if AEOI (Automatic End of Interrupt) bit is set, the bit in the ISR resets at the trailing edge of the last   .

End of Interrupt (EOI)

1. The ISR bit can be reset by an End of Interrupt command issued by the MPU, usually just before exiting from the interrupt routine.

2. In the Fully Nested Mode, the highest level in the ISR would necessarily correspond to the last interrupt acknowledged and serviced. In such a case, a non-specific EOI command may be issued by the MPU.

3. However, if the FNM is not used, the 8259 may not be able to determine the last interrupt acknowledged. In such a case, a specific EOI command will have to be issued by the MPU.

4. It should be noted that in the cascade mode, the EOI command must be issued twice, once for the master and once for the slave.

Automatic End of Interrupt (AEOI) : If the AEOI mode is set, the 8259 will perform a non-specific EOI on its own on the trailing edge of the third   pulse. The AEOI mode can only be used for a master 8259 and not for a slave.

2. Special Fully Nested Mode (SFNM) : In the FNM, on the acknowledgement of an interrupt, further interrupts from the same level are disabled. Consider a large system which uses cascaded 8259s and where the interrupt levels within each slave have to be considered. An interrupt request input to a slave, in turn causes the slave to place an interrupt request to the master on one of the master's inputs. Further interrupts to the slave will cause the slave to place requests to the master on the same input to the master, but these will not be recognised because further interrupts on the same input level are disabled by the master.

The Special Fully Nested Mode (SFNM) is used to avoid this problem. The SFNM is set up by ICW4 during initialisation. It is similar to the FNM except for the following differences :

1. When an interrupt request from a slave is being serviced, the slave is allowed to place further requests if these requests are of a higher priority than the request currently being serviced. These interrupts are recognised by the master and it initiates interrupt requests to the MPU.

2. Before exiting from the interrupt service routine, a non-specific EOI must be sent to the slave and its ISR must be read to determine if it was the only interrupt to the slave. If the ISR is empty, a non-specific EOI command can be sent to the master. If it is not empty, it implies that the same IR level input to the master is to be serviced again due to more than one interrupts being presented to the slave, and an EOI must not be sent to the master.

3. Rotating Priority Mode : The Rotating Priority mode can be set in i) Automatic Rotation, and ii) Specific Rotation.

i) Automatic Rotation : In this mode, a device, after being serviced, receives the lowest priority. The device just been serviced, will receive the seventh priority. Here IR3 has just been serviced.


ii) Specific Rotation : In the Automatic Rotation mode, the interrupt request last serviced is assigned the lowest priority, whereas in the Specific Rotation mode, the lowest priority can be assigned to any interrupt input (IR0 to IR7) thus fixes all other priorities.

For example if the lowest priority is assigned to IR2, other priorities are as shown below.


4. Special Mask Mode : If any interrupt is in service, then the corresponding bit is set in ISR and the lower priority interrupts are inhibited. Some applications may require an interrupt service routine to dynamically alter the system priority structure during its execution under software control. For example, the routine may wish to inhibit lower priority requests for a portion of its execution but enable some of them for another portion. In these cases, we have to go for special mask mode. In the special mask mode it inhibits further interrupts at that level and enables interrupts from all other levels (lower as well as higher) that are not masked. Thus any interrupt may be selectively enabled by loading the mask register.

5. Poll Mode : In this mode the INT output is not used. The microprocessor checks the status of interrupt requests by issuing poll command. The microprocessor reads contents of 8259A after issuing poll command. During this read operation the 8259A provides polled word and sets ISR bit of highest priority active interrupt request FORMAT.


I = 1 → One or more interrupt requests activated.

I = 0 → No interrupt request activated.

W2 W1W0 →  Binary code of highest priority active interrupt request.

Review Questions

1. What are the different ways to end the interrupt execution in 8259 programmable interrupt controller ?

2. Explain the operating modes of 8259.

3. With a functional block diagram, briefly discuss the architecture of the 8259 programmable interrupt controller.

Microprocessors and Microcontrollers: Unit IV: (b) Programmable Interrupt Controller (PIC) - 8259 : Tag: : - Priority Modes and Other Features