0% found this document useful (0 votes)
7 views

Unit4 KEE602

hiiii

Uploaded by

technicallooter
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Unit4 KEE602

hiiii

Uploaded by

technicallooter
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 135

Noida Institute of Engineering and Technology,

Greater Noida
8051 Microcontroller Basics

Unit: 04

KEE-602 ANURAG VERMA


Microprocessor & Microcontroller EN Department N.I.E.T. Gr. Noida
M.E.-Electrical Engineering
Specialization:-Renewable Energy and
B. Tech.
(B. Tech.6th6Semester
th Sem) Biomedical Signal Processing
Session: 2020-21 Member: Indian Academy of Neurosciences
and Systems Society of India.

KEE-602 Microprocessor & Microcontroller Unit 4


1
5/2/2022
Faculty Introduction
Name: ANURAG VERMA
Qualification: M.E.-Electrical Engineering
Designation: Assistant Professor
Department: Electrical and Electronics Engineering
Experience: 19 years(Teaching+Industry)
Subjects taught: Electrical Machines and Automatic Control,
Electrical machine-I, Electrical machine-II,
Non Conventional Energy Sources,
Instrumentation and Process Control,
Machine Learning, Neural network and Fuzzy Logic
Microprocessor and Microcontroller, DSP, Biomedical
Instrumentation, Electrical Measurements etc.
Areas of interest: Renewable Energy, Electric Drives and
Biomedical Signal Processing.

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 2


CONTENTS
• Evaluation Scheme
• Subject Syllabus
• Branch wise Applications
• Course Objective (Point wise)
• Course Outcomes (COs)
• Program Outcomes only heading (POs)
• COs and POs Mapping
• Program Specific Outcomes (PSOs)
• COs and PSOs Mapping
• Program Educational Objectives (PEOs)
• Result Analysis (Department Result, Subject Result and Indivisual Faculty Result)
• End Semester Question Paper Templates (Offline Pattern/Online Pattern)

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 3


CONTENTS
Perceptron Networks
• Prequisite/ Recap
• Brief Introduction about the Subject with videos
• Unit Content
• Unit Objective
• Topic Objective/Topic Outcome
• Lecture related to topic
• Daily Quiz
• Weekly Assignment
• Topic Links
• MCQ (End of Unit)
• Glossary Questions
• Old Question Papers (Sessional + University)
• Expected Questions
• Recap of Unit

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 4


Evaluation Scheme

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 5


Subject Syllabus

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 6


Text Books

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 7


Branch wise Applications

• Microprocessors are a mass storage device. They are the


advanced form of computers. Now a days, a microprocessor
based systems are used in instructions, automatic testing
product, speed control of motors, traffic light control , light
control of furnaces etc.
• Microcontrollers are used in automatically controlled
products and devices, such as automobile engine control
systems, implantable medical devices, remote controls, office
machines, appliances, power tools, toys and other embedded
systems.

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 8


Course Objectives

The major objectives of this course are as follows:


•CO1. To Demonstrate the basic architecture of 8085 & programming
model of microprocessors 8085.
CO2. To Illustrate the architecture of 8086 and programming model of
8086 microprocessor.
•CO3. To Interface different external peripheral devices with 8085
microprocessor.
•CO4. To Comprehend the architecture of 8051 microcontroller.
•CO5. To learn Assembly programming and instruction of 8051 and
compare advance level microprocessor & microcontroller for different
applications.

KEE-602 Microprocessor & Microcontroller Unit 4


5/2/2022 9
Course Outcomes
The students will be able to learn about:
•CO1. Demonstrate the basic architecture of 8085 & programming
model of microprocessors 8085.
CO2. Illustrate the architecture of 8086 and programming model of
8086 microprocessor.
•CO3. Interface different external peripheral devices with 8085
microprocessor.
•CO4. Comprehend the architecture of 8051 microcontroller.
•CO5. Assembly programming and instruction of 8051 and compare
advance level microprocessor & microcontroller for different
applications.

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 10


Program Outcomes
PO1. Engineering knowledge
PO2. Problem analysis
PO3. Design/development of solutions
PO4. Conduct investigations of complex problems
PO5. Modern tool usage
PO6. The engineer and society
PO7. Environment and sustainability
PO8. Ethics
PO9. Individual and team work
PO10. Communication
PO11. Project management and finance
PO12. Life-long learning

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 11


CO-PO Mapping
Mapping of Course Outcomes and Program Outcomes:
(1/2/3 indicates the strength of correlation; 3–strong, 2–medium, 1–weak)

S. PO PO PO PO PO PO PO PO PO PO PO PO
CO’s
No 1 2 3 4 5 6 7 8 9 10 11 12
1 CO 1 3 3 3 2 2 3 1 1 1 1 3 3

2 CO 2 3 3 3 3 2 3 2 1 1 1 3 1

3 CO 3 3 3 3 3 2 3 1 1 1 1 3 1

4 CO 4 3 3 3 2 3 3 1 1 1 1 3 1

5 CO 5 3 3 2 2 3 3 2 1 1 1 3 2
Average 3 3 2.8 2.4 2 3 1.5 1 1 1 3 1.6
5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 12
Program Specific Outcomes

PSO1: Apply fundamental knowledge to identify, formulate, design and


investigate various problems of electrical and electronic circuits, power
electronics, and power systems.
PSO2: Apply modern software tools for design, simulation and analysis
of electrical systems to engage in life- long learning and to successfully
adapt in multi-disciplinary environments.
PSO3: Solve ethically and professionally various Electrical Engineering
problems in societal and environmental context and communicate
effectively.

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 13


CO-PSO Mapping
Mapping of Program Specific Outcome and Course Outcome:

Program Course Outcomes


Specific
Outcomes CO1 CO2 CO3 CO4 CO5

PSO1 3 3 3 3 3

