SlideShare a Scribd company logo
MICROCONTROLLER
AND INTERFACING
MODULE I
MICROPROCESSOR
 It is the Central Processing Unit (CPU) of a general purpose
microcomputer.
 It contains an Arithmetic and Logic Unit(ALU), a Program
Counter(PC),a Stack Pointer(SP), a few working registers,
a clock timing circuit and interrupt circuits.
 It doesn’t contain RAM, ROM,I/O ports, Timers etc on the
chip and hence called General Purpose CPU’s.
CONTD..
 A system designer using a general purpose microprocessor
must add the RAM, ROM, I/O ports, and timers externally
to make them functional.
 Although the external RAM, ROM, I/O ports makes these
systems bulkier and much more expensive, they have the
advantage of versatility such that the designer can decide
on the amount of RAM, ROM, and I/O ports needed to fit
the task at hand.
BLOCK DIAGRAM OF A MICROPROCESSOR
MICROCONTROLLER
 A microcontroller has a CPU (microprocessor) in
addition to a fixed amount of ROM,RAM,I/O ports
and timer all are embedded together on single chip.
 Therefore the designer cannot add any external
memory ,I/O or timer to it.
 The fixed amount of on-chip RAM, ROM, and the
number of I/O ports makes them ideal for many
applications in which the cost and space are critical.
CONTD..
BLOCK DIAGRAM OF 8051
CONTD..
 Central Processor Unit (CPU)
 is the brain of any processing device of the microcontroller.
 It monitors and controls all operations that are performed on
the Microcontroller units.
 The User has no control over the work of the CPU directly .
 It reads program written in ROM memory and executes them
and do the expected task of that application.
CONTD..
 Interrupts
 It is a subroutine call that interrupts the
microcontroller’s main operations or work and causes
it to execute any other program, which is more
important at the time of operation. .
 An Interrupts gives us a mechanism to put on hold the
ongoing operations, execute a subroutine and then
again resumes to another type of operations.
CONTD..
 Five interrupt sources are there in 8051 Microcontroller. There are
5 vectored interrupts are shown in below
 INTO
 TFO
 INT1
 TF1
 R1/T1
CONTD..
 Memory
 Microcontroller requires a program which is a collection of
instructions.
 This program tells microcontroller to do specific tasks.
 These programs require a memory on which these can be saved
and read by Microcontroller to perform specific operations of a
particular task.
 The memory which is used to store the program of
microcontroller is known as code memory or Program memory
of applications.
CONTD..
 It is known as ROM memory of microcontroller
 It also requires a memory to store data or operands
temporarily of the micro controller.
 The data memory of the 8051 is used to store data
temporarily for operation is known RAM memory.
 8051 microcontroller has 4K of code memory or
program memory( 4KB ROM) and also 128 bytes of
data memory or RAM.
CONTD..
 BUS
 Basically Bus is a collection of wires which work
as a communication channel or medium for
transfer of Data.
 There two types of buses that are shown in below
 Address Bus
 Data Bus
CONTD..
 Address Bus:
 Microcontroller 8051 has a 16 bit address bus .
 It is used to address memory locations and to transfer
the address from CPU to Memory of the microcontroller.
 Data Bus:
 Microcontroller 8051 has 8 bits of the data bus, which is
used to carry data of particular applications.
CONTD..
 Oscillator
 The microcontroller requires clock pulses for its operation .
 For this purpose, microcontroller 8051 has an on-chip
oscillator which works as a clock source for Central
Processing Unit of the microcontroller.
CONTD..
 Input/Output Port
 The microcontroller 8051 has 4 input, output ports to connect it to
the other peripherals
CONTD..
 Timers/Counters
 8051 microcontroller has two 16 bit timers and counters.
 These counters are again divided into a 8 bit register.
 The timers are used for measurement of intervals to determine
the pulse width of pulses.
The salient features of 8051 Microcontroller
 i. 4 KB on chip program memory (ROM or EPROM)).
 ii. 128 bytes on chip data memory(RAM).
 iii. 8-bit data bus
 iv. 16-bit address bus
 v. 32 general purpose registers each of 8 bits
 vi. Two -16 bit timers T0 and T1
 vii. Five Interrupts (3 internal and 2 external).
 ix. Four Parallel ports each of 8-bits (PORT0,
PORT1,PORT2,PORT3) with a total of 32 I/O lines.
 x. One 16-bit program counter and One 16-bit DPTR ( data
pointer)
 xi. One 8-bit stack pointer
 xii. One Microsecond instruction cycle with 12 MHz Crystal.
 xiii. One full duplex serial communication port.
