8051 microcontroller interrupts

The 8051 microcontroller supports six interrupt sources  reset, two hardware interrupts, two timer interrupts, and a serial communication interrupt:

Interrupt number Description Offset in bytes
Reset 0
0 External interrupt INT0 3
1 Timer 0 (TF0) 11
2 External interrupt INT1 19
3 Timer 1 (TF1) 27
4 Serial  36

The interrupt vector array is located at address 0; each entry except reset is 8 bytes in size. Though a minimal ISR can fit into 8 bytes, normally, the entries contain code that redirects execution to the actual ISR located elsewhere.

The reset entry is special. It is activated by the reset signal and immediately jumps to the address where the main program is located.

8051 defines a special register called Interrupt Enable (EA), which is used to enable and disable interrupts. Its 8-bits are allocated in the following way:

Bit  Name Meaning
0 EX0 External Interrupt 0
1 ET0 Timer 0 Interrupt
2 EX1 External Interrupt 1
3 ET1 Timer 1 Interrupt
4 ES Serial Port Interrupt
5 - Not used
6 - Not used
7 EA Global Interrupt Control

 

Setting these bits to 1 enables corresponding interrupts, to 0 disables them. The EA bit enables or disables all interrupts.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.58.121.214