Electronic Circuits - Electronic Tutorials - Electronic Hobby Projects - A Complete Electronic Resource Centre

MICROCONTROLLER TUTORIALS - 8051

Videos

Products

Sitemap

Circuits

Tutorials

8051

Introduction

Chapter 1
Types of Memory

Chapter 2
Special Function Registers

Chapter 3
Basic Registers

Chapter 4
Addressing Modes

Chapter 5
Program Flow

Chapter 6
Low Level Information

Chapter 7
Timers

Chapter 8
Serial Port Operations

Chapter 9
Interrupts

Additional Features in 8052

8052 Instruction Set

8051 Microcontroller
Events that Trigger Interrupts

Author : Craig Steiner

Source : 8052.com

What Events Can Trigger Interrupts, and where do they go?

We can configure the 8051 so that any of the following events will cause an interrupt:

  • Timer 0 Overflow.
  • Timer 1 Overflow.
  • Reception/Transmission of Serial Character.
  • External Event 0.
  • External Event 1.

In other words, we can configure the 8051 so that when Timer 0 Overflows or when a character is sent/received, the appropriate interrupt handler routines are called.

Obviously we need to be able to distinguish between various interrupts and executing different code depending on what interrupt was triggered. This is accomplished by jumping to a fixed address when a given interrupt occurs.

Interrupt

Flag

Interrupt Handler Address

External 0

IE0

0003h

Timer 0

TF0

000Bh

External 1

IE1

0013h

Timer 1

TF1

001Bh

Serial

RI/TI

0023h

By consulting the above chart we see that whenever Timer 0 overflows (i.e., the TF0 bit is set), the main program will be temporarily suspended and control will jump to 000BH. It is assumed that we have code at address 000BH that handles the situation of Timer 0 overflowing.


<<< Click here to come back on (8051 - Interrupts)

<<<<  Back to 8051 / 52  Microcontroller Tutorial