Page 1 of 1

PIC 8259-A

Posted: Fri Aug 22, 2003 2:47 pm
by pini
When use two cascading PIC 8259-A, to which one should an IRQ be acknowledged ?
The master only ? The Slave only ? (According to the IRQ #)
Slave first then master (if IRQ # >8) ??

Does somebody got the correct answer ???

Re:PIC 8259-A

Posted: Fri Aug 22, 2003 3:01 pm
by Therx
If IRQ <7 then just the first will do, otherwise both need the EOI. For simplicity just do both every time. The order doesn't matter and it also doesn't matter if you send an EOI even when there hasn't been an IRQ.

ie at the end of all Hardware ISRs:-
mov ax, 0x20
out 0x20, ax
out 0xA0, ax

Pete

Re:PIC 8259-A

Posted: Sun Aug 24, 2003 3:46 am
by drizzt
I put this at the end of my ISRs:

Code: Select all

// Re-enable the IRQ line (master channel) //
outportb(PORT_8259_M, EOI);
if ( IRQ >= 8 )
    // Re-enable also the IRQ slave channel //
    outportb(PORT_8259_S, EOI);