" /> Interruptions Microcontroller - TN Mikro
Home > English > Interruptions Microcontroller

Interruptions Microcontroller

Interruptions are events or events which caused the microcontroller pause to serve these interruptions. Programs that run at airport interrupt the call Interrupt Service Routine (Routine Service Interruptions). The analogy is as follows: a person is typing reports, suddenly the phone rang and interrupted the person so stop typing jobs and picked up the phone after the phone conversation is finished, then he went back typing workmanship.

Similarly, the microcontroller system that is running programmya, when an interrupt occurs, the program stops for a moment, serve these interruptions by running a program that is at the address designated by the vector of interruptions that occurred until finished and went back to the program that was halted by the interruption. As seen in the figure 1:18. A program that is supposed to go on straight, there is a sudden interruption and the interruption must serve prior to completion before he returned to continue his work.

image

Figure 19 Workflow of interruptions

Most of microcontroller applications involve an incident response is fast enough to control the environment (generally called real-time programming). Interruptions are the only way to real-time programming that can make arrangements well. Five types of interrupts are provided in 8051. Three types are generated automatically from internal operations. Flag Timer 0, timer flag 1, and serial port interrupt (RI or TI). Two types of interrupts triggered by external signal generated by the circuit connected to the INT0 pin and INT1 (P3.2 and P3.3 port pin)

All interrupt functions under program control. Programmers can change the control bits in the register Interrupt Enable (IE), register Interrupt Priority (IP) and registers Timer Control (TCON). The program can block all or a combination of any interruption of the action program with setup and or lawyer-clear-bits an appropriate bit in these registers. IE and IP registers are shown in Fig.

After the interruption is handled by the interrupt routine that was placed by the programmer at the location of the interruption in the program memory, which interrupted the program should start operating when interruptions are given. The program begins again with the PC stores the address in the interrupt on the stack (stack) in RAM before changing the PC to address interruptions in ROM. PC address will be taken from the stack after interrupt ret1 executed at the end of the interrupt routine.

image

Figure 20 Function Register IE and IP

Interrupt Vector
Interrupt vectors are stored value to the program counter at the time of the interruption so that the program will lead to alamt indicated by the program counter. By the time the program leading to the show Interrupt Vector alamt, flags are set for the interrupt will be in clearkan except RI and TI.
Fifth interruption and system reset vector of 89S51 has listed in the table below:

image