PSO2 3 3 3 3 3

PSO3 2 2 2 2 2

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 14


Program Education Objectives
• PEO 1 - Graduates of the program will be able to work and
adapt to the latest technologies in Electrical, Electronics and
allied fields.
• PEO 2 - Graduates will be able to pursue higher education,
contribute to cutting edge research and perform in
government / public sector units.
• PEO 3 - Graduates will exhibit excellent managerial skills,
leadership qualities and work effectively in a collaborative
environment as responsible individuals through lifelong
learning.
• PEO 4 - Graduates will be able to work as entrepreneurs by
providing sustainable solutions and giving new employment
opportunities to the society.

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 15


Result Analysis

Result Analysis 2020-21 of KEE-602

No. of Students Appeared 36

No. of Results Declared 36

No. of Carry 0

No. of Pass 36

Subject Wise 100%

Overall 4th Sem Result 100%

KEE-602 Microprocessor & Microcontroller Unit 4


5/2/2022 16
Noida Institute of Engineering and Technology,
End Semester Question Paper Templates
Greater Noida

Online Pattern: 50 MCQ of 2 Marks each

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 17


End Semester Question Paper Templates:- Offline Pattern

KEE-602 Microprocessor &


5/2/2022 18
Microcontroller Unit 4
Prerequisite

• Digital Electronics, Computer Basics.


