Meeting the computing needs of the task at hand efficiently and cost effectively
Speed
Packaging
Power consumption
The amount of RAM and ROM on chip
The number of I/O pins and the timer on chip
How easy to upgrade to higher performance or lower power-consumption versions
Cost per unitIntel introduced 8051, referred as MCS- 51, in 1981.
The 8051 is an 8-bit processor
The CPU can work on only 8 bits of data at a time
The 8051 became widely popular after allowing other manufactures to make and market any flavor of the 8051.
64KB Program Memory address space
64KB Data Memory address space
4K bytes of on-chip Program Memory
128 bytes of on-chip Data RAM
32 bidirectional and individually addressable I/0 lines
Two 16-bit timer/counters
Full duplex UART
6-source/5-vector interrupt structure with two priority levels
On-chip clock oscillator
There are 128 bytes of RAM in the 8051.
Assigned addresses 00 to 7FH
The 128 bytes are divided into 3 different groups as follows:
A total of 32 bytes from locations 00 to 1F hex are set aside for register banks and the stack.
A total of 16 bytes from locations 20H to 2FH are set aside for bit-addressable read/write memory.
A total of 80 bytes from locations 30H to 7FH are used for read and write storage, called scratch pad.
The stack is a section of RAM used by the CPU to store information temporarily.
This information could be data or an address
The register used to access the stack is called the SP (stack pointer) register
The stack pointer in the 8051 is only 8 bit wide, which means that it can take value of 00 to FFH
When the 8051 is powered up, the SP register contains value 07
RAM location 08 is the first location begin used for the stack by the 8051
The storing of a CPU register in the stack is called a PUSH
SP is pointing to the last used location of the stack
As we push data onto the stack, the SP is incremented by one
This is different from many microprocessors
Loading the contents of the stack back into a CPU register is called a POP
With every pop, the top byte of the stack is copied to the register specified by the instruction and the stack pointer is decremented once
The CPU can access data in various ways, which are called addressing modes
Immediate
Register
Direct
Register indirect
External D
These instructions perform several basic operations. After execution, the result is stored in the first operand.
8 bit addition, subtraction, multiplication, increment-decrement instructions can be performed.
MNEMONICS DESCRIPTION BYTE
ADD A, Rn A = A + Rn 1
ADD A, @ Ri A = A+ Ri 1
ADD A, # X A = A + Byte 2
ADDC A, Rn A = A + Rn + C 1
LCALL (long call): 3-byte instruction
2-byte address
Target address within 64K-byte range
ACALL (absolute call): 2-byte instruction
11-bit address
Target address within 2K-byte range
All conditional jumps are short jumps
Target address within -128 to +127 of PC
LJ