Architecture of 8051
2
2
● A and B registers
○ 8051 contain 34 general purpose registers.
○ Two of these, namely A and B registers hold results of many mathematical and
logical instructions, and therefore can be considered as a part of ALU.
○ The other 32 registers are arranged as a part of internal RAM.
○ A or accumulator register is the most versatile of the CPU registers and is used for
operations like addition, subtraction, multiplication, division and almost all boolean
logical operations.
○ A-register is also used for all data transfers between 8051 and any external
memory.
○ B-register is used with A register for multiplication and division operation
2
3
○ PC and DPTR
○ PC or program counter is a 16-bit register that stores the address
of memory location from which the instruction bytes are to next
fetched
○ PC is automatically incremented after every byte is fetched.
○ PC does not have any internal address.
○ DPTR or data pointer is made up of two 8-bit registers namely
DPH and DPL which are used to furnish memory addresses
for internal and external data access.
2
4
PSW (PROGRAM STATUS WORD) OR FLAG
REGISTER
 CY[Carry or Borrow Bit] = 1 indicates a CARRY has occurred out of
higher order nibble of accumulator or borrow has occurred into higher
order nibble of accumulator.
 AC[Auxiliary Carry or Borrow Bit] = 1 indicates a CARRY has occurred
out of lower order nibble of accumulator or borrow has occurred into
lower order nibble of accumulator
 F0 – General Purpose User Definable Flag
 OV[Overflow or Sign] bit = 1 , Indicates the result in the
accumulator is a negative number in case of signed addition and the
result has exceeded the capacity of accumulator in case of unsigned
addition.
 P[Parity] bit = 1 , indicates the result in the accumulator has ODD
PARITY.
I
n
t
e
l8
0
5
1M
i
c
r
o
c
o
n
t
r
o
l
l
e
rA
r
c
h
i
t
e
c
t
u
r
e
28
● Internal Ram (data memory)
○ 128 bytes of internal RAM is organised into 3 distinct areas:
■ 32 bytes ranging from addresses 00H to 1FH that make up
32 working registers(each of 8 bits) organised as 4 banks
(bank0, bank1, bank2 & bank3) of 8 registers namely R0, R1,
R2…. R7
● Bits RS0, RS1 of PSW register determine which
registers are currently in use.
● By default, register bank 0 is used.
●
● Internal Ram (data memory)
○ 128 bytes of internal RAM is organised into 3
distinct areas:
■ A bit addressable area of 16 bytes occupies RAM
addresses ranging from 20 to 2Fh, forming a total of 128
addressable bits.
● Individual bits of a memory location can be manipulated
■ 80 bytes of general purpose area ranging from 30h to 7FH
used for read/write storage and is normally called as
SCRATCHPAD
12
12
SFRs
○ 8051 has a group of specific internal registers
(21nos) each called Special Function Registers
(SFR) and occupy another 128 bytes of memory
(80 to FF) .
○ All operations that do not use 128 bytes (00h to 7Fh) of
internal RAM are done by SFRs.
○ SFR include A-register, B-register, DPH, DPL, IE, IP, P0,P1,P2,P3,
PCON, PSW, SCON, SBUF, SP, TMOD, TCON, TL0, TL1, TH0,
TH1
I
n
t
e
l8
0
5
1M
i
c
r
o
c
o
n
t
r
o
l
l
e
rA
r
c
h
i
t
e
c
t
u
r
e
Special Function Registers of
8051
● Stack & Stack
Pointer
○ Stack is an area of internal RAM that is used in conjunction with
certain
opcodes to store and retrieve data quickly.
○ 8 bit Stack Pointer (SP) is used by 8051 to hold an internal
RAM address which is called the top of the Stack and is the
address where last byte of data is stored.
○ When data is to be placed on the stack SP is incremented
just before the data is stored on stack, so that the stack grows
upwards.
○ As the data is retrieved from the stack, SP
decrements after the retrieval of data.
15
I
n
t
e
l8
0
5
1M
i
c
r
o
c
o
n
t
r
o
l
l
e
rA
r
c
h
i
t
e
c
t
u
r
e
34
● Internal ROM (program memory)
○ 8051 has 4KB of on-chip ROM
(22x210bytes)
○ This is used for storing system program and has addresses ranging from
000h to FFFh (0 to 4095).
○ Program addresses higher than 0FFFh, that is those exceeding internal ROM capacity
will cause 8051 to automatically fetch code bytes from external program memory.
○ Fetching from external memory is enabled by keeping EA pin External Access pin) of
8051 to ground.
 I/O PORTS :
 There are totally four 8-bit I/O Ports namely PORT 0 , PORT 1 ,
PORT 2 , PORT 3.
 Three out of four ports namely PORT 0 , 2 and 3 are
multifunctional PORTS
COMPARISON BETWEEN 8051 FAMILY MEMBERS
PROGRAM MEMORY (ROM) OF 8051
MICROCONTROLLER
 In 8051 Microcontroller, the code or instructions to be executed
are stored in the Program Memory, which is also called as the
ROM of the Microcontroller.
 The original 8051 Microcontroller by Intel has 4KB of internal
ROM.
 In case of 4KB of Internal ROM, the address space is 0000H to
0FFFH. If the address space i.e. the program addresses exceed this
value, then the CPU will automatically fetch the code from the
external Program Memory.
CONTD..
CONTD..
 when the EA Pin is high, the CPU first fetches instructions from
the Internal Program Memory in the address range of 0000H to
0FFFFH and if the memory addresses exceed the limit, then the
instructions are fetched from the external ROM in the address
range of 1000H to FFFFH.
CONTD..
 There is another way to fetch the instructions: ignore the Internal