• Using transistors, can build logic gates
– Deterministic functions of inputs (1s and 0s).
• Using feedback (outputs become inputs & we can build other stuff (latches, flip-
flops…)
• Circuit diagrams use symbols as short hand, e.g.

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 19


Objective of the UNIT

The architecture of 8051 microcontroller.

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 20


Content

• Syllabus
• 8051 Microcontroller Basics: Inside the Computer,
Microcontrollers and Embedded Processors,
• Block Diagram of 8051, PSW and Flag Bits, 8051
Register Banks and Stack, Internal Memory
Organization of 8051.
• I/O Port Usage in 8051, Types of Special Function
Registers and their uses in 8051, Pins Of 8051
(CO4). Memory
• Address Decoding, 8031/51 Interfacing With
External ROM And RAM (CO4). 8051 Addressing
Modes.
5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 21
Syllabus

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 22


Course Objectives

The major objectives of this course are as follows:


•CO1. To Demonstrate the basic architecture of 8085 & programming
model of microprocessors 8085.
CO2. To Illustrate the architecture of 8086 and programming model of
8086 microprocessor.
•CO3. To Interface different external peripheral devices with 8085
microprocessor.
•CO4. To Comprehend the architecture of 8051 microcontroller.
•CO5. To learn Assembly programming and instruction of 8051 and
compare advance level microprocessor & microcontroller for different
applications.

KEE-602 Microprocessor & Microcontroller Unit 4


5/2/2022 23
Course Outcomes
The students will be able to learn about:
•CO1. Demonstrate the basic architecture of 8085 & programming
model of microprocessors 8085.
CO2. Illustrate the architecture of 8086 and programming model of
8086 microprocessor.
•CO3. Interface different external peripheral devices with 8085
microprocessor.
•CO4. Comprehend the architecture of 8051 microcontroller.
•CO5. Assembly programming and instruction of 8051 and compare
advance level microprocessor & microcontroller for different
applications.

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 24


Program Outcomes
PO1. Engineering knowledge: Apply the knowledge of mathematics, science,
engineering fundamentals, and an engineering specialization for the solution of
complex engineering problems.
PO2. Problem analysis: Identify, formulate, research literature, and analyze
complex engineering problems reaching substantiated conclusions using first
principles of mathematics, natural sciences, and engineering sciences.
PO3. Design/development of solutions: Design solutions for complex
engineering problems and design system components or processes that meet the
specified needs with appropriate consideration for public health and safety, and
cultural, societal, and environmental considerations.
PO4. Conduct investigations of complex problems: Use research based
knowledge and research methods including design of experiments, analysis and
interpretation of data, and synthesis of information to provide valid
conclusions.
PO5. Modern tool usage: Create, select, and apply appropriate techniques,
resources, and modern engineering and IT tools, including prediction and
modeling to complex engineering activities, with an understanding of the
limitations.
5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 25
Program Outcomes

PO6. The engineer and society: Apply reasoning informed by the contextual
knowledge to assess societal, health, safety, legal and cultural issues and the
consequent responsibilities relevant to the professional engineering practice.
PO7. Environment and sustainability: Understand the impact of the
professional engineering solutions in societal and environmental contexts, and
demonstrate the knowledge of, and need for sustainable development.
PO8. Ethics: Apply ethical principles and commit to professional ethics and
responsibilities and norms of the engineering practice.
PO9. Individual and team work: Function effectively as an individual, and as
a member or leader in diverse teams, and in multidisciplinary settings.
PO10. Communication: Communicate effectively on complex engineering
activities with the engineering community and with the society at large, such as,
being able to comprehend and write effective reports and design
documentation, make effective presentations, and give and receive clear
instructions.

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 26


Program Outcomes

PO11. Project management and finance: Demonstrate knowledge and


understanding of the engineering and management principles and apply
these to one’s own work, as a member and leader in a team, to manage
projects and in multidisciplinary environments.
PO12. Life-long learning: Recognize the need for, and have the
preparation and ability to engage in independent and life-long learning
in the broadest context of technological change.

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 27


Program Outcomes

PO11. Project management and finance: Demonstrate knowledge and


understanding of the engineering and management principles and apply
these to one’s own work, as a member and leader in a team, to manage
projects and in multidisciplinary environments.
PO12. Life-long learning: Recognize the need for, and have the
preparation and ability to engage in independent and life-long learning
in the broadest context of technological change.

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 28


Program Specific Outcomes

PSO1: Apply fundamental knowledge to identify, formulate, design and


investigate various problems of electrical and electronic circuits, power
electronics, and power systems.
PSO2: Apply modern software tools for design, simulation and analysis
of electrical systems to engage in life- long learning and to successfully
adapt in multi-disciplinary environments.
PSO3: Solve ethically and professionally various Electrical Engineering
problems in societal and environmental context and communicate
effectively.

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 29


CO-PO Mapping
Mapping of Course Outcomes and Program Outcomes:
(1/2/3 indicates the strength of correlation; 3–strong, 2–medium, 1–weak)

S. PO PO PO PO PO PO PO PO PO PO PO PO
CO’s
No 1 2 3 4 5 6 7 8 9 10 11 12
1 CO 1 3 3 3 2 2 3 1 1 1 1 3 3

2 CO 2 3 3 3 3 2 3 2 1 1 1 3 1

3 CO 3 3 3 3 3 2 3 1 1 1 1 3 1

4 CO 4 3 3 3 2 3 3 1 1 1 1 3 1

5 CO 5 3 3 2 2 3 3 2 1 1 1 3 2
Average 3 3 2.8 2.4 2 3 1.5 1 1 1 3 1.6
5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 30
CO-PSO Mapping
Mapping of Program Specific Outcome and Course Outcome:

Program Course Outcomes


Specific
Outcomes CO1 CO2 CO3 CO4 CO5

PSO1 3 3 3 3 3

PSO2 3 3 3 3 3

PSO3 2 2 2 2 2

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 31


Content-Outcome-Mapping
Topic Objective
TOPIC Objective

TOPIC 1 To study Architecture of 8051

TOPIC 2 To study Memory Organization of 8051

TOPIC 3 To study Applications of I/O Ports in 8051


TOPIC 4 To study SFRs in 8051
TOPIC 5 To study Pins Of 8051 (CO4)

TOPIC 6 To study basic concepts of 8031/51 Interfacing

TOPIC 7 To study 8051 Addressing Modes

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 32


Content-Outcome-Mapping
Topic Mapping with CO
TOPIC TOPIC NAME CO4

TOPIC 1 Architecture of 8051


3
TOPIC 2 Memory Organization of 8051
2
TOPIC 3 I/O Ports in 8051
3
TOPIC 4 SFRs in 8051
3
TOPIC 5 Pins Of 8051 (CO4)
3
TOPIC 6 8031/51 Interfacing
3
TOPIC 7 8051 Addressing Modes.
3

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 33


Prerequisite

• Digital Electronics, Computer Basics.


• Using transistors, can build logic gates
– Deterministic functions of inputs (1s and 0s).
• Using feedback (outputs become inputs & we can build other stuff (latches, flip-
flops…)
• Circuit diagrams use symbols as short hand, e.g.

KEE-602 Microprocessor &


5/2/2022 34
Microcontroller Unit 4
RECAP

What’s Inside a Computer Case?

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 35


Inside the Computer (CO4)

MOTHERBOARD
• The main piece
of circuitry in a
computer.
• Everything connects
to or is wired to the
motherboard.

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 36


Inside the Computer (CO4)

Central Processing Unit (CPU)


• The computer’s
brain or heart, the
CPU is a
computer’s main
chip.
• The CPU is really
nothing more than
an incredibly fast
and powerful
calculate.

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 37


Inside the Computer (CO4)

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 38


Inside the Computer (CO4)

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 39


Inside the Computer (CO4)

ROM-BIOS
• A computer’s
ROM-BIOS
(stands for Read
Only Memory –
Basic Input /
Output System)
is a special chip
with instructions
for the computer
to communicate
with other
hardware parts.

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 40


Inside the Computer (CO4)

Random Access Memory (RAM)


• A computer’s
temporary storage
place, where it
gets its work
done.
• Example, when
you use a word
processor to type
a letter, the letter
is stored in the
computer’s
memory.

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 41


Inside the Computer (CO4)

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 42


Inside the Computer (CO4)

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 43


Inside the Computer (CO4)

Expansion Slot
• An expansion slot
lets you add more
features and
capabilities to a
computer by
plugging in
expansion cards.

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 44


Inside the Computer (CO4)

Expansion Card
• A card that allows
you to expand
your computer’s
capabilities, such
as a modem card,
a network card, a
video card, or a
sound card.

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 45


Microcontrollers and Embedded Processors (CO4)
Microcontrollers
A single chip computer or A CPU with all the peripherals like RAM,
ROM, I/O, Timers, ADCs, etc on the same chip.
OR
A microcontroller is meant to be more self-contained and independent,
and functions as a tiny, dedicated computer.
Microprocessor Based Systems
• Contains the same 6 basic components:
– Arithmetic logic unit (ALU)
– Register array
– Control unit
– Memory
– Input & Output unit

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 46


Microcontrollers and Embedded Processors (CO4)

Microcontroller Based Systems:

Memory
ROM RAM
CPU

I/O

Subsystems:
Timers, Counters, Analog
A single chip Interfaces, I/O interfaces

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 47


Microcontrollers
Microcontrollers andand Embedded
Embedded Processors
Processors (CO4)
Microcontrollers
• A microprocessor, RAM, ROM, I/O ports, and timer on a single chip
i.e. Computer on a chip.
• Also called MCU (Micro Controller Unit).
• Usually not as powerful as general purpose microprocessor.
• Low power consumption, small in size, low cost.

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 48


Microcontrollers
Microcontrollers andand Embedded
Embedded Processors
Processors (CO4)

• Many Microcontrollers are existing right now.


– 8051, 68HC11, MSP430, ARM series, and etc.
• We may widely divide it with
– how it is designed (RISC/CISC architecture)
– Manufacturer (Atmel, Intel, Microchip, Philips,…)
– ROM technology (Programming Serial/Parallel)
– RAM/ROM capacity
– Other features (ADC/DAC, Watchdog, timer/counter, Number of
IO pin

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 49


Microcontrollers and Embedded Processors (CO4)
Embedded System
• An embedded system is a computer system with a dedicated
function within a larger mechanical or electrical system, often with
real-time computing constraints.
• It is embedded as part of a complete device often including
hardware and mechanical parts.
• Embedded systems control many devices in common use today.

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 50


Microcontrollers
Microcontrollers andand Embedded
Embedded Processors
Processors (CO4)

Embedded Processors
• An embedded processor is used when fast processing fast context-
switching & atomic ALU operations are needed.
Examples : ARM 7, INTEL i960, AMD 29050.
• For an embedded system designer knowledge of microprocessor and
microcontroller is a must.
• Two Essential Units:
Operations Control Unit (CU): Fetch
Execution Unit (EU): Execute

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 51


Overview of 8051 (CO4)

• An embedded system is a computer system with a dedicated


function within a larger mechanical or electrical system, often with
real-time computing constraints.
• It is embedded as part of a complete device often including
hardware and mechanical parts.
• Embedded systems control many devices in common use today.
Features:
• 4K bytes internal ROM
• 128 bytes internal RAM
• Four 8-bit I/O ports (P0 - P3).
• Two 16-bit timers/counters
• One serial interface

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 52


Overview of 8051 (CO4)

• Commercially used 8051 microcontroller is AT89C51-12PC.

8051 Family Plastic DIP Package

AT89C51-12PC Commercial use

Atmel Corporation 12 MHz frequency


CMOS Technology

89 is a series of variants which ATMEL was developing

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 53


Block Diagram of the 8051 (CO4)
External Interrupts

Interrupt 4k 128 bytes Timer 1


Control ROM RAM Timer 2

CPU

OSC Bus
4 I/O Ports Serial
Control

P0 P2 P1 P3 TXD RXD
Addr/Data
5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 54
PSW and Flag Bits (CO4)
Program Status Word Register (Flag Bit)
• PSW is an 8 bit register but only 6 bit can be used.
CY AC F0 RS1 RS0 OV - P
Parity Flag (P)
P=0, if Accumulator contains an even no 1’s.
=1, if Accumulator contains an odd no 1’s.
RS1 & RS0 (Register Bank select)
• It is used to change the register bank.
RS1 RS0 Register Bank Address
0 0 0 00-07H
0 1 1 08-0FH
1 0 2 10-17H
1 1 3 18-1FH

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 55


PSW and Flag Bits (CO4)
Program Status Word Register (Flag Bit)
Overflow Flag (OV)
• This flag bit is set whenever the result of signed number is too
large.
• It is used only for signed arithmetic operation.
F0
• It is unused & it is considered as 0.
Auxiliary Carry Flag (AC)
• This is used by instructions that perform BCD operation.
• If there is a carry from D3 to D4 during ADD or SUB operation,
this bit is set otherwise it is cleared.
Carry Flag (CY)
• It is set when there is a carry out from D7 bit.
• This can be set to 1 or 0 directly by instruction.
Example: SETB C Set bit carry
CLR C Clear Carry
5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 56
PSW and Flag Bits (CO4)
Example
Q. Show the contents of the PSW register after the execution of
following instructions.
MOV A, #0BFH
ADD A, #1BH

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 57


8051 Register Banks and Stack (CO4)

Register
• In the CPU, register is used to store information temporarily.
• Registers are broadly categorized into two parts:
• Depending upon size.
• Depending upon function.
• Depending upon size:
– 8 bit register
– 16 bit register
• Depending upon function:
– General Purpose Register
– Special Function Register

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 58


8051 Register Banks and Stack (CO4)
Structure of Register
MSB LSB
D7 D6 D5 D4 D3 D2 D1 D0

• Most widely used registers in 8051 are A, B, R0, R1, R2, R3, R4,
R5, R6, R7, DPTR & PC.
• DPTR register is divided into two parts:
• DPH (Data pointer higher byte)
• DPL (Data pointer lower byte)
Accumulator (A) Register
The Accumulator is used to hold the data for almost all the ALU
Operations.
Examples:
MOV A,R0

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 59


8051 Register Banks and Stack (CO4)

Program Counter (PC)


• It is of 16 bit.
• It points to the address of next instruction to be executed.
• As the CPU fetches, the opcode from the program ROM, the PC is
incremented to point to the next instruction.
• The default address of PC is 0000H.
Register B
• The B Register is used along with the ACC in Multiplication and
Division operations.
• These two operations are performed on data that are stored only in
Registers A and B.
• During Multiplication Operation, one of the operand (multiplier or
multiplicand) is stores in B Register and also the higher byte of the
result.

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 60


8051 Register Banks and Stack (CO4)

Data Pointer (DPTR)


• The Data Pointer is a 16-bit Register and is physically the
combination of DPL (Data Pointer Low) and DPH (Data Pointer
High) SFRs.
• The Data Pointer can be used as a single 16-bit register (as DPTR)
or two 8-bit registers (as DPL and DPH).
• DPTR doesn’t have a physical Memory Address but the DPL
(Lower Byte of DPTR) and DPH (Higher Byte of DPTR) have
separate addresses in the SFR Memory Space. DPL = 82H and DPH
= 83H.
• The DPTR Register is used by the programmer addressing external
memory.

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 61


8051 Register Banks and Stack (CO4)

Register Bank
• This is divided into 4 banks of register in which each banks has 8
registers (R0-R7). Bank 0 Bank 1 Bank 2 Bank 3
– Bank0 (00-07H) R7 R7 R7
– Bank0 (08-0FH) R6 R6 R6
– Bank0 (10-17H) R5 R5 R5

– Bank0 (18-1FH) R4 R4 R4
R3 R3 R3
R2 R2 R2
R1 R1 R1
R0 R0 R0

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 62


8051 Register Banks and Stack (CO4)

Stack
• The register used to access the 7FH

stack is called SP (stack pointer) Scratch pad RAM

register. 30H

• The stack pointer in the 8051 is 2FH


Bit-Addressable RAM
only 8 bits wide, which means
20H
that it can take value 00 to FFH. 1FH Register Bank 3
When 8051 powered up, the SP 18H
17H
register contains value 07. 10H
Register Bank 2

0FH (Stack) Register Bank 1


08H
07H
Register Bank 0
00H

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 63


Internal Memory Organization of 8051 (CO4)
RAM memory space allocation
• RAM size of 8051 is 128 Bytes & Address is: 00 to 7FH.
• 128 Bytes are divided into three parts.
– 32 Bytes (00H to 1FH)
– 16 Bytes (20H to 2FH)
– 80 Bytes (30H to 7FH)

1) 32 Bytes (00H to 1FH)


• It is used for register bank & stack.
2) 16 Bytes (20H to 2FH)
• It is used to set bit addressable read write memory.
3) 80 Bytes (30H to 7FH)
• It is used for read/write storage.
• It is available for programmers.

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 64


