PIC 8259-A

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
pini

PIC 8259-A

Post 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 ???
Therx

Re:PIC 8259-A

Post 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
drizzt

Re:PIC 8259-A

Post 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);
Post Reply