8051 Microcontroller The 8051 Microcontroller Architecture 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. 1
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
8051 Microcontroller
The 8051 Microcontroller
Architecture
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
Register and Internal RAM organization
8051 µc provides two 8bit general purpose registers – A (Accumulatr) and B. 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.o 20H – 2FH : These 16bytes (128bits) are made available as bit-addressible.bytes.
o 30H – 7FH : These 80 bytes are available as scratch-pad RAM bytes.
2
8051 Microcontroller
Pin diagram
Power Supply pins8051 µc works with +5V DC source applied to Vcc and 0V to Gnd input pin. It has an onchip
crystal clock generator. As such it must be supported externally by connecting a crystal across crystal input XTAL1, XTAL2. It has active hign reset input pin. As such the controller is said to be reset upon application of active hign pulse.
I/O port pinsA total number of 32 I/O pins are provided as port pins divided into 4 ports – port 0,
port 1, port 2 and port 3. All ports are both byte and bit addressable. All ports are programmable. All the ports act as simple input/output ports. All the ports except port 1 offer alternate functions. They are as follows.
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