Internal Memory Organization of 8051 (CO4)
RAM memory space allocation
7FH

Scratch pad RAM

30H

2FH

Bit-Addressable RAM
20H
1FH
18H
Register Bank 3
17H
10H Register Bank 2
0FH
08H Register Bank 1
07H
00H Register Bank 0
5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 65
Internal Memory Organization of 8051(CO4)
Internal RAM memory organization
7F
General purpose RAM
80 bytes
30
2F 7F 7E 7D 7C 7B 7A 79 78

Bit addressable RAM


16 bytes ( 80 bits)
0F 0E 0D 0C 0B 0A 09 08
20 07 06 05 04 03 02 01 00
1F Bank 3
Bank 2
Bank 1 4 Reg. BANK 8 bytes each
Bank 0
32 bytes
00
5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 66
Pins Of 8051 (CO4)

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 67


Pins Of 8051 (CO4)
Pin Description of 8051
I/O PORTS
• There are four ports.
PORT 0 – (Pin 32 to Pin 39)
PORT 1 – (Pin 1 to Pin 8)
PORT 2 – (Pin 21 to Pin 28)
PORT 3 – (Pin 10 to Pin 17)
• Each port can be used as input or output (bi-direction).
• Each port is of 8 bit.
ALE/PROG
When this pin is high it latches the low byte of the address during
accesses to external memory. This pin is low during EPROM
programming.
PSEN
Program Store Enable is the read strobe to external program memory.
EA/VPP
This pin is an active low pin connected to ground when microcontroller is
accessing the program code stored in the external memory and connected
to Vcc when it is accessing the program code in the on chip memory.
5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 68
Pins Of 8051 (CO4)
RST(pin 9) Reset