ROM and fetch all the instructions only from the External
Program Memory (External ROM).
 For this, the EA Pin must be connected to GND. In this case, the
memory addresses of the external ROM will be from 0000H to
FFFFH.
CONTD..
DATA MEMORY OF 8051
CONTD..
 The Data Memory or RAM of the 8051 Microcontroller stores
temporary data and intermediate results that are generated and
used during the normal operation of the microcontroller.
 Original Intel’s 8051 Microcontroller had 128B of internal RAM.
 But almost all modern variants of 8051 Microcontroller have 256B
of RAM.
CONTD..
 In this 256B, the first 128B i.e. memory addresses from 00H to 7FH is divided
in to Working Registers (organized as Register Banks), Bit – Addressable Area
and General Purpose RAM (also known as Scratchpad area).
 In the first 128B of RAM (from 00H to 7FH), the first 32B i.e. memory from
addresses 00H to 1FH consists of 32 Working Registers that are organized as
four banks with 8 Registers in each Bank.
CONTD..
 The 4 banks are named as Bank0, Bank1, Bank2 and Bank3.
 Each Bank consists of 8 registers named as R0 – R7.
 Each Register can be addressed in two ways: either by name or by address.
 To address the register by name, first the corresponding Bank must be selected.
In order to select the bank, we have to use the RS0 and RS1 bits of the Program
Status Word (PSW) Register (RS0 and RS1 are 3rd and 4th bits in the PSW
Register).
CONTD..
 The next 16B of the RAM i.e. from 20H to 2FH are Bit – Addressable memory
locations.
 There are totally 128 bits that can be addressed individually using 00H to 7FH
or the entire byte can be addressed as 20H to 2FH.
 The final 80B of the internal RAM i.e. addresses from 30H to 7FH, is the
general purpose RAM area which are byte addressable.
 These lower 128B of RAM can be addressed directly or indirectly.
CONTD..
 The upper 128B of the RAM i.e. memory addresses from 80H to FFH is
allocated for Special Function Registers (SFRs). SFRs control specific functions
of the 8051 Microcontroller. Some of the SFRs are I/O Port Registers (P0, P1,
P2 and P3), PSW (Program Status Word), A (Accumulator), IE (Interrupt
Enable), PCON (Power Control), etc.
 SRFs Memory addresses are only direct addressable.
8051 PIN FUNCTIONS
48
● Pins 1 – 8 (PORT 1): Pins 1 to 8 are the
PORT 1 Pins of 8051. PORT 1 Pins consists
of 8 – bit bidirectional Input / Output Port with
internal pull – up resistors
● Pin 9 (RST): Pin 9 is the Reset Input Pin. It is
an active HIGH Pin i.e. if the RST Pin is HIGH
for a minimum of two machine cycles, the
microcontroller will be reset. It will reset PC
register to 0000h.
● Pins 10 – 17 (PORT 3): Pins 10 to 17 form
the PORT 3 pins of the 8051 Microcontroller.
PORT 3 also acts as a bidirectional Input /
Output PORT with internal pull-ups.
Additionally, all the PORT 3 Pins have
special functions
49
● Pins 18 & 19: Pins 18 and 19 i.e. XTAL 2
and XTAL 1 are the pins for connecting
external oscillator. Generally, a Quartz
Crystal Oscillator is connected here
● Pin 20 (GND): Pin 20 is the Ground Pin of
the 8051 Microcontroller. It represents 0V
and is connected to the negative terminal
(0V) of the Power Supply.
● Pins 21 – 28 (PORT 2): These are the
PORT 2 Pins of the 8051 Microcontroller.
PORT 2 is also a Bidirectional Port i.e. all
the PORT 2 pins act as Input or Output.
Additionally, when external memory is
interfaced, PORT 2 pins act as the higher
order address byte
50
● Pin 29 (PSEN): Pin 29 is the Program Store
Enable Pin (PSEN). Using this pins,
external Program Memory can be read.
● Pin 30 (ALE/PROG): Pin 30 is the Address
Latch Enable Pin. It is an active high pin.
ALE indicates if port0 provides address or
data. ALE=0 indicates port0 provides data
and if 1 port0 provides address.
● Pin 31 (EA/VPP): Pin 31 is the External
Access Enable Pin i.e. allows external
Program Memory. Code from external
program memory can be fetched only if this
pin is LOW. For normal operations, this pins
is pulled HIGH.
51
● Pins 32 – 39 (PORT 0): Pins 32 to 39 are
PORT 0 Pins. They are also bidirectional
Input / Output Pins but without any internal
pull-ups. Hence, we need external pull-ups
in order to use PORT 0 pins as I/O PORT. In
addition to acting as I/O PORT, PORT 0 also
acts as lower order address/data bus when
external memory is accessed.
● Pin 40 (VCC): Pin 40 is the power supply
pin to which the supply voltage is given
(+5V).
52

More Related Content

Similar to Microcontroller Electronics Engineering Sem 4MODULE 1.pptx

