Intro

In this tutorial we will look at 8051 Interrupts. Interrupts are useful in many cases wherein the process simply wants to continue doing it's main job and other units(timers or external events) seek its attention when required. In other words the microcontroller, need not monitor the timers, the serial communication or the external pins P3.2 and P3.3. Whenever an event related to these units occur, it is informed to microcontroller with the help of interrupts.

Basics

For the 8051 Microcontroller there are six interrupt sources as shown in the table below:

Table. 1: Interrupt Vector Table
Interrupt ROM Location(Hex) Pin Flag Clearing
Reset 0000 9 Auto
External HW Interrupt 0 (INT0) 0003 P3.2(12) Auto
Timer 0 Interrupt(TF0) 000B - Auto
External HW Interrupt 1 (INT1) 0013 P3.3(13) Auto
Timer 1 Interrupt(TF1) 001B - Auto
Serial Com Interrupt(RI and TI) 0023 - Program SW


Schematic

8051Interupt.JPG