Microcontrollers - 8051 Interrupts

Interrupts are the events that temporarily suspend the main program, pass the control to the external sources and execute their task. It then passes the control to the main program where it had left off.
8051 has 5 interrupt signals, i.e. INT0, TFO, INT1, TF1, RI/TI. Each interrupt can be enabled or disabled by setting bits of the IE register and the whole interrupt system can be disabled by clearing the EA bit of the same register.

IE (Interrupt Enable) Register

This register is responsible for enabling and disabling the interrupt. EA register is set to one for enabling interrupts and set to 0 for disabling the interrupts. Its bit sequence and their meanings are shown in the following figure.
IE Register
EAIE.7It disables all interrupts. When EA = 0 no interrupt will be acknowledged and EA = 1 enables the interrupt individually.
-IE.6Reserved for future use.
-IE.5Reserved for future use.
ESIE.4Enables/disables serial port interrupt.
ET1IE.3Enables/disables timer1 overflow interrupt.
EX1IE.2Enables/disables external interrupt1.
ET0IE.1Enables/disables timer0 overflow interrupt.
EX0IE.0Enables/disables external interrupt0.

IP (Interrupt Priority) Register

We can change the priority levels of the interrupts by changing the corresponding bit in the Interrupt Priority (IP) register as shown in the following figure.
  • A low priority interrupt can only be interrupted by the high priority interrupt, but not interrupted by another low priority interrupt.
  • If two interrupts of different priority levels are received simultaneously, the request of higher priority level is served.
  • If the requests of the same priority levels are received simultaneously, then the internal polling sequence determines which request is to be serviced.
IP Register
-IP.6Reserved for future use.
-IP.5Reserved for future use.
PSIP.4It defines the serial port interrupt priority level.
PT1IP.3It defines the timer interrupt of 1 priority.
PX1IP.2It defines the external interrupt priority level.
PT0IP.1It defines the timer0 interrupt priority level.
PX0IP.0It defines the external interrupt of 0 priority level.

TCON Register

TCON register specifies the type of external interrupt to the microcontroller.

Related Posts:

  • PIC Microcontroller Software Setup MPlab In this tutorial we will see how to setup a Mplabx project to generate .hex file for Pic16f877a MPLABx Setup Steps Step1: Open the MPLABx software and select the New project from File Menu as shown below. Step2:&nbs… Read More
  • 8051 Led Blinking 8051 Ports 8051 has 32-gpio's grouped into 4-Ports namely P0-P3 as shown in the below table. PORTNumber of PinsAlternative Function P08 (P0.0-P0.7)AD0-AD7 (Address and Data bus) P18 (P1.0-P1.7)None P28 (P2.0-P2.7)A8-A15… Read More
  • 8051 LED On OFF control with Pushbutton Hardware Connections: Push button switch is connected to the first bit of PORT 0 (P0.0) which is configured as an input pin. Which is connected to a pull up resistor as there is NO INTERNAL PULL UP RESISTORS FOR PORT… Read More
  • 8051 8 Bit mode Interfacing LCD Display using Keil C – AT89C51 Liquid Crystal Display (LCD): 16x2 LCD can be interfaced with microcontroller in 4 Bit or 8 Bit mode. These differs in how data is send to LCD. In 8 bit mode to write a character, 8 bit ASCII data is send through the data l… Read More
  • PIC16f877a 8 Bit mode Interfacing LCD Display using MPlab and Pickit3 Liquid Crystal Display (LCD): 16x2 LCD can be interfaced with microcontroller in 4 Bit or 8 Bit mode. These differs in how data is send to LCD. In 8 bit mode to write a character, 8 bit ASCII data is send through the dat… Read More