Docsity

Hardware Aspects Part 2-Microcontroller 8051-Lecture Slides, Slides of Microcontrollers

Toggle sidebar
bg1
H
a
r
d
w
a
r
e
A
s
p
e
c
t
s
F0 F1
F2
F3 F4
F5 F6 F7
E0 E1 E2
E3 E4 E5 E6
E7
D0 D2
D3 D4 D5 D6
D7
B0 B1 B2
B3 B4 B5 B6
B7
A0 A1 A2
A3 A4 A5 A6
A7
90 91 92
93 94 95 96
97
80 81 82
83 84 85 86
87
A8 A9
AA
AB AC
- - AF
98 99
9A
9B 9C
9D 9E 9F
-
88 89
8A
8B 8C
8D 8E 8F
B8 B9
BA
BB BC
- - -
not bit addressable
not bit addressable
not bit addressable
not bit addressable
not bit addressable
not bit addressable
not bit addressable
not bit addressable
not bit addressable
not bit addressable
80
81
82
83
87
88
89
8A
8B
8C
8D
90
98
99
A0
A8
B0
B8
D0
E0
F0
FF
Byte
address Bit address
B
ACC
PSW
IP
P3
IE
P2
SBUF
SCON
P1
TH1
TH0
TL1
TL0
TMOD
TCON
PCON
DPH
DPL
SP
P0
SPECIAL FUNCTION REGISTERS
S.F.R.s
docsity.com
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Hardware Aspects Part 2-Microcontroller 8051-Lecture Slides and more Slides Microcontrollers in PDF only on Docsity!

H a r d w a r e A s p e c t s

F7 F6 F5 F4 F3 F2 F1 F E7 E6 E5 E4 E3 E2 E1^ E D7 D6 D5 D4 D3 D2^ D

B7 B6 B5 B4 B3 B2 B1^ B

A7 A6 A5 A4 A3 A2 A1^ A

97 96 95 94 93 92 91 90

87 86 85 84 83 82 81 80

AF - - AC AB AA A9 A

9F 9E 9D 9C 9B 9A 99 98

8F 8E 8D 8C 8B 8A 89 88

      • BC BB BA B9 B

not bit addressable^ not bit addressable not bit addressable not bit addressable not bit addressable

not bit addressable not bit addressable not bit addressable

not bit addressable

not bit addressable

80

8182

83

8788

89 8A

8B^ 8C

8D

90

9899

A

A

B

B

D

E

F0^ FF

Byte address Bit address B ACC PSW IP P IE P SBUF SCON P TH1 TH TL1 TL TMOD TCON PCON DPH DPL SP P SPECIAL FUNCTION REGISTERS

S.F.R.s

docsity.com

PSW register BIT SYMBOL ADDRESS BIT DESCRIPTION PSW.7 CY D7H Carry flag PSW.6 AC D6H Auxiliary carry flag PSW.5 F0 D5H Flag 0 PSW.4 RS1 D4H Register bank select 1 PSW.3 RS0 D3H Register bank select 0 00=bank 0; addresses 00H-07H 01=bank 1; addresses 08H-0FH 10=bank 2; addresses 10H-17H 11=bank 3; addresses 18H-1FH PSW.2 OV D2H Overflow flag PSW.1 -- D1H Reserved PSW.0 P D0H Even parity flag

H a r d w a r e A s p e c t

s docsity.com

H Access to External Code Memory a r d w a r e A s p e c t s 8051 can address up to 64K bytes of code memory (16 bit address, 2^16 = 65,536)

Port 0

8051

ALE Port 2

PSEN

EA

G

Q

D0 - D

A0 -A

A8 -A

OE

64K bytes EPROM

74HC

OE

AD0 - AD

A8 -A

CS

D

docsity.com

H Access to External Code Memory a r d w a r e A s p e c t s In 1 Machine Cycle

  • There exists 12 Oscillator Period, * ALE pulses twice,
  • 2 bytes are fetched from external code (if inst. > 1 Byte)

PCH = Program counter high byte, PCL = Program counter low byte

S P1 P

S1 S2 S3 S4 S5 S P1 P2 P1 P2 P1 P2 P1 P2 P1 P2 P1 P

1 Memory Cycle

Osc. ALE PSEN Port 2 Port 0

PCH PCL


Opcode PCL

PCH Byte 2

1 Machine Cycle 1 Memory Cycle

Read timing for external code memory docsity.com

H Address Decoding a r d w a r e A s p e c t s For the interfacing of multiple EPROMs and RAMs, address decoding is required 213 bytes = 8,192 bytes = 8K bytes (0000H — 1FFFH) Address bus Data bus

EPROM^2764 A0 -A12(8k Byte) CS CS CS

CS CS CS

PSEN (^) OED0 - D7^ OEW 6264 D0 - D (8k Byte)RAM A0 -A

RDWR

A15A A

CB A E1E E

(^01) (^23) (^45) (^67)

Select otherEPROMs/RAMs

74HC

+5v Address decoding of multiple8K EPROMs and RAMs docsity.com

H 8032/8052 Enhancement a r d w a r e A s p e c t s

Accessible by indirect addressing only

Accessible by direct addressing only

Accessible by direct & indirect addressing

00H

7FH

80H

FFH

80H

FFH

Lower 128 Bytes

Upper 128 Bytes S.F.R.s

docsity.com

H Reset Operation a r d w a r e A s p e c t s A high logic level (‗ 1 ‘ / 5V) applied to the RST input will reset the microcontroller. All the memory locations become 00H except all ports (FFH), SP (07H) and Program counter (0000H). The first instruction will be fetched from the memory location 0000H in the code memory. Reset Circuits

RST

+5V

8.2k

+10uF RST

(^100) Reset

+5V

+10uF

8.2k

Power on Reset Push to Reset

docsity.com

H Stack Memory a r d w a r e A s p e c t s ♦ It is a ―Last in First out Memory‖ resides in the same 128 Bytes internal RAM ♦ PUSH and POP instruction are used to access the stack memory pointed by the SFR ―SP‖ (Stack Pointer). Instruction context PUSH Direct, POP Direct ♦ The default value of SP is 07H after reset but can be changed by the instruction MOV SP, #___ ♦ Pushing on the stack increments the SP before writing the data. ♦ Popping from the stack reads data and then decrements the SP ♦ Very useful when shifting program control temporarily. docsity.com