Read Chapter 3, The 8051 Microcontroller Architecture, Programming and Applications by Kenneth .J.Ayala
Read Chapter 3, The 8051 Microcontroller Architecture, Programming and Applications by Kenneth .J.Ayala
Read Chapter 3, The 8051 Microcontroller Architecture, Programming and Applications by Kenneth .J.Ayala
Contents:
Introduction
8051
Architecture
Addressing
Modes
Timers
Saturday, October 8, 20
16
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
8051
40
39
38
37
36
35
34
33
32
31
30
29
28
27
26
25
24
23
22
21
Vcc
P0.0(AD0
P
) 0.1(AD1)
P0.2(AD2
P
) 0.3(AD3)
P0.4(AD4)
P0.5(AD5)
P0.6(AD6)
P0.7(AD7)
EA/VPP
ALE/PROG
PSEN
P2.7(A15)
P2.6(A14
)P2.5(A13
P
) 2.4(A12
)P2.3(A11)
P2.2(A10)
P2.1(A9)
P2.0(A8)
Saturday, October 8, 20
16
Saturday, October 8, 20
16
Saturday, October 8, 20
16
Saturday, October 8, 20
16
Block Diagram
Saturday, October 8, 20
16
Saturday, October 8, 20
16
Saturday, October 8, 20
16
Specific Features
Saturday, October 8, 20
16
Specific Features
Saturday, October 8, 20
16
AC
F0
RS1
RS0
OV
Carry flag
Auxiliary carry flag
Available to the user for general purpose
Register Bank selector bit 1
Register Bank selector bit 0
Overflow flag
User define bit
Parity flag Set/Reset odd/even parity
RS1
RS0
Register Bank
--
PSW.7
PSW.6
PSW.5
PSW.4
PSW.3
PSW.2
PSW.1
PSW.0
CY
AC
-RS1
RS0
OV
-P
Address
00H-07H
08H-0FH
10H-17H
18H-1FH
Saturday, October 8, 20
16
Memory Organization
RAM memory space allocation in the 8051
7FH
Scratch pad RAM
30H
2FH
Bit-Addressable RAM
20H
1FH
18H
17H
10H
0FH
08H
07H
00H
Saturday, October 8, 20
16
Register Bank 3
Register Bank 2
Register Bank 1( Stack)
Register Bank 0
7FH
Scratch pad RAM
30H
Saturday, October 8, 20
16
2FH
Bit-Addressable RAM
20H
1FH
18H
17H
10H
0FH
08H
07H
00H
Register Bank 3
Register Bank 2
Register Bank 1( Stack)
Register Bank 0
Name
Function
Name
Function
Accumulator
SBUF
Arithmetic
SP
Stack Pointer
DPH
Addressing Ext
Memory
TMOD
Timer/Counter mode
cntrl
DPL
Addressing Ext
Memory
TCON
Timer/Counter cntrl
IE
Interrupt enable
TL0
IP
Interrupt Priority
TH0
P0
TL1
P1
TH1
P2
P3
PCON
Power Control
PSW
SCON
Serial PortCntrl
Saturday, October 8, 20
16
ALE Pin
The ALE pin is used for de-multiplexing the
address and data by connecting to the G pin of
the 74LS373 latch.
When ALE=0, P0 provides data D0-D7.
When ALE=1, P0 provides address A0-A7.
The reason is to allow P0 to multiplex address and
data.
Saturday, October 8, 20
16
Saturday, October 8, 20
16
Function
Pin
P3.0
P3.1
P3.2
P3.3
P3.4
P3.5
P3.6
P3.7
RxD
TxD
INT0
INT1
T0
T1
WR
RD
10
11
12
13
14
15
16
17
Saturday, October 8, 20
16
Addressing Modes
The way in which the instruction is specified.
Immediate
Register
Direct
Register Indirect
Indexed
Saturday, October 8, 20
16
Egs:
MOV
MOV
MOV
MOV
MOV
A,#65H
A,#A
R6,#65H
DPTR,#2343H
P1,#65H
Saturday, October 8, 20
16
Rn, A
A, Rn
DPL, R6
MOV
MOV
DPTR, A
Rm, Rn
Saturday, October 8, 20
16
;n=0,..,7
R0, 40H
56H, A
A, 4
; MOV A, R4
6, 2
; copy R2 to R6
; MOV R6,R2 is invalid !
Saturday, October 8, 20
16
A,@Ri
@R1,B
Saturday, October 8, 20
16