Unit1 5-mpi-lecture-notes
Unit1 5-mpi-lecture-notesUnit1 5-mpi-lecture-notes
Unit1 5-mpi-lecture-notes
Prabhu Mali
 
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
Prof. 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 Kaware
Prof. Swapnil V. Kaware
 
Unit 4.pptx
Unit 4.pptxUnit 4.pptx
Unit 4.pptx
BLACKSPAROW
 
002079
002079002079
002079
irfantheraj
 
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
 
Ashish microcontroller 8051
Ashish microcontroller 8051Ashish microcontroller 8051
Ashish microcontroller 8051
ASHISH RAJ
 
EMBEDDED SYSTEMS AND IOT lab manual for enginnering students
EMBEDDED SYSTEMS AND IOT lab manual for enginnering studentsEMBEDDED SYSTEMS AND IOT lab manual for enginnering students
EMBEDDED SYSTEMS AND IOT lab manual for enginnering students
eceprinter6
 
8051 dev board guide
8051 dev board guide8051 dev board guide
8051 dev board guide
Murali Krishna
 
8051 Microcontroller
8051 Microcontroller8051 Microcontroller
8051 Microcontroller
Jai Sudhan
 
8086_architecture MMC PPT.ppt
8086_architecture MMC PPT.ppt8086_architecture MMC PPT.ppt
8086_architecture MMC PPT.ppt
JamesAlpha3
 
Micro controller
Micro controllerMicro controller
Micro controller
Dr. Ashok Kumar K
 
POA_Unit 5.pptx
POA_Unit 5.pptxPOA_Unit 5.pptx
POA_Unit 5.pptx
GAURAVWANI11
 
4th yr dmumicrocontroller1
4th yr dmumicrocontroller14th yr dmumicrocontroller1
4th yr dmumicrocontroller1
haymanotyehuala
 
SYBSC IT SEM IV EMBEDDED SYSTEMS UNIT III The 8051 Microcontrollers
SYBSC IT SEM IV EMBEDDED SYSTEMS UNIT III  The 8051 MicrocontrollersSYBSC IT SEM IV EMBEDDED SYSTEMS UNIT III  The 8051 Microcontrollers
SYBSC IT SEM IV EMBEDDED SYSTEMS UNIT III The 8051 Microcontrollers
Arti Parab Academics
 
UNIT 4.pptx
UNIT 4.pptxUNIT 4.pptx
UNIT 4.pptx
BASKARS53
 
microprocessor8085 power point presentation
microprocessor8085 power point presentationmicroprocessor8085 power point presentation
microprocessor8085 power point presentation
rohitkuarm5667
 
89s52 2
89s52 289s52 2
Architecture of 8085
Architecture of 8085Architecture of 8085
Architecture of 8085
HarshitParkar6677
 
Architecture of 8085
Architecture of 8085Architecture of 8085
Architecture of 8085
HarshitParkar6677
 

Similar to Microcontroller Electronics Engineering Sem 4MODULE 1.pptx (20)

Unit1 5-mpi-lecture-notes
Unit1 5-mpi-lecture-notesUnit1 5-mpi-lecture-notes
Unit1 5-mpi-lecture-notes
 
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
 
Unit 4.pptx
Unit 4.pptxUnit 4.pptx
Unit 4.pptx
 
002079
002079002079
002079
 
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, ...
 
Ashish microcontroller 8051
Ashish microcontroller 8051Ashish microcontroller 8051
Ashish microcontroller 8051
 
EMBEDDED SYSTEMS AND IOT lab manual for enginnering students
EMBEDDED SYSTEMS AND IOT lab manual for enginnering studentsEMBEDDED SYSTEMS AND IOT lab manual for enginnering students
EMBEDDED SYSTEMS AND IOT lab manual for enginnering students
 
8051 dev board guide
8051 dev board guide8051 dev board guide
8051 dev board guide
 
8051 Microcontroller
8051 Microcontroller8051 Microcontroller
8051 Microcontroller
 
8086_architecture MMC PPT.ppt
8086_architecture MMC PPT.ppt8086_architecture MMC PPT.ppt
8086_architecture MMC PPT.ppt
 
Micro controller
Micro controllerMicro controller
Micro controller
 
POA_Unit 5.pptx
POA_Unit 5.pptxPOA_Unit 5.pptx
POA_Unit 5.pptx
 
4th yr dmumicrocontroller1
4th yr dmumicrocontroller14th yr dmumicrocontroller1
4th yr dmumicrocontroller1
 
SYBSC IT SEM IV EMBEDDED SYSTEMS UNIT III The 8051 Microcontrollers
SYBSC IT SEM IV EMBEDDED SYSTEMS UNIT III  The 8051 MicrocontrollersSYBSC IT SEM IV EMBEDDED SYSTEMS UNIT III  The 8051 Microcontrollers
SYBSC IT SEM IV EMBEDDED SYSTEMS UNIT III The 8051 Microcontrollers
 
UNIT 4.pptx
UNIT 4.pptxUNIT 4.pptx
UNIT 4.pptx
 
microprocessor8085 power point presentation
microprocessor8085 power point presentationmicroprocessor8085 power point presentation
microprocessor8085 power point presentation
 
