8051 Micro Controller
8051 Micro Controller
8051µc is a 8bit microcontroller introduced by Intel Corporation in 1981 which comes in 40 pin
dual inline package (DIP).
It has 4KB of inbuilt ROM i.e onchip program space.
It has 128bytes of inbuilt RAM space and if required external memory of 64KB can be interfaced
to the microcontroller.
There are 4 parallel 8bit ports namely port 0, port 1, port 2 and port 3 which are addressable as
well as programmable.
It has an onchip crystal oscillator with crystal frequency 11.0592MHz (~12MHz).
It has full duplex serial I/O port having two pins namely TxD, RxD.
It has two 16bit timers namely Timer 0 and Timer 1 which can be used either as timer for internal
operation or as counter for external operation.
It has five interrupt sources. All of them are maskable as well as vector interrupts. They are
External Interrupt 0, Timer Interrupt 0, External Interrupt 1, Timer Interrupt 1, Serial Port Interrupt.
The programming mode of this microcontroller consists of general purpose registers (GPRs),
Special Purpose Registers (SPRs) and Special Function Registers (SFRs).
The instruction set of 8051 µc consists of more number of bit manipulations or boolean variable
manipulation group of instructions. The instructions are very much useful to manipulate SFR bits
and also port pins.
1
8051 Microcontroller
It provides 4 special purpose registers – 16bit Program Counter (PC), 8bit Stack Pointer (SP),
16bit Data Pointer and 8bit Program Status Word (PSW).
It also provides few Special Function Registers. They are TMOD, TCON, IE, IP, SBUF, SCON,
PCON.
The 128bytes onchip RAM of 8051 µc is divided into three portions as given below.
o 00H – 1FH : These 32bytes are arranged as 4 register banks namely Bank 0, Bank 1,
Bank 2, Bank 3 where each bank consists of 8 registers namely R0 through R7.
2
8051 Microcontroller
Pin diagram
Port 0 and Port 2: If input pin is grounded then port 0 acts as lower order 8bit address data
bus where as port 2 acts as higher order 8 bit address bus.
Port 3: Each and every pin in this port offer some separate functionality irrespective of level at
input pin.
3
8051 Microcontroller
4
8051 Microcontroller
(Program Store Enable) This is an output pin. For opcode fetch operation,
microcontroller asserts output pin as low which can be used for selecting the external program
memory chip. This can also be used as ROM read control signal.
5
8051 Microcontroller
Instruction Set
6
8051 Microcontroller
7
8051 Microcontroller
8
8051 Microcontroller