SlideShare a Scribd company logo
1 of 31
UNIT 3
•Architecture of 8051
•Special Function Registers(SFRs)
•I/O Pins Ports and Circuits {Pin Diagram}
•Instruction set
•Addressing modes
•Assembly language programming
Architecture of 8051
Features of the 8051 :
• 8 bit CPU with registers A (the accumulator) and B
• 16 bit Program Counter (PC) and Data Pointer (DPTR)
• 8 bit Program Status Word (PSW)
• 64K Program memory address space
• 64K Data memory address space
• 128 bytes of on chip data memory
• 32 I/O pins for four 8 bit ports : Port 0, 1,2 & 3
• Two 16 bit timers / counters : T0 and T1
• Full duplex UART : SBUF
• Two external and three internal interrupt sources
• On chip clock oscillator.
• Central processing unit •
The CPU is the brain of the microcontrollers reading
user’s programs and executing the expected task as
per instructions stored there in.
Primary elements are
• Accumulator (ACC),
• B register (B),
• Stack pointer (SP),
• Program counter (PC),
• Program status word (PSW),
• Data pointer register (DPTR)
• and few more 8 bit registers.
Accumulator:
• The accumulator performs arithmetic and logic
functions on 8 bit input variables.
• Arithmetic operations include basic addition,
subtraction, multiplication and division.
• Logical operations are AND, OR XOR as well as
rotate, clear, complement etc.
• Apart from all the above, accumulator is
responsible for conditional branching decisions
and provides a temporary place in a data transfer
operations within the device
• B Register: used in multiply and divide operations.
• Stack Pointer: 8 bit register.
• This pointer keeps track of memory space where
the important register information are stored when the
program flow gets into executing a subroutine.
• The stack portion may be placed in anywhere in
the onchip RAM.
• Program Counter :
The Program Counter (PC) is the 16 bit register
giving address of next instruction to be executed
during program execution.
It always points to the program memory space
Interrupts :
• The 8051 has five interrupt sources : One from
the serial port (RI / TI) when a transmission or
reception operation is executed.
• Two from the timers (TF0, TF1) when overflow
occurs and two come from the two input pins
INT0, INT1.
• Each interrupt may be independently enabled or
disabled to allow polling on same sources and
each may be classified as high or low priority.
• These operations are selected by Interrupt Enable
(IE) and Interrupt Priority (IP) registers.
Data Pointer Register :
• 16 bit addressing register that can be used to fetch any 8 bit
data from the data memory space.
• When it is not being used for this purpose, it can be used as
two eight bit registers, DPH and DPL.
Program Status Word:
• PSW keeps the current status of the arithmetic and logic
operations in different bits.
• The 8051 has four math flags that respond automatically to
the outcomes of arithmetic and logic operations and 3
general purpose user flags that can be set 1 or cleared to 0
by the programmer as desired.
• The math flags are carry (C), auxiliary carry (AC), overflow
(OV) and parity (P). • User flags are named flag 0 (F0),
Register bank select bits RS0 and RS1.
Input / Output Ports
• 8051 has 32 I/O pins configured as 4 eight bit parallel ports
(P0, P1, P2 and P3).
Timers / Counters
• 8051 has two 16 bit Timers / Counters, T0 and T1 capable of
working in different modes.
• Each consists of a ‘HIGH’ byte and a ‘LOW’ byte which can be
accessed under software.
• There is a mode control register (TMOD) and a control register
(TCON) to configure these timers / counters in number of
ways.
Oscillator and Clock
• Generate clock signal
• Quartz crystal is used for Oscillator
• Pins XTAL 1 and XTAL 2 are provided for connecting a
resonant network to form an oscillator.
SPECIAL FUNCTION REGISTERS (SFRS)
ADDRESSING MODES
• Immediate addressing mode
• Register addressing mode
• Direct addressing mode
• Register indirect addressing mode
• Indexed addressing mode
1.Immediate addressing mode
• This kind of instructions take two bytes and
first one specifies the opcode and second byte
gives the required constant.
• The operand comes immediately after the
opcode. The mnemonic for immediate data is
the pound sign (#).
• This addressing mode can be used to load
information into any of the registers including
DPTR register.
2.Register Addressing Mode
• Register addressing accesses the eight working
registers (R0 - R7 ) of the selected register bank.
• The least significant three bits of the instruction
opcode indicate which register is to be used for
the operation.
• One of the four banks of registers is to be
predefined in the PSW before using register
addressing instruction.
• ACC, B and DPTR can also be addressed in this
mode
3.Direct Addressing Mode
• In the direct addressing mode, all 128 bytes of
internal RAM and the SFRs may be addressed
directly using the single - byte address.
• Internal RAM uses address from 00H to 7FH to
address each byte.
4.Register Indirect Addressing Mode
• Register is used as a pointer to the data.
• If the data is inside the CPU, only registers R0
and R1 are used for this purpose.
• When R0 and R1 hold the addresses of RAM
locations, they must be preceded by the “@”
sign.
5.Indexed Addressing Mode
• Only the program memory can be accessed by this
mode.
• This mode is intended for reading lookup tables in the
program memory.
• A 16 bit base register (DPTR or PC) points to the base of
the lookup tables and accumulator carries the constant
indicating table entry number.
• The address of the exact location of the table is formed
by adding the accumulator data to the base pointer.
Example MOVC A, @A + DPTR
• The contents of A are added to the DPTR to form the
16 bit address of the needed data. ‘C’ means code.
I/O PORTS
Port 0 (P0.0 - P0.7)
• Port 0 is used for both address and data bus (AD0
– AD7 ).
• When the microcontroller chip is connected to an
external memory, Port 0 provides both address
and data.
• ALE pin indicates if Port 0 has address or data.
• When ALE = 0, Port 0 provides data (D0 – D7 ) and
ALE = 1, Port 0 provides address (A0 – A7 ).
• ALE is used for demultiplexing address and data
with the help of a latch.
Port 1 (P1.0 - P1.7):
• Port 1 pins are used as input or output.
• To make port 1 as an input port, write 1 to all its 8
bits.
• To make port 1 as output port, write 0 to all its 8
bits.
• Thus port 1 pins have no dual functions.
Port 2 (P2.0 - P2.7):
• Port 2 pins are used as input / output pins similar
in operation to port 1.
• The alternate use of port 2 is to supply a high
order address byte (A8 – A15) when the
microcontroller is connected to external memory.
Port 3 (P3.0 - P3.7) :
Port 3 pins are used as input or output
INSTRUCTION SET
• Data transfer set
• Arithmetic set
• Logical set
• Boolean variable manipulation set
• Program branching set
UNIT 3 mp (1).ppt
UNIT 3 mp (1).ppt
UNIT 3 mp (1).ppt
UNIT 3 mp (1).ppt
UNIT 3 mp (1).ppt
UNIT 3 mp (1).ppt
UNIT 3 mp (1).ppt

More Related Content

What's hot

What's hot (20)

486 or 80486 DX Architecture
486 or 80486 DX Architecture486 or 80486 DX Architecture
486 or 80486 DX Architecture
 
Interrupt11
Interrupt11Interrupt11
Interrupt11
 
APB
APBAPB
APB
 
8237 / 8257 DMA
8237 / 8257 DMA8237 / 8257 DMA
8237 / 8257 DMA
 
8259 Programmable Interrupt Controller
8259 Programmable Interrupt Controller8259 Programmable Interrupt Controller
8259 Programmable Interrupt Controller
 
Memory organization
Memory organizationMemory organization
Memory organization
 
dual-port RAM (DPRAM)
dual-port RAM (DPRAM)dual-port RAM (DPRAM)
dual-port RAM (DPRAM)
 
Serial Communication
Serial CommunicationSerial Communication
Serial Communication
 
Cross Bar Switching
Cross Bar SwitchingCross Bar Switching
Cross Bar Switching
 
Microprocessor 8086 instructions
Microprocessor 8086 instructionsMicroprocessor 8086 instructions
Microprocessor 8086 instructions
 
AMBA_APB_pst
AMBA_APB_pstAMBA_APB_pst
AMBA_APB_pst
 
8251 USART
8251 USART8251 USART
8251 USART
 
DMA
DMADMA
DMA
 
8251 a usart programmable communication interface(1)
8251 a usart   programmable communication interface(1)8251 a usart   programmable communication interface(1)
8251 a usart programmable communication interface(1)
 
8086
80868086
8086
 
Register Organization of 80386
Register Organization of 80386Register Organization of 80386
Register Organization of 80386
 
Pin Description Of Intel 80386 DX Microprocessor
Pin Description Of Intel 80386 DX MicroprocessorPin Description Of Intel 80386 DX Microprocessor
Pin Description Of Intel 80386 DX Microprocessor
 
Dqdb
DqdbDqdb
Dqdb
 
Ipv6 packet fomat
Ipv6  packet fomatIpv6  packet fomat
Ipv6 packet fomat
 
Lect 2 ARM processor architecture
Lect 2 ARM processor architectureLect 2 ARM processor architecture
Lect 2 ARM processor architecture
 

Similar to UNIT 3 mp (1).ppt

UNIT 4 8051Microcontroller.pptx
UNIT 4 8051Microcontroller.pptxUNIT 4 8051Microcontroller.pptx
UNIT 4 8051Microcontroller.pptxGowrishankar C
 
lec3-8051microcontrollerarchitecture-230130044236-5c11a082.pptx
lec3-8051microcontrollerarchitecture-230130044236-5c11a082.pptxlec3-8051microcontrollerarchitecture-230130044236-5c11a082.pptx
lec3-8051microcontrollerarchitecture-230130044236-5c11a082.pptxMadavanR1
 
8051 microcontroller
8051 microcontroller 8051 microcontroller
8051 microcontroller nitugatkal
 
8051 MICROCONTROLLER ARCHITECTURE.pptx
 8051 MICROCONTROLLER ARCHITECTURE.pptx 8051 MICROCONTROLLER ARCHITECTURE.pptx
8051 MICROCONTROLLER ARCHITECTURE.pptxMemonaMemon1
 
8051 architecture
8051 architecture8051 architecture
8051 architecturesb108ec
 
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
 
8051 Microcontroller PPT's By Er. Swapnil Kaware
8051 Microcontroller PPT's By Er. Swapnil Kaware8051 Microcontroller PPT's By Er. Swapnil Kaware
8051 Microcontroller PPT's By Er. Swapnil KawareProf. Swapnil V. Kaware
 
8051 Microcontroller By Er. Swapnil Kaware
8051 Microcontroller By Er. Swapnil Kaware8051 Microcontroller By Er. Swapnil Kaware
8051 Microcontroller By Er. Swapnil KawareProf. Swapnil V. Kaware
 
UNIT 1 Microprocessors.pptx
UNIT 1 Microprocessors.pptxUNIT 1 Microprocessors.pptx
UNIT 1 Microprocessors.pptxGowrishankar C
 
Advanced Microprocessor 6.pptx
Advanced Microprocessor 6.pptxAdvanced Microprocessor 6.pptx
Advanced Microprocessor 6.pptxShanDimantha1
 
8051 Microcontroller
8051 Microcontroller8051 Microcontroller
8051 MicrocontrollerJai Sudhan
 
8085 microprocessor
8085 microprocessor8085 microprocessor
8085 microprocessorIama Marsian
 

Similar to UNIT 3 mp (1).ppt (20)

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
 
Ch3 ppt
Ch3 pptCh3 ppt
Ch3 ppt
 
lec3-8051microcontrollerarchitecture-230130044236-5c11a082.pptx
lec3-8051microcontrollerarchitecture-230130044236-5c11a082.pptxlec3-8051microcontrollerarchitecture-230130044236-5c11a082.pptx
lec3-8051microcontrollerarchitecture-230130044236-5c11a082.pptx
 
8051 microcontroller
8051 microcontroller 8051 microcontroller
8051 microcontroller
 
Unit 4.pptx
Unit 4.pptxUnit 4.pptx
Unit 4.pptx
 
8051 MICROCONTROLLER ARCHITECTURE.pptx
 8051 MICROCONTROLLER ARCHITECTURE.pptx 8051 MICROCONTROLLER ARCHITECTURE.pptx
8051 MICROCONTROLLER ARCHITECTURE.pptx
 
8051 architecture
8051 architecture8051 architecture
8051 architecture
 
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, ...
 
8051 Microcontroller PPT's By Er. Swapnil Kaware
8051 Microcontroller PPT's By Er. Swapnil Kaware8051 Microcontroller PPT's By Er. Swapnil Kaware
8051 Microcontroller PPT's By Er. Swapnil Kaware
 
8051 Microcontroller By Er. Swapnil Kaware
8051 Microcontroller By Er. Swapnil Kaware8051 Microcontroller By Er. Swapnil Kaware
8051 Microcontroller By Er. Swapnil Kaware
 
Micro 8051
Micro 8051Micro 8051
Micro 8051
 
UNIT 1 Microprocessors.pptx
UNIT 1 Microprocessors.pptxUNIT 1 Microprocessors.pptx
UNIT 1 Microprocessors.pptx
 
12 mt06ped001
12 mt06ped001 12 mt06ped001
12 mt06ped001
 
Advanced Microprocessor 6.pptx
Advanced Microprocessor 6.pptxAdvanced Microprocessor 6.pptx
Advanced Microprocessor 6.pptx
 
8051.pptx
8051.pptx8051.pptx
8051.pptx
 
8051 Microcontroller
8051 Microcontroller8051 Microcontroller
8051 Microcontroller
 
8085 microprocessor
8085 microprocessor8085 microprocessor
8085 microprocessor
 
Microprocessor history1
Microprocessor history1Microprocessor history1
Microprocessor history1
 
Microprocessor history1
Microprocessor history1Microprocessor history1
Microprocessor history1
 

Recently uploaded

High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college projectTonystark477637
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 

Recently uploaded (20)

High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 

UNIT 3 mp (1).ppt

  • 1. UNIT 3 •Architecture of 8051 •Special Function Registers(SFRs) •I/O Pins Ports and Circuits {Pin Diagram} •Instruction set •Addressing modes •Assembly language programming
  • 3. Features of the 8051 : • 8 bit CPU with registers A (the accumulator) and B • 16 bit Program Counter (PC) and Data Pointer (DPTR) • 8 bit Program Status Word (PSW) • 64K Program memory address space • 64K Data memory address space • 128 bytes of on chip data memory • 32 I/O pins for four 8 bit ports : Port 0, 1,2 & 3 • Two 16 bit timers / counters : T0 and T1 • Full duplex UART : SBUF • Two external and three internal interrupt sources • On chip clock oscillator.
  • 4. • Central processing unit • The CPU is the brain of the microcontrollers reading user’s programs and executing the expected task as per instructions stored there in. Primary elements are • Accumulator (ACC), • B register (B), • Stack pointer (SP), • Program counter (PC), • Program status word (PSW), • Data pointer register (DPTR) • and few more 8 bit registers.
  • 5. Accumulator: • The accumulator performs arithmetic and logic functions on 8 bit input variables. • Arithmetic operations include basic addition, subtraction, multiplication and division. • Logical operations are AND, OR XOR as well as rotate, clear, complement etc. • Apart from all the above, accumulator is responsible for conditional branching decisions and provides a temporary place in a data transfer operations within the device
  • 6. • B Register: used in multiply and divide operations. • Stack Pointer: 8 bit register. • This pointer keeps track of memory space where the important register information are stored when the program flow gets into executing a subroutine. • The stack portion may be placed in anywhere in the onchip RAM. • Program Counter : The Program Counter (PC) is the 16 bit register giving address of next instruction to be executed during program execution. It always points to the program memory space
  • 7. Interrupts : • The 8051 has five interrupt sources : One from the serial port (RI / TI) when a transmission or reception operation is executed. • Two from the timers (TF0, TF1) when overflow occurs and two come from the two input pins INT0, INT1. • Each interrupt may be independently enabled or disabled to allow polling on same sources and each may be classified as high or low priority. • These operations are selected by Interrupt Enable (IE) and Interrupt Priority (IP) registers.
  • 8. Data Pointer Register : • 16 bit addressing register that can be used to fetch any 8 bit data from the data memory space. • When it is not being used for this purpose, it can be used as two eight bit registers, DPH and DPL. Program Status Word: • PSW keeps the current status of the arithmetic and logic operations in different bits. • The 8051 has four math flags that respond automatically to the outcomes of arithmetic and logic operations and 3 general purpose user flags that can be set 1 or cleared to 0 by the programmer as desired. • The math flags are carry (C), auxiliary carry (AC), overflow (OV) and parity (P). • User flags are named flag 0 (F0), Register bank select bits RS0 and RS1.
  • 9. Input / Output Ports • 8051 has 32 I/O pins configured as 4 eight bit parallel ports (P0, P1, P2 and P3). Timers / Counters • 8051 has two 16 bit Timers / Counters, T0 and T1 capable of working in different modes. • Each consists of a ‘HIGH’ byte and a ‘LOW’ byte which can be accessed under software. • There is a mode control register (TMOD) and a control register (TCON) to configure these timers / counters in number of ways. Oscillator and Clock • Generate clock signal • Quartz crystal is used for Oscillator • Pins XTAL 1 and XTAL 2 are provided for connecting a resonant network to form an oscillator.
  • 11. ADDRESSING MODES • Immediate addressing mode • Register addressing mode • Direct addressing mode • Register indirect addressing mode • Indexed addressing mode
  • 12. 1.Immediate addressing mode • This kind of instructions take two bytes and first one specifies the opcode and second byte gives the required constant. • The operand comes immediately after the opcode. The mnemonic for immediate data is the pound sign (#). • This addressing mode can be used to load information into any of the registers including DPTR register.
  • 13.
  • 14. 2.Register Addressing Mode • Register addressing accesses the eight working registers (R0 - R7 ) of the selected register bank. • The least significant three bits of the instruction opcode indicate which register is to be used for the operation. • One of the four banks of registers is to be predefined in the PSW before using register addressing instruction. • ACC, B and DPTR can also be addressed in this mode
  • 15.
  • 16. 3.Direct Addressing Mode • In the direct addressing mode, all 128 bytes of internal RAM and the SFRs may be addressed directly using the single - byte address. • Internal RAM uses address from 00H to 7FH to address each byte.
  • 17.
  • 18. 4.Register Indirect Addressing Mode • Register is used as a pointer to the data. • If the data is inside the CPU, only registers R0 and R1 are used for this purpose. • When R0 and R1 hold the addresses of RAM locations, they must be preceded by the “@” sign.
  • 19.
  • 20. 5.Indexed Addressing Mode • Only the program memory can be accessed by this mode. • This mode is intended for reading lookup tables in the program memory. • A 16 bit base register (DPTR or PC) points to the base of the lookup tables and accumulator carries the constant indicating table entry number. • The address of the exact location of the table is formed by adding the accumulator data to the base pointer. Example MOVC A, @A + DPTR • The contents of A are added to the DPTR to form the 16 bit address of the needed data. ‘C’ means code.
  • 21. I/O PORTS Port 0 (P0.0 - P0.7) • Port 0 is used for both address and data bus (AD0 – AD7 ). • When the microcontroller chip is connected to an external memory, Port 0 provides both address and data. • ALE pin indicates if Port 0 has address or data. • When ALE = 0, Port 0 provides data (D0 – D7 ) and ALE = 1, Port 0 provides address (A0 – A7 ). • ALE is used for demultiplexing address and data with the help of a latch.
  • 22. Port 1 (P1.0 - P1.7): • Port 1 pins are used as input or output. • To make port 1 as an input port, write 1 to all its 8 bits. • To make port 1 as output port, write 0 to all its 8 bits. • Thus port 1 pins have no dual functions. Port 2 (P2.0 - P2.7): • Port 2 pins are used as input / output pins similar in operation to port 1. • The alternate use of port 2 is to supply a high order address byte (A8 – A15) when the microcontroller is connected to external memory.
  • 23. Port 3 (P3.0 - P3.7) : Port 3 pins are used as input or output
  • 24. INSTRUCTION SET • Data transfer set • Arithmetic set • Logical set • Boolean variable manipulation set • Program branching set