• It is an input pin and is active high( normally low)


• The high pulse must be high at least 2 machine cycles.
• It is a power-on reset.
• Upon applying a high pulse to RST, the microcontroller
will reset and all values in registers will be lost.
• Reset values of some 8051 registers.

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 69


Pins Of 8051 (CO4)
RST(pin 9) Reset
Register Reset value
PC 0000
ACC 00
B 00
PSW 00
SP 07
DTPR 0000

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 70


Pins Of 8051 (CO4)
FIGURE. RESET WITH DEBOUNCE CIRCUIT
Vcc

10 uF 31
EA/VPP
30 pF X1
19
11.0592 MHz
8.2 K
X2
18
30 pF
9 RST

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 71


Pins Of 8051 (CO4)

Port 3 Alternate Functions:

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 72


IO Port Usage in 8051(CO4)

• Each port can be used as input or output (bi-direction).

Port 0
• When used as input, a ‘1’ must be written to corresponding
port latch.
• Used as an output,’0’ must be be programmed.
• Logic ‘1’ in address bit will turn Upper FET on & lower FET
off.
• After address has formed & latched into External circuitry by
ALE pulse, the External Bus is turned ON.
• Port 0 now reads data from External Memory.
• Port 0 pins can be accessed by address P0.0,P0.1,….,P0.7.
• It can also be addressed as AD0,AD1,…….AD7.

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 73


IO Port Usage in 8051(CO4)

Port 1
• Port 1 pins have no Dual functions.
• If used as input a ‘1’ is written to latch which turns upper FET
on.
• Used as output, lower FET is On & the Pull up is Off.
• Output latch is directly connected to gate of Lower FET.
• Port 1 can be accessed as P1.0,P1.1,. . . . .P1.7.

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 74


IO Port Usage in 8051(CO4)

Port 2
• It can be used as i/p or o/p which is similar in operation of
Port 1.
• The alternate use of port 2 is to supply a high-order address
byte in conjunction with port 0 low-order byte to address
external memory.
• Port 2 latches remain stable when External Memory is
addressed.
• They do not have to be turned around (Set to 1) for Data i/p as
in Port 0.
• It can be accessed as P2.0,P2.1,. . . . . ,P2.7

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 75


IO Port Usage in 8051(CO4)
Port 3
• It is similar to port 1,but has alternate uses.
• Each pin may be individually Programmed as I/O or for
alternate Functions.
Pin Alternate Use SFR
P3.0-RXD Serial data input SBUF
P3.1-TXD Serial data Output SBUF
P3.2-INT0 External interrupt 0 TCON.1
P3.3-INT1 External interrupt 1 TCON.3
P3.4-T0 External timer 0 input TMOD
P3.5-T1 External timer 1 input TMOD
P3.6-WR External Memory Write Pulse -
P3.7-RD External Memory Read Pulse -
5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 76
IO Port Usage in 8051(CO4)
Writing “1” to Output Pin P1.X

Read latch Vcc


TB2
Load(L1) 2. output pin is
Vcc
1. write a 1 to the pin
1 P1.X
Internal CPU D Q
bus P1.X pin
0 output 1
Write to latch Clk Q M1

