Interrupt - MCS51
Interrupt - MCS51
Interrupt - MCS51
setb ea
setb exo
setb ex1
External Interrupt
Initialization
IP (Interrupt Priority)
Pin 0 : PX0 (Priority on Ext Int 0)
Pin 2 : PX1 (Priority on Ext Int 1)
setb px0
setb px1
External Interrupt
Interrupt Vector
When the interrupt signal detected, microcontroller
will stop the program that is running, and execute
the program in the interrupt vector
Place (memory) where the Interrupt Service
Routine are stored
External Interrupt
Interrupt Vector
EXT0 03h
EXT1 13h
ET0 0bh
ET1 1bh
ES 23h
org 03h
……… // write your program here
reti
External Interrupt
Interrupt Vector
org 03h
lcall isr_ext0
reti
...
org 100h
isr_ext0:
……… // write your program here
ret
External Interrupt