SlideShare a Scribd company logo
1 of 20
8051 Microcontroller
8051 Basics
8051 is a generic part number
Family range from 8031-8751
Available in NMOS, CMOS
40 pin DIP
8051 Architecture
Oscillator
Clock pulses by which internal operations are synchronized
Pins XTAL1 and XTAL2 to form an oscillator
Quartz crystal and capacitors are used
Crystal frequency is the microcontroller frequency
8051 can run at 1-16MHz.
Ceramic resonators can be used - but not accurate
Clock frequency f
Smallest interval of time -pulse P- time taken to complete one simple instruction
Program Counter
8051 has 2 16 bit registers - one for program counter(PC), one for data pointer
(DPTR)
Used to hold the address of a byte in memory
Program instruction bytes are fetched from locations in memory that are
addressed by the PC
After every fetch the PC in incremented.
Does not have an internal address
Data pointer
Made up of 2 8 bit registers, DPH, DPL
This under the control of program instructions
Used to store addresses for internal and external code access
A and B CPU registers
Math or CPU Registers are A and B Registers from these two Register Accumulator or Register A is the most important
and most used 8051 Microcontroller SFRs. The Register A is located at the address E0H in the SFR memory space. The
Accumulator is used to hold the data for almost all the ALU Operations.
Some of the operations where the Accumulator is used are:
● Arithmetic Operations like Addition, Subtraction, Multiplication etc.
● Logical Operations like AND, OR, NOT etc.
● Data Transfer Operations (between 8051 and External Memory)
The name “Accumulator” came from the fact this register is used to accumulate (or store) the result of all Arithmetic and
most of the Logical Operations.
Register B
The B Register is used along with the ACC in Multiplication and Division operations. These two operations are
performed on data that are stored only in Registers A and B. During Multiplication Operation, one of the operand
(multiplier or multiplicand) is stores in B Register and also the higher byte of the result.
In case of Division Operation, the B Register holds the divisor and also the remainder of the result. It can also be
used as a General Purpose Register for normal operations and is often used as an Auxiliary Register by
Programmers to store temporary results.
Register B is located at the address F0H of the SFR Address Space.
Ex: MUL A,B – When this instruction is executed, data inside A and data inside B is multiplied and answer is stored in A.
Register B can also be used for other general purpose operations.
Flags and Program Status Word (PSW)
The PSW or Program Status Word Register is also called as Flag Register and is one of the
important SFRs. The PSW Register consists of Flag Bits, which help the programmer in checking
the condition of the result and also make decisions.
Flags are 1-bit storage elements that store and indicate the nature of the result that is generated
by execution of certain instructions. The following image shows the contents of the PSW Register.
The following table describes the function of each flag.
Internal memory
Internal RAM
● 8051 has 128 B internal Random Access
Memory.
● Data Memory is used for temporarily
storing data and intermediate results
created and used during the operation of
the microcontroller.
● It mainly contains register banks ,
Read/write data, bit addressable
registers and stack.
● Address range is 0000H to FFFFH.
● PSEN(bar) is used to allow usage of
Internal ROM or not
Stack pointer
● Stack pointer is a small (8bit) register that stores
address of the last program request in a stack
● It is a specialized buffer which store data from
the top to down
● Direct address of SP is 81H and it is only byte
addressable
Which means can’t access individual bits
of stack pointer
● After a system reset SP is initialized as 07H and
data can be stored to stack from 08H onwards
● To store something new in system stack, the SP
must be incremented by 1 first and then execute
the “store” command
Special Function registers
● A Special Function Register (or Special
Purpose Register, or simply Special Register) is
a register within a microprocessor that controls
or monitors the various functions of a
microprocessor.
● The 8051 Microcontroller Special Function
Registers are used to program and control
different hardware peripherals like Timers,
Serial Port, I/O Ports etc.
● some special registers in some processor
architectures require special instructions to
modify them.
● In fact, by manipulating the 8051
Microcontroller Special Function Registers
(SFRs).
● Internal RAM Structure, the Address Space
from 80H to FFH is allocated to SFRs.
● The main difference of the SFRs is the address
space
Internal ROM
● The original 8051 Microcontroller by Intel has 4KB of internal ROM.
● Some variants of 8051 like the 8031 and 8032 series doesn’t have any internal ROM (Program
Memory) and must be interfaced with external Program Memory with instructions loaded in it.
● In case of 4KB of Internal ROM, the address space is 0000H to 0FFFH.
● ignore the Internal ROM and fetch all the instructions only from the External Program Memory (External
ROM).
Input / Output pins
● There are 40 input/output pins in 8051 microcontroller.
● Only 32 input/output pins allow the microcontroller to be connected with the peripheral
devices.
● The rest of the pins are dedicated to VCC, GND, XTAL1, XTAL2, RST, ALE, EA’ and PSEN’.
Pins 1 to 8 These pins don’t serve any other functions. It is internally pulled up, bi-directional I/O
port.
Pin 9 Used to reset the microcontroller to its initial values.
Pins 10 to 17 Serves some functions like interrupts, timer input, control signals, serial communication
signals RxD and TxD, etc.
Pins 18 & 19 Used for interfacing an external crystal to get the system clock.
Pin 20 This pin provides the power supply to the circuit.
Pins 21 to 28 Higher order address bus signals are also multiplexed using this port.
Pin 29 Used to read a signal from the external program memory.
Pin 30 Used to enable/disable the external memory interfacing.
Pin 31 Used to demultiplex the address-data signal of port.
Pins 32 to 39 Lower order address and data bus signals are multiplexed using this port.
Pin 40 Used to provide power supply to the circuit.
Ports of the 8051 microcontroller
● There are 4 I/O ports each of 8 bit.
● According to the ports of ,
Port 0
❖ There are two functions of the characterized.
❖ When the external memory is used lower address byte(address (AOA7) is applied on it.else all bits of this port are configured as I/O.
❖ When P0 port is configured as an output then other ports consisting of pins with built-in pull up resistor connected by 5v power supply.
Port 1
❖ It is a true I/O port also does not have any alternative functions as in P0.
❖ This port can be generally configured as general I/O only.
❖ It has a built-in built-up resistor and is completely compatible with TTL circuits.
Port 2
❖ It is a similar to P0 when the external memory is used.
❖ Port 2 is can be used for higher address byte with addresses A8-A15.
❖ This port can be used as a general I/O port similar port 1 when the memory is no added
Port 3
❖ Therefore ,functions are similar to other ports except that the logic 1 must be applied to appropriate bit of the P3 register.
Counters
A counter is a device that stores (and sometimes displays) the number of times a particular event or
process occurred, with respect to a clock signal. It is used to count the events happening outside the
microcontroller. In electronics, counters can be implemented quite easily using register-type circuits such
as a flip-flop.
The Counter different as a timer given this below point
● The register is incremented considering 1 to 0 transition at its corresponding to an external input pin
(T0, T1).
● Maximum count rate is 1/24 of the oscillator frequency.
● A counter uses an external signal to count pulses.
Timers
● A timer is a specialized type of clock that is used to measure time intervals. A timer that counts from zero upwards for
measuring the time elapsed is often called a stopwatch.
● The 8051 has two timers, Timer 0 and Timer 1. They can be used as timers or as event counters. Both Timer 0 and Timer 1
are 16-bit wide. Since the 8051 follows an 8-bit architecture, each 16 bit is accessed as two separate registers of low-byte
and high-byte.
Timer 0 Register
● The 16-bit register of Timer 0 is accessed as low- and high-byte. The low-byte register is called TL0 (Timer 0 low byte) and
the high-byte register is called TH0 (Timer 0 high byte). These registers can be accessed like any other register. For
example, the instruction MOV TL0, #4H moves the value into the low-byte of Timer #0.
Timer 1 Register
● The 16-bit register of Timer 1 is accessed as low- and high-byte. The low-byte register is called TL1 (Timer 1 low byte) and
the high-byte register is called TH1 (Timer 1 high byte). These registers can be accessed like any other register. For
example, the instruction MOV TL1, #4H moves the value into the low-byte of Timer 1.
TMOD (Timer Mode) Register
● Both Timer 0 and Timer 1 use the same register to set the various timer operation modes. It is an 8-bit register in which the
lower 4 bits are set aside for Timer 0 and the upper four bits for Timers. In each case, the lower 2 bits are used to set the
timer mode in advance and the upper 2 bits are used to specify the location.
interrupts
Type of interrupts in 8051 Microcontroller
The 8051 microcontroller can recognize five different events that cause the main program to interrupt from the normal execution.
1. Timer 0 overflow interrupt- TF0
2. Timer 1 overflow interrupt- TF1
3. External hardware interrupt- INT0
4. External hardware interrupt- INT1
5. Serial communication interrupt- RI/TI
These external interrupts can be edge triggered or level triggered. When an interrupt occurs, the microcontroller executes
the interrupt service routine so that memory location corresponds to the interrupt that enables it.

More Related Content

Similar to 8051 Microcontroller Architecture Overview

UNIT 4 8051Microcontroller.pptx
UNIT 4 8051Microcontroller.pptxUNIT 4 8051Microcontroller.pptx
UNIT 4 8051Microcontroller.pptxGowrishankar C
 
8051 Architecture and PIN Configuration.pdf
8051 Architecture and PIN Configuration.pdf8051 Architecture and PIN Configuration.pdf
8051 Architecture and PIN Configuration.pdfSrikrishna Thota
 
Fundamentals of Microcontroller 8051 by Dr. Jogade S M, Assistant Professor, ...
Fundamentals of Microcontroller 8051 by Dr. Jogade S M, Assistant Professor, ...Fundamentals of Microcontroller 8051 by Dr. Jogade S M, Assistant Professor, ...
Fundamentals of Microcontroller 8051 by Dr. Jogade S M, Assistant Professor, ...sangeeta jogade
 
Microcontroller (1).pptx
Microcontroller (1).pptxMicrocontroller (1).pptx
Microcontroller (1).pptxITPradiptaRoy
 
Mmai ppt
Mmai pptMmai ppt
Mmai pptGIT
 
8051 Microcontroller_module_4.1.pptx
8051 Microcontroller_module_4.1.pptx8051 Microcontroller_module_4.1.pptx
8051 Microcontroller_module_4.1.pptxARYAKUMARNIRAV
 
B sc e5.2 mp unit 4 mc-8051
B sc e5.2 mp unit 4 mc-8051B sc e5.2 mp unit 4 mc-8051
B sc e5.2 mp unit 4 mc-8051MahiboobAliMulla
 
Study of 8051 microcontroller
Study of 8051 microcontrollerStudy of 8051 microcontroller
Study of 8051 microcontroller918007165995
 
Unit1 5-mpi-lecture-notes
Unit1 5-mpi-lecture-notesUnit1 5-mpi-lecture-notes
Unit1 5-mpi-lecture-notesPrabhu Mali
 
Microcontroller 8051
Microcontroller 8051Microcontroller 8051
Microcontroller 8051guest70d48b1
 
8051 Microcontroller Overview by Venkatrao Ramisetti
8051 Microcontroller Overview by Venkatrao Ramisetti 8051 Microcontroller Overview by Venkatrao Ramisetti
8051 Microcontroller Overview by Venkatrao Ramisetti VenkatraoRamisetti
 
8051 MICROCONTROLLER ARCHITECTURE.pptx
 8051 MICROCONTROLLER ARCHITECTURE.pptx 8051 MICROCONTROLLER ARCHITECTURE.pptx
8051 MICROCONTROLLER ARCHITECTURE.pptxMemonaMemon1
 

Similar to 8051 Microcontroller Architecture Overview (20)

Micro controller
Micro controllerMicro controller
Micro controller
 
Unit 4.pptx
Unit 4.pptxUnit 4.pptx
Unit 4.pptx
 
UNIT 4 8051Microcontroller.pptx
UNIT 4 8051Microcontroller.pptxUNIT 4 8051Microcontroller.pptx
UNIT 4 8051Microcontroller.pptx
 
8051 Architecture and PIN Configuration.pdf
8051 Architecture and PIN Configuration.pdf8051 Architecture and PIN Configuration.pdf
8051 Architecture and PIN Configuration.pdf
 
Fundamentals of Microcontroller 8051 by Dr. Jogade S M, Assistant Professor, ...
Fundamentals of Microcontroller 8051 by Dr. Jogade S M, Assistant Professor, ...Fundamentals of Microcontroller 8051 by Dr. Jogade S M, Assistant Professor, ...
Fundamentals of Microcontroller 8051 by Dr. Jogade S M, Assistant Professor, ...
 
Ch3 ppt
Ch3 pptCh3 ppt
Ch3 ppt
 
8051.pptx
8051.pptx8051.pptx
8051.pptx
 
Microcontroller (1).pptx
Microcontroller (1).pptxMicrocontroller (1).pptx
Microcontroller (1).pptx
 
Mmai ppt
Mmai pptMmai ppt
Mmai ppt
 
8051 Microcontroller_module_4.1.pptx
8051 Microcontroller_module_4.1.pptx8051 Microcontroller_module_4.1.pptx
8051 Microcontroller_module_4.1.pptx
 
B sc e5.2 mp unit 4 mc-8051
B sc e5.2 mp unit 4 mc-8051B sc e5.2 mp unit 4 mc-8051
B sc e5.2 mp unit 4 mc-8051
 
Study of 8051 microcontroller
Study of 8051 microcontrollerStudy of 8051 microcontroller
Study of 8051 microcontroller
 
Unit1 5-mpi-lecture-notes
Unit1 5-mpi-lecture-notesUnit1 5-mpi-lecture-notes
Unit1 5-mpi-lecture-notes
 
8051
80518051
8051
 
Microcontroller 8051
Microcontroller 8051Microcontroller 8051
Microcontroller 8051
 
Microcontroller 8051
Microcontroller 8051Microcontroller 8051
Microcontroller 8051
 
8051 Microcontroller Overview by Venkatrao Ramisetti
8051 Microcontroller Overview by Venkatrao Ramisetti 8051 Microcontroller Overview by Venkatrao Ramisetti
8051 Microcontroller Overview by Venkatrao Ramisetti
 
module-2.pptx
module-2.pptxmodule-2.pptx
module-2.pptx
 
Microcontroller1
Microcontroller1Microcontroller1
Microcontroller1
 
8051 MICROCONTROLLER ARCHITECTURE.pptx
 8051 MICROCONTROLLER ARCHITECTURE.pptx 8051 MICROCONTROLLER ARCHITECTURE.pptx
8051 MICROCONTROLLER ARCHITECTURE.pptx
 

Recently uploaded

A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfStefano Stabellini
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentationvaddepallysandeep122
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commercemanigoyal112
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 

Recently uploaded (20)

A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentation
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commerce
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 

8051 Microcontroller Architecture Overview

  • 2. 8051 Basics 8051 is a generic part number Family range from 8031-8751 Available in NMOS, CMOS 40 pin DIP
  • 4. Oscillator Clock pulses by which internal operations are synchronized Pins XTAL1 and XTAL2 to form an oscillator Quartz crystal and capacitors are used Crystal frequency is the microcontroller frequency 8051 can run at 1-16MHz. Ceramic resonators can be used - but not accurate Clock frequency f Smallest interval of time -pulse P- time taken to complete one simple instruction
  • 5. Program Counter 8051 has 2 16 bit registers - one for program counter(PC), one for data pointer (DPTR) Used to hold the address of a byte in memory Program instruction bytes are fetched from locations in memory that are addressed by the PC After every fetch the PC in incremented. Does not have an internal address
  • 6. Data pointer Made up of 2 8 bit registers, DPH, DPL This under the control of program instructions Used to store addresses for internal and external code access
  • 7. A and B CPU registers Math or CPU Registers are A and B Registers from these two Register Accumulator or Register A is the most important and most used 8051 Microcontroller SFRs. The Register A is located at the address E0H in the SFR memory space. The Accumulator is used to hold the data for almost all the ALU Operations. Some of the operations where the Accumulator is used are: ● Arithmetic Operations like Addition, Subtraction, Multiplication etc. ● Logical Operations like AND, OR, NOT etc. ● Data Transfer Operations (between 8051 and External Memory) The name “Accumulator” came from the fact this register is used to accumulate (or store) the result of all Arithmetic and most of the Logical Operations.
  • 8. Register B The B Register is used along with the ACC in Multiplication and Division operations. These two operations are performed on data that are stored only in Registers A and B. During Multiplication Operation, one of the operand (multiplier or multiplicand) is stores in B Register and also the higher byte of the result. In case of Division Operation, the B Register holds the divisor and also the remainder of the result. It can also be used as a General Purpose Register for normal operations and is often used as an Auxiliary Register by Programmers to store temporary results. Register B is located at the address F0H of the SFR Address Space. Ex: MUL A,B – When this instruction is executed, data inside A and data inside B is multiplied and answer is stored in A. Register B can also be used for other general purpose operations.
  • 9. Flags and Program Status Word (PSW) The PSW or Program Status Word Register is also called as Flag Register and is one of the important SFRs. The PSW Register consists of Flag Bits, which help the programmer in checking the condition of the result and also make decisions. Flags are 1-bit storage elements that store and indicate the nature of the result that is generated by execution of certain instructions. The following image shows the contents of the PSW Register.
  • 10. The following table describes the function of each flag.
  • 11. Internal memory Internal RAM ● 8051 has 128 B internal Random Access Memory. ● Data Memory is used for temporarily storing data and intermediate results created and used during the operation of the microcontroller. ● It mainly contains register banks , Read/write data, bit addressable registers and stack. ● Address range is 0000H to FFFFH. ● PSEN(bar) is used to allow usage of Internal ROM or not
  • 12. Stack pointer ● Stack pointer is a small (8bit) register that stores address of the last program request in a stack ● It is a specialized buffer which store data from the top to down ● Direct address of SP is 81H and it is only byte addressable Which means can’t access individual bits of stack pointer ● After a system reset SP is initialized as 07H and data can be stored to stack from 08H onwards ● To store something new in system stack, the SP must be incremented by 1 first and then execute the “store” command
  • 13. Special Function registers ● A Special Function Register (or Special Purpose Register, or simply Special Register) is a register within a microprocessor that controls or monitors the various functions of a microprocessor. ● The 8051 Microcontroller Special Function Registers are used to program and control different hardware peripherals like Timers, Serial Port, I/O Ports etc. ● some special registers in some processor architectures require special instructions to modify them. ● In fact, by manipulating the 8051 Microcontroller Special Function Registers (SFRs). ● Internal RAM Structure, the Address Space from 80H to FFH is allocated to SFRs. ● The main difference of the SFRs is the address space
  • 14. Internal ROM ● The original 8051 Microcontroller by Intel has 4KB of internal ROM. ● Some variants of 8051 like the 8031 and 8032 series doesn’t have any internal ROM (Program Memory) and must be interfaced with external Program Memory with instructions loaded in it. ● In case of 4KB of Internal ROM, the address space is 0000H to 0FFFH. ● ignore the Internal ROM and fetch all the instructions only from the External Program Memory (External ROM).
  • 15. Input / Output pins ● There are 40 input/output pins in 8051 microcontroller. ● Only 32 input/output pins allow the microcontroller to be connected with the peripheral devices. ● The rest of the pins are dedicated to VCC, GND, XTAL1, XTAL2, RST, ALE, EA’ and PSEN’.
  • 16. Pins 1 to 8 These pins don’t serve any other functions. It is internally pulled up, bi-directional I/O port. Pin 9 Used to reset the microcontroller to its initial values. Pins 10 to 17 Serves some functions like interrupts, timer input, control signals, serial communication signals RxD and TxD, etc. Pins 18 & 19 Used for interfacing an external crystal to get the system clock. Pin 20 This pin provides the power supply to the circuit. Pins 21 to 28 Higher order address bus signals are also multiplexed using this port. Pin 29 Used to read a signal from the external program memory. Pin 30 Used to enable/disable the external memory interfacing. Pin 31 Used to demultiplex the address-data signal of port. Pins 32 to 39 Lower order address and data bus signals are multiplexed using this port. Pin 40 Used to provide power supply to the circuit.
  • 17. Ports of the 8051 microcontroller ● There are 4 I/O ports each of 8 bit. ● According to the ports of , Port 0 ❖ There are two functions of the characterized. ❖ When the external memory is used lower address byte(address (AOA7) is applied on it.else all bits of this port are configured as I/O. ❖ When P0 port is configured as an output then other ports consisting of pins with built-in pull up resistor connected by 5v power supply. Port 1 ❖ It is a true I/O port also does not have any alternative functions as in P0. ❖ This port can be generally configured as general I/O only. ❖ It has a built-in built-up resistor and is completely compatible with TTL circuits. Port 2 ❖ It is a similar to P0 when the external memory is used. ❖ Port 2 is can be used for higher address byte with addresses A8-A15. ❖ This port can be used as a general I/O port similar port 1 when the memory is no added Port 3 ❖ Therefore ,functions are similar to other ports except that the logic 1 must be applied to appropriate bit of the P3 register.
  • 18. Counters A counter is a device that stores (and sometimes displays) the number of times a particular event or process occurred, with respect to a clock signal. It is used to count the events happening outside the microcontroller. In electronics, counters can be implemented quite easily using register-type circuits such as a flip-flop. The Counter different as a timer given this below point ● The register is incremented considering 1 to 0 transition at its corresponding to an external input pin (T0, T1). ● Maximum count rate is 1/24 of the oscillator frequency. ● A counter uses an external signal to count pulses.
  • 19. Timers ● A timer is a specialized type of clock that is used to measure time intervals. A timer that counts from zero upwards for measuring the time elapsed is often called a stopwatch. ● The 8051 has two timers, Timer 0 and Timer 1. They can be used as timers or as event counters. Both Timer 0 and Timer 1 are 16-bit wide. Since the 8051 follows an 8-bit architecture, each 16 bit is accessed as two separate registers of low-byte and high-byte. Timer 0 Register ● The 16-bit register of Timer 0 is accessed as low- and high-byte. The low-byte register is called TL0 (Timer 0 low byte) and the high-byte register is called TH0 (Timer 0 high byte). These registers can be accessed like any other register. For example, the instruction MOV TL0, #4H moves the value into the low-byte of Timer #0. Timer 1 Register ● The 16-bit register of Timer 1 is accessed as low- and high-byte. The low-byte register is called TL1 (Timer 1 low byte) and the high-byte register is called TH1 (Timer 1 high byte). These registers can be accessed like any other register. For example, the instruction MOV TL1, #4H moves the value into the low-byte of Timer 1. TMOD (Timer Mode) Register ● Both Timer 0 and Timer 1 use the same register to set the various timer operation modes. It is an 8-bit register in which the lower 4 bits are set aside for Timer 0 and the upper four bits for Timers. In each case, the lower 2 bits are used to set the timer mode in advance and the upper 2 bits are used to specify the location.
  • 20. interrupts Type of interrupts in 8051 Microcontroller The 8051 microcontroller can recognize five different events that cause the main program to interrupt from the normal execution. 1. Timer 0 overflow interrupt- TF0 2. Timer 1 overflow interrupt- TF1 3. External hardware interrupt- INT0 4. External hardware interrupt- INT1 5. Serial communication interrupt- RI/TI These external interrupts can be edge triggered or level triggered. When an interrupt occurs, the microcontroller executes the interrupt service routine so that memory location corresponds to the interrupt that enables it.