3. CONTENTS
Introduction
About 8051
8051 Architecture & Description
Instruction Set
Application of 8051
Programming of 8051
Conclusion
References
4. INTRODUCTION
Nowadays, all the devices of Commercial & Industrial Technologies
are dependent on the Controlling Devices & also on the Computers.
Here, we are going to get some basic knowledge about the 8051
Microcontroller. 8051 & 8085 are most commonly used in nowadays
expansion of technologies.
8051 Microcontroller contents the Programming Unit,
Assembling Unit & Memory Unit in it. So, according to
requirement of user it gives the output.
8051 Microcontroller is also known as the Microcomputers.
5. ABOUT 8051 MICROCONTROLLER
8051 Microcontrollers has numbers of integrated circuits in it. It contains
other support devices like, I/O ports, serial communication interface,
program memory, data memory etc.
Most grew up companies which made useful small integrated chip of 8051
is INTEL, SIEMENS, ATMEL, PHILLIPS etc. First 8051 Controller is
made by INTEL in 1976 under the name MCS-48, which was an 8 bit
microcontroller. Later in 1980 they released a further improved version
(which is also 8 bit), under the name MCS-51.
So, the Microcontroller is most popular integrated chip, which can able to
perform any task by fetching the codes which are delivered by user.
7. DESCRIPTION OF 8051 MICROCONTROLLER
IMPORTANT FEATURES OF 8051 ARCHITECTURE:
HIGH INTEGRATION: It contains Built-in program (ROM) & Data Memory (RAM),
Timers, Interrupt Control, Serial & Parallel Ports.
IMPORTANT COMPONENTS:
Internal clock Oscillator driving the system clock generated from the external Crystal
Oscillator XTAL1 & XTAL2 pins.
Core MCS-51 CPU: It is seems like same as CPU of Computer processor of the logic
execution to instructions & drive process engine.
Interrupt Control Logic: Interrupt from 5 source (2 external : #INT0 & #INT1 & #INT3
Internal : Timer 0, Timer 1 overflow & Serial Interrupt).
128 Byte RAM: Used as Internal Data Memory constitutes Register Banks (00-1FH), Bit
Addressable RAM (20-2FH), User Memory or Scratch Pad (30-7FH).
8. DESCRIPTION OF 8051 MICROCONTROLLER (Cont..)
Two 8 or 16 bit Timer: Timer 0 & Timer 1 operate in 4 possible modes (Mode 0-3) as per
TCON,TMOD,TL0,TL1,TH0,TH1.
ARITHMETIC & LOGICAL UNIT (ALU):
The ALU can perform arithmetic & logical operations on 8 bit data. It can perform arithmetic
operations like, Addition, Subtraction, Multiplication & Division & logical operations like,
AND, OR, EX-OR, COMPLIMENT, ROTATE.
Result of ALU stored in Accumulator.
OSCILLATOR & CLOCK CIRCUIT:
The 8051 has an On- Chip Oscillator, but needs an external clock to run it. The Oscillator
circuit that generates the clock pulse so that all internal operations are synchronized.
Crystal frequency is internal clock frequency.
9. DESCRIPTION OF 8051 MICROCONTROLLER (Cont..)
The Pins XTAL1 & XTAL2 are provided to
connect a resonating comparison network of
Crystal & Capacitor to form an Oscillator.
Normally, Quartz Crystal is used.
The manufacturer provides 8051 design to
run at ranging of 1MHz to 12MHz.
GENERAL PURPOSE REGISTERS:
The register set consist of,
1. Accumulator,
2. Program Counter (PC),
3. Register B,
4. Stack Pointer (SP),
5. Data Pointer (DPTR),
6. Flag Reg. (PSW).
10. DESCRIPTION OF 8051 MICROCONTROLLER (Cont..)
ACCUMULATOR: Accumulator is the 8 bit register. It’s SFR address is E0H. It is a
addressable register.
It is most versatile & holds source operand & receives the result of ALU operations.
It is used for data transfer between 8051 & external memory. It is also used along with
register B for Multiplication & Division operation.
B-REGISTER: The B register used with A register for above mentioned operations.
Other instructions treated as Scratch Pad. It’s SFR address is F0H. It is also a 8 bit
register.
PROGRAM COUNTER (PC): It is a 16 bit register. Used to hold the address of
instruction in memory.
It’s function to keep the track of execution of the program. The program
instruction bytes are fetch from location in memory that are addressed by PC.
11. DESCRIPTION OF 8051 MICROCONTROLLER (Cont..)
Whenever the power supply is switched ON the PC reset to 0000H. PC is automatically
increased after fetching a byte from Memory.
Example: JUMP, CALL, INTRRUPT this may change the content of PC.
DATA POINTER (DPTR): DPTR is 16 bit register. It is used to hold the address of data in
memory. It can be used as a 16 bit data register or two independent 8 bit registers.
It serves as a base register in case of instruction handling Look-Up tables & external data
transfer. For 8 bit operation it works as DPH (8 bit) & DPL (8 bit). SFR address is 82H & 83H.
PROGRAM STATUS WORD (PSW) & FLAGS: Deny instructions affect the Status Flag.
In order to address grouping they form to PSW.
Flags are 1 bit registers provided to store the status of the result of same instruction. Flag is a
flip flop that indicates some condition produced by the execution of the instruction. It’s total
size of 8 bit register. SFR address is D0H.
12. DESCRIPTION OF 8051 MICROCONTROLLER (Cont..)
The 8051 has four math flags including Carry(CY),
Auxiliary Carry(AC), Overflow(OV), Parity(P).
CARRY FLAG: The carry flag will be set when the
carry will generate of borrow out from MSB (D7
bit) of result.
AUXILIARY CARRY FLAG: The AC flag is set
when the carry out of the lower Nibble to higher
Nibble or whenever the borrow from higher Nibble to
lower Nibble.
OVERFLOW FLAG: The OV flag will be set, if an
arithmetic overflow has occurred, i.e.: a significant
bit has been last because of the result exceeded the
capacity of its destination location.
PARITY FLAG: The parity flag is set when the result
has even parity, i.e.: Even numbers of 1’s.
Bit RS0 & RS1 are used to change the Bank
Registers values & F0 flag is user defined flag.
13. DESCRIPTION OF 8051 MICROCONTROLLER (Cont..)
STACK POINTER (SP): The stack is reserved area of
the Memory in RAM where Temporary info. may be
stored. An 8 bit SP is used to hold the address of the
most recent Stack entry.
This location which has the most recent entry is called as
the TOP OF STACK. When the information is written
in Stack, operation is called PUSH. The information is
read on Stack, operation is called POP. Stack works on
the principle of Last in First Out or First in Last Out.
It can take value from 00 to FFH. On Reset on power
up, SP contains the value 07H as in figure.
14. DESCRIPTION OF 8051 MICROCONTROLLER (Cont..)
TIMER & COUNTERS:
8051 has two 16 bits Timer/Counter registers namely Timer 0 (T0) & Timer 1 (T1).
Both these registers can operate as timer or an counter. When used as a “Timer” the register is
programmed to count the internal clock pulse. The internal clock pulse are generated from a
constant clock generator, the count loaded in the register gives constant time. Register
incremented every Machine cycle.
One machine cycle consists 12 Oscillator periods & so the counting rate is 1/12 of
Oscillator frequency.
When used as a “Counter”, the Microcontroller is programmed to count external pulses.
Register is incremented in response to high to low transition of the corresponding external
input pin, T0 & T1.
15. DESCRIPTION OF 8051 MICROCONTROLLER (Cont..)
The counter/Timer is divided into
8 bit registers called the timer
low and high.
19. APPLICATION OF 8051 MICROCONTROLLER
It is used in various fields of day to day life:
Automobile,
Aeronautics,
Space,
Railways,
Mobile Phones,
Washing Machines,
CD/DVD Players,
Cameras & Computers,
Security Alarms,
Robotics & Remote sensing Devices & Radio,
Microwave Owens etc.
20. CONCLUSION
So, by using this kind of Integrated Chip or IC’s we can able to generate
desired projects very easily. Also, it is very easy to deal with the
Programming of 8051.