Unit4 KEE602
Unit4 KEE602
Greater Noida
8051 Microcontroller Basics
Unit: 04
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 3 3 3 3 3
PSO2 3 3 3 3 3
PSO3 2 2 2 2 2
No. of Carry 0
No. of Pass 36
• 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
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.
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:
PSO1 3 3 3 3 3
PSO2 3 3 3 3 3
PSO3 2 2 2 2 2
MOTHERBOARD
• The main piece
of circuitry in a
computer.
• Everything connects
to or is wired to the
motherboard.
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.
Expansion Slot
• An expansion slot
lets you add more
features and
capabilities to a
computer by
plugging in
expansion cards.
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.
Memory
ROM RAM
CPU
I/O
Subsystems:
Timers, Counters, Analog
A single chip Interfaces, I/O interfaces
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
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
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
• 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
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
Stack
• The register used to access the 7FH
register. 30H
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
10 uF 31
EA/VPP
30 pF X1
19
11.0592 MHz
8.2 K
X2
18
30 pF
9 RST
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.
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.
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
TB1
Read pin
TB1
Read pin
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
TB1
Read pin
3. Read pin=1 Read latch=0
Write to latch=1
8051 IC
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)
74LS138 as Decoder
74LS138 as Decoder
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
8031 Connection to External Program ROM, Data RAM, and Data ROM
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.
Addressing
modes
• 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.
Addressing
modes