Interrupts in 8051 8051 Micro-controller by Ravinder Nath Rajotiya - December 3, 2021December 3, 20210 Interrupts in 8051 What is an Interrupt: It is a requesting mechanism for the peripherals to make the microcontroller interrupt the currently executing program and run the program to service the request. The program that is run upon the interrupt is called an ISR (interrupt service routine) Types of Interrupts in 8051 There are five different sources of interrupts A real life example - Before going to sleep, you set the timer. Then forget what the timer does, and go for sleep. When the timer finishes the counting, it alarms and interrupts you from sleep. You then wake and starts doing your routine. sources of interrupt in 8051 are: Timer-0: Timer-0 interrupts Timer-1: Timer-1 interrupts Serial Rx/Tx INT0 INT1 All interrupts in 8051 are vectored interrupts Interrupt
8051 Timers 8051 Micro-controller by Ravinder Nath Rajotiya - December 3, 20210 Timers in 8051 There are two timer in 8051, Timer-0, Timer-1;--- Use of timers: To produce precise delay timing Counting the events Generating baud rate Registers associated with timer operation are: TMOD 89h TCON 88h TH0 8Ch TL0 8Ah TH1 8Dh TL1 8Bh Format of TMOD and TCON registers TMOD SFR (89h) Timer-1 Timer-0 D7 D6 D5 D4 D3 D2 D1 D0 Gate C’/T M1 M0 Gate C’/T M1 M0 1: COUNT only if INT1 (P3.3) input pin is high 0-count regardless of INT1 1- Count pulses on pin T1(P3.5) 0- Count every machine cycle 00 Mode-0; 13 bit timer 01- Timer 16 bit 10 mode-2; 8-bit auto reload 11- Split timer mode 1: COUNT only if INT0 (P3.3) input pin is high 0-count regardless of INT0 1 Count pulses on pin T1(P3.5) Count eevery machine cycle 00 Mode-0; 13 bit timer 01- Timer 16 bit 10 mode-2; 8-bit auto reload 11- Split timer mode Timer Control SFR Timer Control TCON SFR (88h) Bits D7 D6 D5 D4 D3 D2 D1 D0 Bit Address 8F 8E 8D 8C 8B 8A 89 88 Bit Name TF1 TR1 TF0 TR0 IE1 IT1 IE0 IT0 Description Timer-1
8051 Internal Architecture 8051 Micro-controller by Ravinder Nath Rajotiya - April 19, 2019May 8, 20220 8051 Internal Architecture 8051 microcontroller was developed by Intel in 1980s. It is an 8-bit controller and is based on Harvard Architecture which uses two separate memory for storing program and data. The internal architecture describes the organization of the internal components of 8051. Figure 5.1 shows the internal architecture of 8051. Internal components of 8051 Internal Memory: 8051 has two separate memory blocks these are program memory (ROM) and data memory (RAM). Data Memory RAM is used as data memory. 8051 has 256 byte of direct addressable memory and 128 byte indirect addressable memory. 256 Byte RAM includes four register banks named bank 3 through bank 0. Each bank contains 8-register each of 8-bits. they are name R7 through R0. It also include 16