Interrupts_general
Interrupts_general
Interrupt ISR
ISR ISR
level execution
4(a): The ISR reads data from 0x8000, 4(b): After being read, P1 de-
modifies the data, and writes the resulting asserts Int.
data to 0x8001.
3: After completing instruction at 100, µP sees Int asserted, saves the PC s value of
100, and sets PC to the ISR fixed location of 16.
4(a): The ISR reads data from 0x8000, modifies the data, and writes the resulting
data to 0x8001.
4(b): After being read, P1 deasserts Int.
! There are four (4) external interrupts associated with Atmel's ATMega8515
AVR microcontroller. Namely: RESET, External Interrupt 0 (INT0), External
Interrupt 1 (INT1) and External Interrupt 2 (INT2).The pins associated with
these interrupts are shown in the figure below.
AVR Interrupt Structure
21
Intel 8259 programmable priority controller
26
Signal Description
D[7..0] These wires are connected to the system bus and are used by the microprocessor to
write or read the internal registers of the 8259.
D[7..0] Intel 8259 IR0
A[0..0] This pin actis in cunjunction with WR/RD signals. It is used by the 8259 to decipher
A[0..0] IR1
RD IR2 various command words the microprocessor writes and status the microprocessor
WR IR3 wishes to read.
INT IR4
INTA IR5 WR When this write signal is asserted, the 8259 accepts the command on the data line, i.e.,
IR6 the microprocessor writes to the 8259 by placing a command on the data lines and
CAS[2..0] IR7 asserting this signal.
SP/EN
RD When this read signal is asserted, the 8259 provides on the data lines its status, i.e., the
microprocessor reads the status of the 8259 by asserting this signal and reading the data
lines.
INT This signal is asserted whenever a valid interrupt request is received by the 8259, i.e., it
is used to interrupt the microprocessor.
INTA This signal, is used to enable 8259 interrupt-vector data onto the data bus by a sequence
of interrupt acknowledge pulses issued by the microprocessor.
SP/EN This function is used in conjunction with the CAS signals for cascading purposes.
27
INT
CPU
PIC
I/O (N)
INTA INT
DATA
D7-D0 BUS CONTROL LOGIC
BUFFER
IR0
RD READ/ IR1
WR WRITE IN- INTERRUPT IR2
A0 LOGIC SERVICE PRIORITY REQUEST IR3
REG RESOLVER REG IR4
(ISR) IR5
CS (IRR)
IR6
IR7
CAS 0 CASCADE
INTERRUPT MASK REG
CAS 1 BUFFER
(IMR)
CAS 2 COMPARATOR
Priority Resolver
! This logic block determines the priorities of the bits
set in the lRR. The highest priority is selected and
strobed into the corresponding bit of the lSR during
the INTA sequence.
Interrupt Mask Register (IMR)
! The lMR stores the bits which disable the interrupt
lines to be masked. The IMR operates on the output
of the IRR. Masking of a higher priority input will not
affect the interrupt request lines of lower priority.
31
CONTROL BUS
INT REQ
DATA BUS (8)
INTERRUPT REQUESTS