89s52 2
89s52 289s52 2
89s52 2
 
Architecture of 8085
Architecture of 8085Architecture of 8085
Architecture of 8085
 
Architecture of 8085
Architecture of 8085Architecture of 8085
Architecture of 8085
 

Recently uploaded

LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by AnantLLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
Anant Corporation
 
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
nedcocy
 
Transformers design and coooling methods
Transformers design and coooling methodsTransformers design and coooling methods
Transformers design and coooling methods
Roger Rozario
 
Introduction to Computer Networks & OSI MODEL.ppt
Introduction to Computer Networks & OSI MODEL.pptIntroduction to Computer Networks & OSI MODEL.ppt
Introduction to Computer Networks & OSI MODEL.ppt
Dwarkadas J Sanghvi College of Engineering
 
SENTIMENT ANALYSIS ON PPT AND Project template_.pptx
SENTIMENT ANALYSIS ON PPT AND Project template_.pptxSENTIMENT ANALYSIS ON PPT AND Project template_.pptx
SENTIMENT ANALYSIS ON PPT AND Project template_.pptx
b0754201
 
Accident detection system project report.pdf
Accident detection system project report.pdfAccident detection system project report.pdf
Accident detection system project report.pdf
Kamal Acharya
 
SCALING OF MOS CIRCUITS m .pptx
SCALING OF MOS CIRCUITS m                 .pptxSCALING OF MOS CIRCUITS m                 .pptx
SCALING OF MOS CIRCUITS m .pptx
harshapolam10
 
Applications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdfApplications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdf
Atif Razi
 
smart pill dispenser is designed to improve medication adherence and safety f...
smart pill dispenser is designed to improve medication adherence and safety f...smart pill dispenser is designed to improve medication adherence and safety f...
smart pill dispenser is designed to improve medication adherence and safety f...
um7474492
 
Zener Diode and its V-I Characteristics and Applications
Zener Diode and its V-I Characteristics and ApplicationsZener Diode and its V-I Characteristics and Applications
Zener Diode and its V-I Characteristics and Applications
Shiny Christobel
 
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
PriyankaKilaniya
 
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Transcat
 
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
shadow0702a
 
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
upoux
 
5G Radio Network Througput Problem Analysis HCIA.pdf
5G Radio Network Througput Problem Analysis HCIA.pdf5G Radio Network Througput Problem Analysis HCIA.pdf
5G Radio Network Througput Problem Analysis HCIA.pdf
AlvianRamadhani5
 
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
ijaia
 
Open Channel Flow: fluid flow with a free surface
Open Channel Flow: fluid flow with a free surfaceOpen Channel Flow: fluid flow with a free surface
Open Channel Flow: fluid flow with a free surface
Indrajeet sahu
 
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
Gino153088
 
Digital Twins Computer Networking Paper Presentation.pptx
Digital Twins Computer Networking Paper Presentation.pptxDigital Twins Computer Networking Paper Presentation.pptx
Digital Twins Computer Networking Paper Presentation.pptx
aryanpankaj78
 
Generative AI Use cases applications solutions and implementation.pdf
Generative AI Use cases applications solutions and implementation.pdfGenerative AI Use cases applications solutions and implementation.pdf
Generative AI Use cases applications solutions and implementation.pdf
mahaffeycheryld
 

Recently uploaded (20)

LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by AnantLLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
 
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
 
Transformers design and coooling methods
Transformers design and coooling methodsTransformers design and coooling methods
Transformers design and coooling methods
 
Introduction to Computer Networks & OSI MODEL.ppt
Introduction to Computer Networks & OSI MODEL.pptIntroduction to Computer Networks & OSI MODEL.ppt
Introduction to Computer Networks & OSI MODEL.ppt
 
SENTIMENT ANALYSIS ON PPT AND Project template_.pptx
SENTIMENT ANALYSIS ON PPT AND Project template_.pptxSENTIMENT ANALYSIS ON PPT AND Project template_.pptx
SENTIMENT ANALYSIS ON PPT AND Project template_.pptx
 
Accident detection system project report.pdf
Accident detection system project report.pdfAccident detection system project report.pdf
Accident detection system project report.pdf
 
SCALING OF MOS CIRCUITS m .pptx
SCALING OF MOS CIRCUITS m                 .pptxSCALING OF MOS CIRCUITS m                 .pptx
SCALING OF MOS CIRCUITS m .pptx
 
Applications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdfApplications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdf
 
smart pill dispenser is designed to improve medication adherence and safety f...
smart pill dispenser is designed to improve medication adherence and safety f...smart pill dispenser is designed to improve medication adherence and safety f...
smart pill dispenser is designed to improve medication adherence and safety f...
 
Zener Diode and its V-I Characteristics and Applications
Zener Diode and its V-I Characteristics and ApplicationsZener Diode and its V-I Characteristics and Applications
Zener Diode and its V-I Characteristics and Applications
 
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
 
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
 
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
 
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
 
5G Radio Network Througput Problem Analysis HCIA.pdf
5G Radio Network Througput Problem Analysis HCIA.pdf5G Radio Network Througput Problem Analysis HCIA.pdf
5G Radio Network Througput Problem Analysis HCIA.pdf
 
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
 