TB1
Read pin

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 77


IO Port Usage in 8051(CO4)
Writing “0” to Output Pin P1.X

Read latch Vcc


TB2
Load(L1) 2. output pin is
ground
1. write a 0 to the pin
0 P1.X
Internal CPU D Q
bus P1.X pin
1 output 0
Write to latch Clk Q M1

TB1
Read pin

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 78


IO Port Usage in 8051(CO4)

Reading “High” at Input Pin

Read latch Vcc 2. MOVA,P1


TB2 external pin=High
1. write a 1 to the pin MOV Load(L1)
P1,#0FFH

1 1 P1.X pin
Internal CPU bus D Q
P1.X
0 M1
Write to latch Clk Q

TB1
Read pin
3. Read pin=1 Read latch=0
Write to latch=1
8051 IC

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 79


IO Port Usage in 8051(CO4)
Reading “Low” at Input Pin

Read latch Vcc 2. MOVA,P1


TB2
1. write a 1 to the pin external pin=Low
Load(L1)
MOV P1,#0FFH
1 0 P1.X pin
Internal CPU bus D Q
P1.X
0 M1
Write to latch Clk Q

TB1
Read pin
3. Read pin=1 Read latch=0
Write to latch=1
8051 IC

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 80


Types of Special Function Registers and their
uses in 8051(CO4)
SFR (SPECIAL FUNCTION REGISTERS)

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 81


RECAP: Block Diagram of the 8051(CO4)
External Interrupts

Interrupt 4k 128 bytes Timer 1


Control ROM RAM Timer 2

CPU

OSC Bus
4 I/O Ports Serial
Control

P0 P2 P1 P3 TXD RXD
Addr/Data
5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 82
Types of Special Function Registers and their
uses in 8051(CO4)
Use of SFR (SPECIAL FUNCTION REGISTERS)

IE (Interrupt Enable, Addresses A8h)


• The Interrupt Enable SFR is used to enable and disable specific
interrupts.
• The low 7 bits of the SFR are used to enable/disable the specific
interrupts, where as the highest bit is used to enable or disable
ALL interrupts.
• Thus, if the high bit of IE is 0 all interrupts are disabled
regardless of whether an individual interrupt is enabled by
setting a lower bit.

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 83


Types of Special Function Registers and their
uses in 8051(CO4)
Use of SFR (SPECIAL FUNCTION REGISTERS)

IP (Interrupt Priority, Addresses B8h, Bit-Addressable)


• The Interrupt Priority SFR is used to specify the relative priority of
each interrupt.
• On the 8051, an interrupt may either be of low (0) priority or high (1)
priority.
• An interrupt may only interrupt interrupts of lower priority. For
example, if we configure the 8051 so that all interrupts are of low
priority except the serial interrupt, the serial interrupt will always be
able to interrupt the system, even if another interrupt is currently
executing. However, if a serial interrupt is executing no other
interrupt will be able to interrupt the serial interrupt routine since the
serial interrupt routine has the highest priority.

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 84


Types of Special Function Registers and their
uses in 8051(CO4)
Use of SFR (SPECIAL FUNCTION REGISTERS)

PCON (Power Control, Addresses 87h)


• The Power Control SFR is used to control the 8051's power control
modes.
• Certain operation modes of the 8051 allow the 8051 to go into a type
of "sleep" mode which requires much less power.
• These modes of operation are controlled through PCON.
• Additionally, one of the bits in PCON is used to double the effective
baud rate of the 8051's serial port.

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 85


Types of Special Function Registers and their
uses in 8051(CO4)
Use of SFR (SPECIAL FUNCTION REGISTERS)

SCON (Serial Control, Addresses 98h, Bit-Addressable)


• The Serial Control SFR is used to configure the behavior of the
8051's on-board serial port.
• This SFR controls the baud rate of the serial port, whether the serial
port is activated to receive data, and also contains flags that are set
when a byte is successfully sent or received.

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 86


Types of Special Function Registers and their
uses in 8051(CO4)
Use of SFR (SPECIAL FUNCTION REGISTERS)

SBUF (Serial Control, Addresses 99h)


• The Serial Buffer SFR is used to send and receive data via the on-
board serial port.
• Any value written to SBUF will be sent out the serial port's TXD pin.
• Likewise, any value which the 8051 receives via the serial port's RXD
pin will be delivered to the user program via SBUF.
• In other words, SBUF serves as the output port when written to and as
an input port when read from.

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 87


Types of Special Function Registers and their
uses in 8051(CO4)
Use of SFR (SPECIAL FUNCTION REGISTERS)

TMOD (Timer Mode, Addresses 89h)


• The Timer Mode SFR is used to configure the mode of operation of
each of the two timers.
• Using this SFR your program may configure each timer to be a 16-bit
timer, an 8-bit autoreload timer, a 13-bit timer, or two separate timers.
• Additionally, you may configure the timers to only count when an
external pin is activated or to count "events" that are indicated on an
external pin.

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 88


Types of Special Function Registers and their
uses in 8051(CO4)
Use of SFR (SPECIAL FUNCTION REGISTERS)

TCON (Timer Control, Addresses 88h, Bit-Addressable)


• The Timer Control SFR is used to configure and modify the way in
which the 8051's two timers operate.
• This SFR controls whether each of the two timers is running or
stopped and contains a flag to indicate that each timer has
overflowed.
• Additionally, some non-timer related bits are located in the TCON
SFR.
• These bits are used to configure the way in which the external
interrupts are activated and also contain the external interrupt flags
which are set when an external interrupt has occurred.

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 89


Types of Special Function Registers and their
uses in 8051(CO4)
Use of SFR (SPECIAL FUNCTION REGISTERS)

