8051 Microcontroller
8051 Microcontroller
Microcontroller Vs Microprocessor
Microcontroller Vs Microprocessor
●
Microprocessor is heart of Computer system.
●
Micro Controller is a heart of embedded
system.
8051 - Introduction
• It is introduced by INTEL in the Year 1981
• Initially the 8051 microcontroller was made up of NMOS technology which consumed
more power. To overcome this issue , INTEL relaunched the 8051 microcontroller using
CMOS technology and named it as 80C51
• After the Success of the 8051 microcontrollers , INTEL allowed other manufacturers to
develop 8051 microcontrollers under their own brand.
• Microchip, Zilog, Atmel, Philips, Siemens released products under their brand name.
• Coding for 8051 can be written in Assembly language and also in C language
8051
Altera
Suppliers
Infineon
Analog Devices Intel
Lattice Semiconductor
Atmel
Maxim Integrated
Cypress Semiconductor Microchip Technology
Dallas Semiconductor National Semiconductor
ELAN Microelectronics Corp. NEC
NXP Semiconductors
Energy Micro
Panasonic
EPSON Semiconductor
Free scale Semiconductor
Fujitsu
Hyperstone
8051 Pin Configuration
Features of 8051
•4KB bytes on-chip program memory (ROM)
•128 bytes on-chip data memory (RAM)
•Four register banks
•128 user defined software flags
•8-bit bidirectional data bus
•16-bit unidirectional address bus
•32 general purpose registers each of 8-bit
•16 bit Timers (usually 2, but may have more or less)
•Three internal and two external Interrupts
•Four 8-bit ports,(short model have two 8-bit ports)
•16-bit program counter and data pointer
•8051 may also have a number of special features such
as UARTs, ADC, Op-amp, etc
Review
• NO Pins in 8051
40
Power Supply for 8051
5v
Ground Pin Number in 8051
20
Power Pin Number in 8051
40
Number of Ports in 8051
4
Ram Size
128 Bytes
Rom Size
4kb
GPIO Ports
GPIO – General Purpose input and Output Ports
●
The microprocessor is a single-chip CPU.
●
The microcontroller is a single-chip
●
RAM and ROM are not incorporated within microcomputer system
chip
●
RAM is smaller, but it is enough for small
●
Multi Tasking applications.(If it is not sufficient, then external
memory may be added in the microcontroller-
based system)
●
Single Tasking
P0.0 – P0.7 P2.0 – P2.7
B Register ACC
Program
Address TMP1 TMP2 Stack Pointer
Register
Program
Interrupt, Serial Port and
PSW
Counter Timer Block PSEN
Instruction Timing & ALE
DPTR Register Control EA
8 bit Data Bus RST
B Register ACC
Program
Address TMP1 TMP2 Stack Pointer
Register
Program
Interrupt, Serial Port and
PSW
Counter Timer Block PSEN
Instruction Timing & ALE
DPTR Register Control EA
8 bit Data Bus RST
The ALU performs 8-bit arithmetic and logical operations when the operands are held at the temporary registers TMP1
and TMP2.
These temporary registers cannot be accessed by users.
The output of the ALU is stored in the accumulator in most of the arithmetic and logical operations with few exceptions.
Apart from addition and subtraction operations, the 8051 microcontroller also performs multiplication and division
operations.
The logical operations such as AND, OR, NOT, Ex-OR operations are also performed in ALU.
Accumulator
• The accumulator register (ACC) acts as an operand register.
• ACC is commonly used for data transfer and arithmetic instructions.
• The accumulator is also bit addressable.
• After any arithmetic operations, the result is stored in ACC.
B register
• The B register is used during multiply and divide operations to store the second operands for multiply and
divide instructions MUL AB and DIV AB respectively.
• After multiplication and division, a part of the result such as upper 8 bits of multiplication result and
remainder in case of division are stored in the B register.
• This register is commonly used as a temporary register
• This register is also bit addressable.
• It can be used as a general-purpose register except for MUL and IDIV instructions.
PSW(Program Status Word)
B Register ACC
Program
Address TMP1 TMP2 Stack Pointer
Register
Program
Interrupt, Serial Port and
PSW
Counter Timer Block PSEN
Instruction Timing & ALE
DPTR Register Control EA
8 bit Data Bus RST
B Register ACC
Program
Address TMP1 TMP2 Stack Pointer
Register
Program
Interrupt, Serial Port and
PSW
Counter Timer Block PSEN
Instruction Timing & ALE
DPTR Register Control EA
8 bit Data Bus RST
B Register ACC
Program
Address TMP1 TMP2 Stack Pointer
Register
Program
Interrupt, Serial Port and
PSW
Counter Timer Block PSEN
Instruction Timing & ALE
DPTR Register Control EA
8 bit Data Bus RST
B Register ACC
Program
Address TMP1 TMP2 Stack Pointer
Register
Program
Interrupt, Serial Port and
PSW
Counter Timer Block PSEN
Instruction Timing & ALE
DPTR Register Control EA
8 bit Data Bus RST
B Register ACC
Program
Address TMP1 TMP2 Stack Pointer
Register
Program
Interrupt, Serial Port and
PSW
Counter Timer Block PSEN
Instruction Timing & ALE
DPTR Register Control EA
8 bit Data Bus RST
B Register ACC
Program
Address TMP1 TMP2 Stack Pointer
Register
Program
Interrupt, Serial Port and
PSW
Counter Timer Block PSEN
Instruction Timing & ALE
DPTR Register Control EA
8 bit Data Bus RST
B Register ACC
Program
Address TMP1 TMP2 Stack Pointer
Register
Program
Interrupt, Serial Port and
PSW
Counter Timer Block PSEN
Instruction Timing & ALE
DPTR Register Control EA
8 bit Data Bus RST
B Register ACC
Program
Address TMP1 TMP2 Stack Pointer
Register
Program
Interrupt, Serial Port and
PSW
Counter Timer Block PSEN
Instruction Timing & ALE
DPTR Register Control EA
8 bit Data Bus RST
B Register ACC
Program
Address TMP1 TMP2 Stack Pointer
Register
Program
Interrupt, Serial Port and
PSW
Counter Timer Block PSEN
Instruction Timing & ALE
DPTR Register Control EA
8 bit Data Bus RST