Open Channel Flow: fluid flow with a free surface
Open Channel Flow: fluid flow with a free surfaceOpen Channel Flow: fluid flow with a free surface
Open Channel Flow: fluid flow with a free surface
 
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
 
Digital Twins Computer Networking Paper Presentation.pptx
Digital Twins Computer Networking Paper Presentation.pptxDigital Twins Computer Networking Paper Presentation.pptx
Digital Twins Computer Networking Paper Presentation.pptx
 
Generative AI Use cases applications solutions and implementation.pdf
Generative AI Use cases applications solutions and implementation.pdfGenerative AI Use cases applications solutions and implementation.pdf
Generative AI Use cases applications solutions and implementation.pdf
 

Microcontroller Electronics Engineering Sem 4MODULE 1.pptx

  • 2. MICROPROCESSOR  It is the Central Processing Unit (CPU) of a general purpose microcomputer.  It contains an Arithmetic and Logic Unit(ALU), a Program Counter(PC),a Stack Pointer(SP), a few working registers, a clock timing circuit and interrupt circuits.  It doesn’t contain RAM, ROM,I/O ports, Timers etc on the chip and hence called General Purpose CPU’s.
  • 3. CONTD..  A system designer using a general purpose microprocessor must add the RAM, ROM, I/O ports, and timers externally to make them functional.  Although the external RAM, ROM, I/O ports makes these systems bulkier and much more expensive, they have the advantage of versatility such that the designer can decide on the amount of RAM, ROM, and I/O ports needed to fit the task at hand.
  • 4. BLOCK DIAGRAM OF A MICROPROCESSOR
  • 5. MICROCONTROLLER  A microcontroller has a CPU (microprocessor) in addition to a fixed amount of ROM,RAM,I/O ports and timer all are embedded together on single chip.  Therefore the designer cannot add any external memory ,I/O or timer to it.  The fixed amount of on-chip RAM, ROM, and the number of I/O ports makes them ideal for many applications in which the cost and space are critical.
  • 6.
  • 8.
  • 10. CONTD..  Central Processor Unit (CPU)  is the brain of any processing device of the microcontroller.  It monitors and controls all operations that are performed on the Microcontroller units.  The User has no control over the work of the CPU directly .  It reads program written in ROM memory and executes them and do the expected task of that application.
  • 11. CONTD..  Interrupts  It is a subroutine call that interrupts the microcontroller’s main operations or work and causes it to execute any other program, which is more important at the time of operation. .  An Interrupts gives us a mechanism to put on hold the ongoing operations, execute a subroutine and then again resumes to another type of operations.
  • 12. CONTD..  Five interrupt sources are there in 8051 Microcontroller. There are 5 vectored interrupts are shown in below  INTO  TFO  INT1  TF1  R1/T1
  • 13. CONTD..  Memory  Microcontroller requires a program which is a collection of instructions.  This program tells microcontroller to do specific tasks.  These programs require a memory on which these can be saved and read by Microcontroller to perform specific operations of a particular task.  The memory which is used to store the program of microcontroller is known as code memory or Program memory of applications.
  • 14. CONTD..  It is known as ROM memory of microcontroller  It also requires a memory to store data or operands temporarily of the micro controller.  The data memory of the 8051 is used to store data temporarily for operation is known RAM memory.  8051 microcontroller has 4K of code memory or program memory( 4KB ROM) and also 128 bytes of data memory or RAM.
  • 15. CONTD..  BUS  Basically Bus is a collection of wires which work as a communication channel or medium for transfer of Data.  There two types of buses that are shown in below  Address Bus  Data Bus
  • 16. CONTD..  Address Bus:  Microcontroller 8051 has a 16 bit address bus .  It is used to address memory locations and to transfer the address from CPU to Memory of the microcontroller.  Data Bus:  Microcontroller 8051 has 8 bits of the data bus, which is used to carry data of particular applications.
  • 17. CONTD..  Oscillator  The microcontroller requires clock pulses for its operation .  For this purpose, microcontroller 8051 has an on-chip oscillator which works as a clock source for Central Processing Unit of the microcontroller.
  • 18. CONTD..  Input/Output Port  The microcontroller 8051 has 4 input, output ports to connect it to the other peripherals
  • 19. CONTD..  Timers/Counters  8051 microcontroller has two 16 bit timers and counters.  These counters are again divided into a 8 bit register.  The timers are used for measurement of intervals to determine the pulse width of pulses.
  • 20. The salient features of 8051 Microcontroller  i. 4 KB on chip program memory (ROM or EPROM)).  ii. 128 bytes on chip data memory(RAM).  iii. 8-bit data bus  iv. 16-bit address bus  v. 32 general purpose registers each of 8 bits  vi. Two -16 bit timers T0 and T1  vii. Five Interrupts (3 internal and 2 external).  ix. Four Parallel ports each of 8-bits (PORT0, PORT1,PORT2,PORT3) with a total of 32 I/O lines.  x. One 16-bit program counter and One 16-bit DPTR ( data pointer)  xi. One 8-bit stack pointer  xii. One Microsecond instruction cycle with 12 MHz Crystal.  xiii. One full duplex serial communication port.
  • 22. 2 2
  • 23. ● A and B registers ○ 8051 contain 34 general purpose registers. ○ Two of these, namely A and B registers hold results of many mathematical and logical instructions, and therefore can be considered as a part of ALU. ○ The other 32 registers are arranged as a part of internal RAM. ○ A or accumulator register is the most versatile of the CPU registers and is used for operations like addition, subtraction, multiplication, division and almost all boolean logical operations. ○ A-register is also used for all data transfers between 8051 and any external memory. ○ B-register is used with A register for multiplication and division operation 2 3
  • 24. ○ PC and DPTR ○ PC or program counter is a 16-bit register that stores the address of memory location from which the instruction bytes are to next fetched ○ PC is automatically incremented after every byte is fetched. ○ PC does not have any internal address. ○ DPTR or data pointer is made up of two 8-bit registers namely DPH and DPL which are used to furnish memory addresses for internal and external data access. 2 4
  • 25. PSW (PROGRAM STATUS WORD) OR FLAG REGISTER
  • 26.  CY[Carry or Borrow Bit] = 1 indicates a CARRY has occurred out of higher order nibble of accumulator or borrow has occurred into higher order nibble of accumulator.  AC[Auxiliary Carry or Borrow Bit] = 1 indicates a CARRY has occurred out of lower order nibble of accumulator or borrow has occurred into lower order nibble of accumulator  F0 – General Purpose User Definable Flag
  • 27.  OV[Overflow or Sign] bit = 1 , Indicates the result in the accumulator is a negative number in case of signed addition and the result has exceeded the capacity of accumulator in case of unsigned addition.  P[Parity] bit = 1 , indicates the result in the accumulator has ODD PARITY.
  • 28. I n t e l8 0 5 1M i c r o c o n t r o l l e rA r c h i t e c t u r e 28 ● Internal Ram (data memory) ○ 128 bytes of internal RAM is organised into 3 distinct areas: ■ 32 bytes ranging from addresses 00H to 1FH that make up 32 working registers(each of 8 bits) organised as 4 banks (bank0, bank1, bank2 & bank3) of 8 registers namely R0, R1, R2…. R7 ● Bits RS0, RS1 of PSW register determine which registers are currently in use. ● By default, register bank 0 is used. ●
  • 29. ● Internal Ram (data memory) ○ 128 bytes of internal RAM is organised into 3 distinct areas: ■ A bit addressable area of 16 bytes occupies RAM addresses ranging from 20 to 2Fh, forming a total of 128 addressable bits. ● Individual bits of a memory location can be manipulated ■ 80 bytes of general purpose area ranging from 30h to 7FH used for read/write storage and is normally called as SCRATCHPAD 12
  • 30. 12
  • 31. SFRs ○ 8051 has a group of specific internal registers (21nos) each called Special Function Registers (SFR) and occupy another 128 bytes of memory (80 to FF) . ○ All operations that do not use 128 bytes (00h to 7Fh) of internal RAM are done by SFRs. ○ SFR include A-register, B-register, DPH, DPL, IE, IP, P0,P1,P2,P3, PCON, PSW, SCON, SBUF, SP, TMOD, TCON, TL0, TL1, TH0, TH1
  • 33. ● Stack & Stack Pointer ○ Stack is an area of internal RAM that is used in conjunction with certain opcodes to store and retrieve data quickly. ○ 8 bit Stack Pointer (SP) is used by 8051 to hold an internal RAM address which is called the top of the Stack and is the address where last byte of data is stored. ○ When data is to be placed on the stack SP is incremented just before the data is stored on stack, so that the stack grows upwards. ○ As the data is retrieved from the stack, SP decrements after the retrieval of data. 15
  • 34. I n t e l8 0 5 1M i c r o c o n t r o l l e rA r c h i t e c t u r e 34 ● Internal ROM (program memory) ○ 8051 has 4KB of on-chip ROM (22x210bytes) ○ This is used for storing system program and has addresses ranging from 000h to FFFh (0 to 4095). ○ Program addresses higher than 0FFFh, that is those exceeding internal ROM capacity will cause 8051 to automatically fetch code bytes from external program memory. ○ Fetching from external memory is enabled by keeping EA pin External Access pin) of 8051 to ground.
  • 35.  I/O PORTS :  There are totally four 8-bit I/O Ports namely PORT 0 , PORT 1 , PORT 2 , PORT 3.  Three out of four ports namely PORT 0 , 2 and 3 are multifunctional PORTS
  • 36. COMPARISON BETWEEN 8051 FAMILY MEMBERS
  • 37. PROGRAM MEMORY (ROM) OF 8051 MICROCONTROLLER  In 8051 Microcontroller, the code or instructions to be executed are stored in the Program Memory, which is also called as the ROM of the Microcontroller.  The original 8051 Microcontroller by Intel has 4KB of internal ROM.  In case of 4KB of Internal ROM, the address space is 0000H to 0FFFH. If the address space i.e. the program addresses exceed this value, then the CPU will automatically fetch the code from the external Program Memory.
  • 39. CONTD..  when the EA Pin is high, the CPU first fetches instructions from the Internal Program Memory in the address range of 0000H to 0FFFFH and if the memory addresses exceed the limit, then the instructions are fetched from the external ROM in the address range of 1000H to FFFFH.
  • 40. CONTD..  There is another way to fetch the instructions: ignore the Internal ROM and fetch all the instructions only from the External Program Memory (External ROM).  For this, the EA Pin must be connected to GND. In this case, the memory addresses of the external ROM will be from 0000H to FFFFH.
  • 43. CONTD..  The Data Memory or RAM of the 8051 Microcontroller stores temporary data and intermediate results that are generated and used during the normal operation of the microcontroller.  Original Intel’s 8051 Microcontroller had 128B of internal RAM.  But almost all modern variants of 8051 Microcontroller have 256B of RAM.
  • 44. CONTD..  In this 256B, the first 128B i.e. memory addresses from 00H to 7FH is divided in to Working Registers (organized as Register Banks), Bit – Addressable Area and General Purpose RAM (also known as Scratchpad area).  In the first 128B of RAM (from 00H to 7FH), the first 32B i.e. memory from addresses 00H to 1FH consists of 32 Working Registers that are organized as four banks with 8 Registers in each Bank.
  • 45. CONTD..  The 4 banks are named as Bank0, Bank1, Bank2 and Bank3.  Each Bank consists of 8 registers named as R0 – R7.  Each Register can be addressed in two ways: either by name or by address.  To address the register by name, first the corresponding Bank must be selected. In order to select the bank, we have to use the RS0 and RS1 bits of the Program Status Word (PSW) Register (RS0 and RS1 are 3rd and 4th bits in the PSW Register).
  • 46. CONTD..  The next 16B of the RAM i.e. from 20H to 2FH are Bit – Addressable memory locations.  There are totally 128 bits that can be addressed individually using 00H to 7FH or the entire byte can be addressed as 20H to 2FH.  The final 80B of the internal RAM i.e. addresses from 30H to 7FH, is the general purpose RAM area which are byte addressable.  These lower 128B of RAM can be addressed directly or indirectly.
  • 47. CONTD..  The upper 128B of the RAM i.e. memory addresses from 80H to FFH is allocated for Special Function Registers (SFRs). SFRs control specific functions of the 8051 Microcontroller. Some of the SFRs are I/O Port Registers (P0, P1, P2 and P3), PSW (Program Status Word), A (Accumulator), IE (Interrupt Enable), PCON (Power Control), etc.  SRFs Memory addresses are only direct addressable.
  • 49. ● Pins 1 – 8 (PORT 1): Pins 1 to 8 are the PORT 1 Pins of 8051. PORT 1 Pins consists of 8 – bit bidirectional Input / Output Port with internal pull – up resistors ● Pin 9 (RST): Pin 9 is the Reset Input Pin. It is an active HIGH Pin i.e. if the RST Pin is HIGH for a minimum of two machine cycles, the microcontroller will be reset. It will reset PC register to 0000h. ● Pins 10 – 17 (PORT 3): Pins 10 to 17 form the PORT 3 pins of the 8051 Microcontroller. PORT 3 also acts as a bidirectional Input / Output PORT with internal pull-ups. Additionally, all the PORT 3 Pins have special functions 49
  • 50. ● Pins 18 & 19: Pins 18 and 19 i.e. XTAL 2 and XTAL 1 are the pins for connecting external oscillator. Generally, a Quartz Crystal Oscillator is connected here ● Pin 20 (GND): Pin 20 is the Ground Pin of the 8051 Microcontroller. It represents 0V and is connected to the negative terminal (0V) of the Power Supply. ● Pins 21 – 28 (PORT 2): These are the PORT 2 Pins of the 8051 Microcontroller. PORT 2 is also a Bidirectional Port i.e. all the PORT 2 pins act as Input or Output. Additionally, when external memory is interfaced, PORT 2 pins act as the higher order address byte 50
  • 51. ● Pin 29 (PSEN): Pin 29 is the Program Store Enable Pin (PSEN). Using this pins, external Program Memory can be read. ● Pin 30 (ALE/PROG): Pin 30 is the Address Latch Enable Pin. It is an active high pin. ALE indicates if port0 provides address or data. ALE=0 indicates port0 provides data and if 1 port0 provides address. ● Pin 31 (EA/VPP): Pin 31 is the External Access Enable Pin i.e. allows external Program Memory. Code from external program memory can be fetched only if this pin is LOW. For normal operations, this pins is pulled HIGH. 51
  • 52. ● Pins 32 – 39 (PORT 0): Pins 32 to 39 are PORT 0 Pins. They are also bidirectional Input / Output Pins but without any internal pull-ups. Hence, we need external pull-ups in order to use PORT 0 pins as I/O PORT. In addition to acting as I/O PORT, PORT 0 also acts as lower order address/data bus when external memory is accessed. ● Pin 40 (VCC): Pin 40 is the power supply pin to which the supply voltage is given (+5V). 52