TL0/TH0 (Timer 0 Low/High, Addresses 8Ah/8Ch)


• These two SFRs, taken together, represent timer 0.
• Their exact behavior depends on how the timer is configured in the
TMOD SFR; however, these timers always count up.
• What is configurable is how and when they increment in value?
TL1/TH1 (Timer 1 Low/High, Addresses 8Bh/8Dh)
• These two SFRs, taken together, represent timer 1.
• Their exact behavior depends on how the timer is configured in the
TMOD SFR; however, these timers always count up.
• What is configurable is how and when they increment in value?

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 90


Memory Address Decoding (CO4)

Simple logic gate address decoder

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 91


Memory Address Decoding (CO4)

Using the 74LS138 3-8 decoder

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 92


Memory Address Decoding (CO4)

74LS138 as Decoder

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 93


Memory Address Decoding (CO4)

74LS138 as Decoder

⚫ Using programmable logic as an address decoder.


⚫ The advantage of these chips is that they can be programmed
for any combination of address ranges, and so are much more
versatile.
⚫ PALs and GALS have 10 or more inputs (in contrast to 6 in
the 74138) means that they can accommodate more address
inputs.

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 94


8031/51 Interfacing With External ROM And RAM (CO4)

8031/51 INTERFACING WITH EXTERNAL ROM


EA pin
⚫Connect the EA pin to
Vcc to indicate that the
program code is stored in
the microcontroller on-
chip ROM.
⚫To indicate that the program
code is stored in external ROM,
this pin must be connected to
GND.

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 95


8031/51 Interfacing With External ROM And
RAM (CO4)
8031/51 INTERFACING WITH EXTERNAL ROM
74LS373 D Latch

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 96


8031/51 Interfacing With External ROM And
RAM (CO4)
8031/51 INTERFACING WITH EXTERNAL ROM
P0 and P2 role in providing addresses

Address/Data Multiplexing
5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 97
8031/51 Interfacing With External ROM And
RAM (CO4)
8031/51 INTERFACING WITH EXTERNAL ROM

Data, Address, and Control Buses for the 8031


5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 98
8031/51 Interfacing With External ROM And
RAM (CO4)
8031 INTERFACING WITH EXTERNAL ROM

8031 Connection to External Program ROM


5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 99
8031/51 Interfacing With External ROM And
RAM (CO4)
8031/51 INTERFACING WITH EXTERNAL ROM
PSEN

On-chip and Off-chip Program Code Access

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 100


8031/51 Interfacing With External ROM And
RAM (CO4)
8031/51 INTERFACING WITH EXTERNAL ROM

⚫ On-chip and off-chip code ROM


⚫ In such a system we still have EA = Vcc, meaning that upon
reset the 8051 executes the on-chip program first; then, when it
reaches the end of the on-chip ROM it switches to external
ROM for the rest of the program code.

On-chip and Off-chip Program Code Access

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 101


8031/51 Interfacing With External ROM And
RAM (CO4)
8051 INTERFACING WITH EXTERNAL ROM
Data memory space

8051 Connection to External Data ROM

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 102


8031/51 Interfacing With External ROM And
RAM (CO4)
8051 INTERFACING WITH EXTERNAL ROM

⚫ External ROM for data.


⚫ For the ROM containing the program code, PSEN is used to fetch
the code.
⚫ For the ROM containing data, the RD signal is used to fetch the
data.

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 103


8031/51 Interfacing With External ROM And
RAM (CO4)
8031 INTERFACING WITH EXTERNAL ROM
MOVX instruction

8031 Connection to External Data ROM and External Program ROM

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 104


8031/51 Interfacing With External ROM And
RAM (CO4)
8051 INTERFACING WITH EXTERNAL RAM
MOVX instruction for external RAM data

8051 Connection to External Data RAM

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 105


8031/51 Interfacing With External ROM And
RAM (CO4)
8031 INTERFACING WITH EXTERNAL ROM
A single external ROM for code and data

A Single ROM for Both Program and Data

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 106


8031/51 Interfacing With External ROM And
RAM (CO4)
8031 INTERFACING WITH EXTERNAL ROM & RAM

8031 Connection to External Program ROM, Data RAM, and Data ROM

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 107


8031/51 Interfacing With External ROM And
RAM (CO4)
8051 INTERFACING WITH EXTERNAL RAM
Interfacing to large external memory

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 108


8051 Addressing Modes (CO4)

Definition:-
• The different ways in which a source operand in an instruction are
known as the addressing modes.
• The 8051 provides a total of 5 distinct addressing modes.

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 109


8051 Addressing Modes (CO4)
Types of Addressing Modes

Addressing
modes

Immediate Register Direct Register Indexed


Addressing Addressing Addressing indirect Addressing
mode mode mode Addressing mode
mode

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 110


8051 Addressing Modes (CO4)
Immediate addressing mode
• In this addressing mode the source operand is constant.
• In immediate addressing mode, when the instruction is assembled,
the operand comes immediately after the op-code.
• The immediate data must be preceded by ‘#’ sign.
• This addressing mode can be used to load information into any of
the register, including the DPTR.
Ex:
– MOV A,#25H
– MOV R4,#62
– MOV DPTR,#4532H

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 111


8051 Addressing Modes (CO4)
Register addressing mode
• Register addressing mode involves the use of registers to hold the
data to be manipulated.
Ex :-
– MOV A,R0 // copy the contents of R0 in to A.
– MOV R2,A // copy the contents of A in to R2.
– ADD A,R5 // add the content of R5 to content of A.

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 112


8051 Addressing Modes (CO4)
Direct addressing mode
• In direct addressing mode, the data is in a RAM memory location
whose address is known, and this address is given as a part of the
instruction.
• Contrast this with the immediate addressing mode in which the
operand itself is provided with the instruction.
Ex:-
MOV R0,40H // save content of RAM location 40h into R0.
MOV 56H,A //save content of A in RAM location 56H

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 113


