What is an interrupt?
An interrupt is an asynchronous signal that needs attention. An interrupt stops the CPU of a microcontroller, leaving the tasks that it is currently doing, to give attention to the interrupt signal. Once the attention has been given to the interrupt signal, the CPU goes back to its unaccomplished task before the interrupt has occured and continues the task.
The Interrupts of AT89C2051
The interrupts of AT89C2051 is compatible with the interrupts of the original 8051 microcontroller. It has 6 interrupts sources ( 5 interrupts + RESET). The interrupt sources of AT89C2051 are the following:
| Interrupt | Source | Priority Number | |
| 1 | RESET | RST | N/A |
| 2 | External Interrupt 0 | IE0 | 0 |
| 3 | Timer 0 Interrupt | TF0 | 1 |
| 4 | External Interrupt 1 | IE1 | 2 |
| 5 | Timer 1 Interrupt | TF1 | 3 |
| 6 | UART Interrupt | RI or TI | 4 |
Please note that in this tutorial, we will not consider the interrupt from RESET.
The table above shows the interrupt sources of AT89C2051 and their respective interrupt priority number. Knowing the priority number is important specially if two different interrupt sources occur at the same time. [Read more...]













Recent Comments