SlideShare uma empresa Scribd logo
1 de 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

Mais conteúdo relacionado

Mais procurados

Introduction to 8085 Microprocessor
Introduction to 8085 MicroprocessorIntroduction to 8085 Microprocessor
Introduction to 8085 MicroprocessorRavi Anand
 
Serial communication in 8085
Serial communication in 8085Serial communication in 8085
Serial communication in 8085Nitin Ahire
 
8257 DMA Controller
8257 DMA Controller8257 DMA Controller
8257 DMA ControllerShivamSood22
 
Instruction set-of-8085
Instruction set-of-8085Instruction set-of-8085
Instruction set-of-8085saleForce
 
Minimum mode and Maximum mode Configuration in 8086
Minimum mode and Maximum mode Configuration in 8086Minimum mode and Maximum mode Configuration in 8086
Minimum mode and Maximum mode Configuration in 8086Jismy .K.Jose
 
Semiconductor memories
Semiconductor memoriesSemiconductor memories
Semiconductor memoriesSambitShreeman
 
8051 microcontroller features
8051 microcontroller features8051 microcontroller features
8051 microcontroller featuresTech_MX
 
8085 Microprocessor Architecture
8085 Microprocessor Architecture8085 Microprocessor Architecture
8085 Microprocessor Architecturedeval patel
 
8086 modes
8086 modes8086 modes
8086 modesPDFSHARE
 
I2C BUS
I2C BUSI2C BUS
I2C BUSp_ayal
 
Memory & I/O interfacing
Memory & I/O  interfacingMemory & I/O  interfacing
Memory & I/O interfacingdeval patel
 
8237 / 8257 DMA
8237 / 8257 DMA8237 / 8257 DMA
8237 / 8257 DMAAJAL A J
 

Mais procurados (20)

Semiconductor memories
Semiconductor memoriesSemiconductor memories
Semiconductor memories
 
I2C
I2CI2C
I2C
 
Introduction to 8085 Microprocessor
Introduction to 8085 MicroprocessorIntroduction to 8085 Microprocessor
Introduction to 8085 Microprocessor
 
Adc interfacing
Adc interfacingAdc interfacing
Adc interfacing
 
Serial communication in 8085
Serial communication in 8085Serial communication in 8085
Serial communication in 8085
 
8257 DMA Controller
8257 DMA Controller8257 DMA Controller
8257 DMA Controller
 
Instruction set-of-8085
Instruction set-of-8085Instruction set-of-8085
Instruction set-of-8085
 
Minimum mode and Maximum mode Configuration in 8086
Minimum mode and Maximum mode Configuration in 8086Minimum mode and Maximum mode Configuration in 8086
Minimum mode and Maximum mode Configuration in 8086
 
UART
UARTUART
UART
 
Semiconductor memories
Semiconductor memoriesSemiconductor memories
Semiconductor memories
 
8251 USART
8251 USART8251 USART
8251 USART
 
DDR SDRAMs
DDR SDRAMsDDR SDRAMs
DDR SDRAMs
 
8051 microcontroller features
8051 microcontroller features8051 microcontroller features
8051 microcontroller features
 
8085 Microprocessor Architecture
8085 Microprocessor Architecture8085 Microprocessor Architecture
8085 Microprocessor Architecture
 
8086 modes
8086 modes8086 modes
8086 modes
 
I2C BUS
I2C BUSI2C BUS
I2C BUS
 
Memory & I/O interfacing
Memory & I/O  interfacingMemory & I/O  interfacing
Memory & I/O interfacing
 
8237 / 8257 DMA
8237 / 8257 DMA8237 / 8257 DMA
8237 / 8257 DMA
 
8255 presentaion.ppt
8255 presentaion.ppt8255 presentaion.ppt
8255 presentaion.ppt
 
Communication Protocols (UART, SPI,I2C)
Communication Protocols (UART, SPI,I2C)Communication Protocols (UART, SPI,I2C)
Communication Protocols (UART, SPI,I2C)
 

Semelhante a 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
 
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
 
Unit -2 and 3 mekirirygiygyuguiguihiiqio
Unit -2 and 3 mekirirygiygyuguiguihiiqioUnit -2 and 3 mekirirygiygyuguiguihiiqio
Unit -2 and 3 mekirirygiygyuguiguihiiqioManikanta Reddy Sakam
 

Semelhante a 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
 
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
 
Unit -2 and 3 mekirirygiygyuguiguihiiqio
Unit -2 and 3 mekirirygiygyuguiguihiiqioUnit -2 and 3 mekirirygiygyuguiguihiiqio
Unit -2 and 3 mekirirygiygyuguiguihiiqio
 

Último

Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 
8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitterShivangiSharma879191
 
Comparative Analysis of Text Summarization Techniques
Comparative Analysis of Text Summarization TechniquesComparative Analysis of Text Summarization Techniques
Comparative Analysis of Text Summarization Techniquesugginaramesh
 
An introduction to Semiconductor and its types.pptx
An introduction to Semiconductor and its types.pptxAn introduction to Semiconductor and its types.pptx
An introduction to Semiconductor and its types.pptxPurva Nikam
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)dollysharma2066
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .Satyam Kumar
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)Dr SOUNDIRARAJ N
 
Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...121011101441
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfAsst.prof M.Gokilavani
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxbritheesh05
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfROCENODodongVILLACER
 

Último (20)

Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 
8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter
 
Comparative Analysis of Text Summarization Techniques
Comparative Analysis of Text Summarization TechniquesComparative Analysis of Text Summarization Techniques
Comparative Analysis of Text Summarization Techniques
 
An introduction to Semiconductor and its types.pptx
An introduction to Semiconductor and its types.pptxAn introduction to Semiconductor and its types.pptx
An introduction to Semiconductor and its types.pptx
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
 
Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...
 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptx
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdf
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 

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