8051 Addressing Modes (CO4)
Register indirect addressing mode
• In the register indirect addressing mode, a register is used as a
pointer to the data.
• If the data is inside the CPU, only register R0 and R1 are used for
this purpose.
• In other words, R2-R7 cannot be used to hold the address of an
operand located in RAM when using this addressing mode.
• When R0 and R1 are used as pointers , that is, when they hold the
address of RAM locations , they must be preceded by the “@”
sign.
Ex:
• MOV A,@R0 // move contents of RAM location whose address is
held by R0 into A.
• MOV @R1,B // move contents of B, RAM location whose
address is held by R1

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 114


8051 Addressing Modes (CO4)
Indexed addressing mode
• Indexed addressing mode is widely used in accessing data elements
of look-up table entries located in the program ROM space of the
8051.
• The instruction used for this purpose is “MOV A, @A+DPTR”.
• The 16-bit register DPTR and register “A” are used to form the data
element stored in on-chip ROM, Because the data elements are
stored in the program space ROM of the 8051, it uses the
instruction MOVC instead of MOV.
• In this instruction the content of A are
added to the 16-bit register DPTR to form the 16-bit address of the
needed data.
Ex: MOVC A,@A+DPTR

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 115


Expected Questions for University Exam

• 2a) Explain how Address and Data Bus are multiplexed in 8085 microprocessor and
how
demultiplexing is done. Describe the advantage of using multiplexed Address and
Data Buses. Describe the role of ALE signal in DE multiplexing the buses.
b) Describe the various Interrupts of 8085 microprocessor. Classify the interrupts
of
8085 as maskable or non-maskable and vectored or non-vectored.
c) Describe the Programming System registers of MSP430. Explain the concept and
the
function of Pull-up and Pull-down registers using suitable diagrams.
d) Explain the concept of Interrupts. Compare the polling method with interrupt
driven
method. Name the interrupts of MSP430 and describe the sources of interrupts.
e) For an MSP430 based embedded system application and using the interface
protocols
for communication with external devices, design and explain the functioning of A
Low-Power Battery less Wireless Temperature and Humidity Sensor with Passive
Low Frequency RFID.

KEE-602 Microprocessor &


5/2/2022 116
Microcontroller Unit 4
Summary

This chapter discusses an Overview of what is an 8051


Microcontroller, its Architecture, and Its Applications In Embedded
Systems.

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 117


Summary
: Types of Special Function Registers and their uses in 8051
SFR (SPECIAL FUNCTION REGISTERS)

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 118


Summary
: 8031/51 Interfacing With External ROM And RAM (CO4)

8031/51 INTERFACING WITH EXTERNAL ROM


EA pin
⚫Connect the EA pin to
Vcc to indicate that the
program code is stored in
the microcontroller on-
chip ROM.
⚫To indicate that the program
code is stored in external ROM,
this pin must be connected to
GND.

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 119


Summary: 8051 Addressing Modes (CO4)

Types of Addressing Modes

Addressing
modes

Immediate Register Direct Register Indexed


Addressing Addressing Addressing indirect Addressing
mode mode mode Addressing mode
mode

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 120


References

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 121


Daily Quiz

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 122


Daily Quiz

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 123


Daily Quiz

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 124


Daily Quiz

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 125


MCQ s

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 126


MCQ s

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 127


MCQ s

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 128


MCQ s

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 129


Glossary Questions

1. What is Micro controller?


2. What is the difference between microprocessor & micro
controller?
3. List the addressing modes of 8051?
4. Explain the instructions used to access external RAM.
5. List the features of 8051 microcontroller?
6. Explain the interrupts of 8051 microcontroller?
7. What is the function of program counter in 8051?
8. Write about the jump statement?
9. Write about CALL statement in 8051?
10. Explain the operating mode0 of 8051 serial ports?
11. Explain the operating mode2 of 8051 serial ports?
12. Explain the mode3 of 8051 serial ports?
KEE-602 Microprocessor &
5/2/2022 130
Microcontroller Unit 4
Old Question Papers

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 131


Old Question Papers

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 132


Faculty Video Links, Youtube & NPTEL Video Links and Online
Courses Details

• Youtube/other Video Links:


1. https://www.youtube.com/watch?v=RdjtRpFlAnc&list=PLiQ6yyBxf5MoSZKM
OqFredyH24e6sdZL4
2. https://www.youtube.com/watch?v=gjKABJbKGHo
3. https://www.youtube.com/watch?v=zNFh9orwJC0&t=2s
4. https://www.youtube.com/watch?v=BxxLqTtEI9s
5. https://www.youtube.com/watch?v=O-UALuVyyLY&t=17s
6. https://www.youtube.com/watch?v=JwCTkm43CxQ
7. https://www.youtube.com/watch?v=CmvUY4S0UbI
8. https://www.youtube.com/watch?v=mhHJV21CDjs&t=488s

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 133


Weekly Assignment
• 1. Write a short note on Assembler Level Program (ASMs).
• 2. Write a short note on Memory Space.
• 3. How does the microprocessor differentiate between data and
instruction?
• 4. Give a block diagram and describe it. use of microprocessor to control the
temperature of an electric oven. With the help of flow chart explain the
algorithm used for temperature control.
• 5. Explain assembler level programming and draw the flowchart of
assembler level programming?
• 6. Give brief description of basic elements of assembly languages.
• 7. Explain the difference between compiler and interpreter.
• 8. Draw architecture of 8086 explain its different unit. What do you mean
by pipelining and explain the concept of memory segmentation?
• 9. Differentiate among address and data buses of 8085 and 8086
microprocessor?
• 10. Differentiate between offset, physical and effective addresses in 8086.

5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 134


5/2/2022 KEE-602 Microprocessor & Microcontroller Unit 4 135

You might also like