Architecture of 8051 Microcontroller: Microcontrollers
Architecture of 8051 Microcontroller: Microcontrollers
Microcontroller
MICROCONTROLLERS
8051
Architecture of 8051
The 8051 Architecture consist of these
specific features
The 8 bit CPU with Registers A and B
Internal ROM (4Kb)
16-bit program counter(PC) and data pointer(DPTR)
Internal RAM of 128 bytes:
Four Register Banks, each containing eight bit registers
Sixteen bytes which might addressed at bit level
Eighty bytes of general-purpose data memory
8-bit Program Status word(PSW)
Two 16 bit Counter / timers: T0,T1
32 input/output pins [4 eight-bit ports P0-P3]
3 internal interrupt and 2 external interrupt
sources.
Control registers: TCON,TMOD,SCON,PCON,IP,IE
Full Duplex Data Transmitter and Reciever: SBUF
Oscillator and clock circuits.
The 8051 oscillator and clock
Clock pulses are used synchronization of internal
operations.
XTAL1 and XTAL2 are provided for connecting a
resonant network from an oscillator.
Typically a Quartz crystal and capacitors are
employed.
Frequency range: 1-16MHz.
Some internal memories are dynamic and must
operate above a minimum frequency or data will be
lost.
Ceramic resonators have low cost, but poor freq
stability and accuracy.
Oscillator circuit and timing
The 8051 oscillator and clock
f: Clock frequency, P: Pulse Time (Minimum interval of
time).
A machine cycle is minimum amount time must take by
simplest machine instruction.
An 8051 machine cycle is made up of six states.
A state is the basic time interval for discrete operations
of the MC such as fetching opcode byte, decoding an
opcode, executing an opcode, or writing a data byte.
Program instructions may require one or two or four
machine cycles to be executed, depending on the type
of instruction.
• Instructions are fetched and executed by the MC
automatically beginning from 0000h of ROM.
• Time required for any instruction:
Tinst=Cx12d/Crystal Freq;
C- Number of cycles
Example:
For ADD A,R1 C=1. If crystal freq=16MHz
Tinst= 0.75 mirco seconds.
• ALE- Timing pulse for external memory access.
• Two bytes can be fetched and executed in one
machine cycle.
• Single byte instructions will throw away
second byte for first byte next instruction.
Program counter (PC)
The program counter points to the address of the next
instruction to be Executed
As the CPU fetches the opcode from the program ROM,the
program counter is increasing to point to the next instruction.
1.Working register:
Thirty-two bytes from address 00h to 1Fh that make up 32 working register
organized as Four bank of eight bit each.
Bits RS0 and RS1 in the PSW determine which bank of register is currently
Is use.
Bank 0 is selected upon reset
2.Bit addressable:
A bit addressable area of 16 bytes occupies RAM bytes addresses 20h to
2Fh,forming a total of 128 addressable bits.
An addressable bit may be specified by its bit address of 00h to 7Fh.
3.General purpose:
A general-purpose RAM area above the bit area,form 30h to 7Fh,addresable
as bytes.
Internal RAM Organization