8259A Help need.
8259A Help need.
Hello, all.
I read Intel's 8259A datasheet (uff, it is not too easy!), and almost understood its logic. But I can't understand, why SP/EN is needed? And when CAS lines are used?
Thanking in advance.
I read Intel's 8259A datasheet (uff, it is not too easy!), and almost understood its logic. But I can't understand, why SP/EN is needed? And when CAS lines are used?
Thanking in advance.
Last edited by Mikae on Thu Nov 16, 2006 5:15 pm, edited 1 time in total.
- Brynet-Inc
- Member
- Posts: 2426
- Joined: Tue Oct 17, 2006 9:29 pm
- Libera.chat IRC: brynet
- Location: Canada
- Contact:
Re: 8259A Help need.
Intel wrote a datashit eh?Mikae wrote:Hello, all.
I read Intel's 8259A datashit (uff, it is not too easy!), and almost understood its logic. But I can't understand, why SP/EN is needed? And when CAS lines are used?
Thanking in advance.
I wonder what a datashit is...
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
I kindof wonder why you want to know how the PIC's electrics work, as thats something for hardware development.
From what i quickly read, the cascade lines are used when the second pic wants to interrupt the system: the slave pic raises the int line (connected to the master)
the master interrupts the cpu, and when the cpu acknowledges the interrupt the master uses the cascade lines to signal the slave that it should drive the data bus.
Actually, there's a sample schematic of a cascaded PIC on page 19 of the data sheet. If you ignore the second slave, thats pretty much how things are set up in a PC. (I'm not sure if the interrupt numbers match though)
From what i quickly read, the cascade lines are used when the second pic wants to interrupt the system: the slave pic raises the int line (connected to the master)
the master interrupts the cpu, and when the cpu acknowledges the interrupt the master uses the cascade lines to signal the slave that it should drive the data bus.
Actually, there's a sample schematic of a cascaded PIC on page 19 of the data sheet. If you ignore the second slave, thats pretty much how things are set up in a PC. (I'm not sure if the interrupt numbers match though)
I am trying to know base system's component's interface too, not only from the point of view of software.I kindof wonder why you want to know how the PIC's electrics work, as thats something for hardware development.
Hmm... Iam not sure. Every 8259 is connected to control bus, and has its own INTA...the master interrupts the cpu, and when the cpu acknowledges the interrupt the master uses the cascade lines to signal the slave that it should drive the data bus.
- kataklinger
- Member
- Posts: 381
- Joined: Fri Nov 04, 2005 12:00 am
- Location: Serbia
- kataklinger
- Member
- Posts: 381
- Joined: Fri Nov 04, 2005 12:00 am
- Location: Serbia
Yes there is 8259 in every PC but it is an ancient interrupt controller, but APIC is much newer, and AFAIK it is present on every modern motherboard.Mikae wrote:As I understand, 8259 are used in every Intel's system chipset. Isn't it? Also, it was always a miracle for me, how interrupts are delivered to CPU. I knew something, but now I want to know in details.
Hi,
Cheers,
Brendan
To me, it looks like it goes like this:Mikae wrote:Hmm... Iam not sure. Every 8259 is connected to control bus, and has its own INTA...the master interrupts the cpu, and when the cpu acknowledges the interrupt the master uses the cascade lines to signal the slave that it should drive the data bus.
- - slave PIC receives a signal on IR0 to IR7 pins
- slave PIC raises it's INT line to tell the master it wants to send an IRQ
- master PIC raises it's INT line to tell the host system it wants to send an IRQ
- the host system raises the INTA line to tell all of the PICs it's ready to receive the IRQ
- the master PIC sends a one byte code to the host to tell it the details on the way
- the master PIC uses the CAS0 to CAS2 lines to tell the slave PIC to talk on the bus
- the slave PIC sends the interrupt vector to the host system
- the master PIC drops CAS0 to CAS2
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Hi,
For something like a single CPU Pentium III system it's likely there is no I/O APIC, and the I/O APIC can be more work to setup. IMHO unless you're writing a "64-bit only" OS it'd be worthwile learning about the PIC (and then learning about I/O APICs after that).
Cheers,
Brendan
One (or more) I/O APICs are present on all SMP motherboards since the 80486 (including "single socket" motherboards that support hyper-threading and/or multi-core chips). For motherboards made in the last 5 years it's likely there's an APIC regardless of whether "multi-CPU" is possible or not. IIRC Microsoft "asked" motherboard manufacturers to include it around that time (and it made sense due to Intel's plans).kataklinger wrote:Yes there is 8259 in every PC but it is an ancient interrupt controller, but APIC is much newer, and AFAIK it is present on every modern motherboard.Mikae wrote:As I understand, 8259 are used in every Intel's system chipset. Isn't it? Also, it was always a miracle for me, how interrupts are delivered to CPU. I knew something, but now I want to know in details.
For something like a single CPU Pentium III system it's likely there is no I/O APIC, and the I/O APIC can be more work to setup. IMHO unless you're writing a "64-bit only" OS it'd be worthwile learning about the PIC (and then learning about I/O APICs after that).
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Hi,
BTW to get a better pespective, it might be a fun to see how "8259A compatability" is implemented in a modern chipset - for an example, take a look at the datasheet for Intel's 865 chipset I/O controller hub.
Cheers,
Brendan
Doh! I was reading information for the protocol used for MCS-80, instead of the protocol that is used by 8086.Mikae wrote:What do you mean? As I undesrtand, 8259 keeps silence after the first INTA and sends interrupt vector to data bus after the second INTA.- the master PIC sends a one byte code to the host to tell it the details on the way
BTW to get a better pespective, it might be a fun to see how "8259A compatability" is implemented in a modern chipset - for an example, take a look at the datasheet for Intel's 865 chipset I/O controller hub.
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Well, I think I understood, when CAS lines are needed. I didn't pay attetion for this paragraphs:
cause I didn't understand, why SP/EN is needed. Now I think, that SP means, that a number of slaves are presented.a. In the master mode (either when SP = 1, or in
buffered mode when M/S = 1 in ICW4) a ''1'' is
set for each slave in the system. The master then
will release byte 1 of the call sequence (for MCS-
80/85 system) and will enable the corresponding
slave to release bytes 2 and 3 (for 8086 only byte
2) through the cascade lines.
b. In the slave mode (either when SP = 0, or if BUF
= 1 and M/S = 0 in ICW4) bits 2-0 identify the
slave. The slave compares its cascade input with
these bits and, if they are equal, bytes 2 and 3 of
the call sequence (or just byte 2 for 8086) are
released by it on the Data Bus.
Hi,
Of course nothing is quite that simple. For "many" EISA systems and (all?) PCI systems it's possible to set individual interrupt lines as either edge triggered or level triggered using I/O port 0x4D0 (for the master PIC's interrupts) and I/O port 0x4D0 (for the slave PIC's interrupts). I'm not too sure if this was originally done using an extra/external chip in conjunction with an 8259, or if true 8259 chips had stopped being used.
In general, all ISA/legacy devices generate edge triggered interrupts (which makes interrupt sharing impossible), and all PCI devices general level triggered interrupts (which makes interrupt sharing possible). I'm not sure about other bus types...
Cheers,
Brendan
For 80x86, the interrupt lines connected to the PIC are "edge triggered" (or "low-to-high transitions" are used to signal an IRQ to the PIC).Mikae wrote:How I can to determine, which mode, 'low-to-high transition' or just 'high level' uses my hardware to bring interrupt request to IR0-7? This is connected to ICW1, LTIM value.
Of course nothing is quite that simple. For "many" EISA systems and (all?) PCI systems it's possible to set individual interrupt lines as either edge triggered or level triggered using I/O port 0x4D0 (for the master PIC's interrupts) and I/O port 0x4D0 (for the slave PIC's interrupts). I'm not too sure if this was originally done using an extra/external chip in conjunction with an 8259, or if true 8259 chips had stopped being used.
In general, all ISA/legacy devices generate edge triggered interrupts (which makes interrupt sharing impossible), and all PCI devices general level triggered interrupts (which makes interrupt sharing possible). I'm not sure about other bus types...
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.