3 ?
T |?
!y?
3 ?
T |?
!y?
3 ?
T
3 ?
T
C?y# 
?y# 
?
"d 7?
?
"d 7?
? 12? ?
"d ?Z
12.1 ??i%  ?Z
12.2
i%  ?Z
12.3 i? I/O g ?Z
12.1 ??i%  ?Z
??i%  ?Z
12.1.1 ?
??i% à
?
 ? ¨"d??q èqF? èq¥8ü
^?q
?¥??i% b? MCS-51"
 8ê?

=??i%
¥ ??# ?
 ?V 12.1
Ub
V 12.1 MCS-51"
?

=??i% B ?V
?
?|
=??i% 
??
?
 /B
8031 í —
8051 ROM 4K
8751 EPROM 4K
8951 Flash 4K
?
àμ
=? ROM¥?
?????éa
= ROM ?

?
H¨A? ?
 ?? ?Z??i% b MCS-51?

?μ 16H1?L' P0 g P2 gyNKvù?S?1 64 KB

0000HjFFFFHb
? ú1?i¥
^ MCS-51?
μB?5? —— ???i
%  ¥ ? Zμ1b ?T ¤ú è
ü
*
1
=i% 1?S?
^
0000Hj0FFFH
4 KB
???i% 1?S?
^ 1000Hj
FFFFH
60 KBb ?T ¤?è
ü?
P¨
=??i% 
???i% 1?S?1 0000HjFFFFH
64 KBb
EA
EA
EA
8031?

àμ
=??i% yN5?9
^¤?è
üb
?Z??i% 訥?
^ EPROM
Erasable
Programmable Read Only Memory?
,?L V?"? ?
2716
2K?8a 2732
4K?8a 2764
8K?8a 27128

16K?8a 27256
32K?8a 27512
64K?8?b
6?
μ +5 Vè V?" EEPROM ? 2816
2K?8a 2864
8K?8
??b ?T??9
??V 4 KBB?ê¨ μ
=? ROM¥?
b 8051
=? ROMo
?ìE|??BQ?%?
al

¨???
k
H
P¨yNê¨ 8751a8951¥¨?b
?T???V 4 KB¨B??ê¨ 8751a89517
^°
¤ê¨ 8031 ?¨?? ?Zi%  ?ib??b
EA
12.1.2 EPROM??i%  ?Z
L è
,?L?"è VI?oi%  EPROM
^S
=¨¤?¥
??i% b EPROM?
μB?j e3 g,?Lv

/i% ?¥òê? (M 1 ' ) ? ? " 
b?"?ê¥
EPROM V[YVI? |?¨??%??
?b
è 12.1  8031?

 ?Z 4 KB EPROM??i% b
(1) ê4?
b
' è1 pê¨ 8031?

=?í ROM uí
??é
?A? ?Z??i% 
" -?
?"
P ¨ ? ? ZZ E1 ?
??a
L¨b
ê4??i% ?
H
n5A?
@?? ?
 Q  N
ì ? f ?/D
ê¨ ?
v¥?
b?"S¥
P¨¥ ?
  V 7 ¤ L e ?  ?
i % ?
 v  ? ? ? ??
9vb ?9
??9é 3 KBP·Kz
^ ?ZB
4 KB¥ EPROM 27327?
^
ê¨ 2
2716
2 KBb
?
?¨"d?q
!9???iD
h
?
P¨?

P¤è
^2e?4ú V L??9
^ 89511 8031
P¨÷F
<W¥ey-Bb
(2) ?qè
^mb
8031?
 ?ZB
2732??i% è
^ ?m 12.2
Ub
P2.0
P2.1
P2.2
P2.3
P0.0
P0.1
P0.2
P0.3
P0.4
P0.5
P0.7
P0.6
18
17
14
13
8
7
4
3
19
16
15
12
1
9
6
5
2
2
3
4
5
6
7
8
21
19
22
23
17
16
15
14
13
11
10
9
20
29
30
24
23
22
21
32
33
34
35
36
37
38
39
111
D7
D6
D5
D4
D3
D2
D1
D0
Q7
Q6
Q5
Q4
Q3
Q2
Q1
Q0
A11
A10
A9
A8
A7
A6
A5
A4
A3
A2
A1
A0
O7
O6
O5
O4
O3
O2
O1
O0
OE/VPP
ALE
PSEN
GOE
GND
GND
24 12 18
VCC GNDCE
EA
31
GND
8031
2732
4K?á8
74L
S
37
3
£?5 V
mm 12.2 ?
 ?Z?
 ?Z 2732 EPROMè
^è
^
(3) ?
a
üb
?74LS373b74LS373
^{ ?

{¥ 8D
íi ??
¥ ?9L2?
LD1?L¥? 8ê
¨ P0 gyNA?
¨1?
íi |1??|
?| us 7b 74LS373¥
íi e?

G°¤D?
¥
íi e??| ALEM ? ALE¥/?
íi
? 8ê1?b
?EPROM 2732bEPROM 2732¥ ?
1 4 K?8êb 4 KV
Uμ
4?1024
2
2
?2
10
=2
12
?i%?í 8êV
U
??íi%
¥
z
^ 8êb -? ??
1?L¥ê
^ 12ê
A0jA11a?
??

L¥ê
^ 8ê
O0jO7b
" -"
1?i% -
?B? f ?/á
ì
P¨¥?
^ 8ê
i% b 2732?¨?B
+5 VèKvá
yTè
@1 100 mA??è
@1 35 mA
HWKv1 250 nsb2732¥
?
T1 DIP245? ?m 12.3
Ub
A7
1
A6
2
A5
3
A4
4
A3
5
A2
6
A1
7
A0
8
O0
9
O1
10
O2
11
GND
12
O3
13
O4
14
O5
15
O6
16
O7
17
CE
18
A10
19
OE/VPP
20
A11
21
A9
22
A8
23
VCC
24
2732
m
m
12.3 EPROM 27325?#
a
ü
5?#
a
ü
? A0jA1111?L O0jO71
L 1
êL
/VPP1
{
? /I?úab
"
 12H1?L 8H
L-? 1
êL?è
üμr b
9ü
^
aoμ? 1?è
ü
H 2732?$ê??5 2732?
yTb /VPP1
?
5?? 2732¨T??i% 
H ?
^
?
 ?  ?  EPROMI?
9?1%??
H?
5 ? ¨ ? ú è a
{ ?  ? ]
3 á ì E ¥ ?
I ?èa9μ
?]b
?á
ìü
T1??i% 
P¨
H?A1? I?èab
CE
OE
CE
CE
OE
(4) ?Z9L¥á
3b
B?¥ CPU^ INTEL 8086/8088aZ80??μ??¥1?9
La
9L e ?9 L 7 MCS-51"
?
??
s5?¥K
? 
L D 1 ? L
^ ˉ ¨ ¥  1
 |
ì s ? 7 ?A??
??9F1?
íi ?DB? CPUM ?
¥ ?9L2b
(5) ?L
a
ü
? 1 ?Lb?
 ?Z
?i% 
H1?
^? P0 P2 g4
¥bm 6.2? 2732¥ 12H1?L
A0jA11?? 8ê A0jA7
YV
íi  74LS373D P0 g ?¤ú 4ê A8jA11°¤D P2 g¥
P2.0jP2.3 ?¤ P2 g '
&μ
íi?
b?i
íi ¥
íi
P

GA??
¥ ALE5?M ?b
?
Lb 2732¥ 8ê
L°¤D?
¥ P0 gM ?b
yN P0 g
^B?s
Hˉ¨¥1? /
Lb
è e?LbCPU3? 2732?ib¥??·
7
H |·¨


^ 2732é??Tb?i CPU EPROMo
é?
?T?
é??Tb CPU 2732¥?T e??
^YV e
?L
LC¥b 2732 e?L¥ ?¤μ[/+H
°¤¤1b??"d?o ?Z
 B ? ? ? i %  ?
yN 2732¥
ê
°¤¤1V
U 2732B°$ê?b ?
]
H ?Z
3YVr
 ???
êyTb
¤ 8031¥êY?|
b`ù
???i% 
Ho1
Cμ

' VV 2732???b
CE
OE
(6) ?Z??i% 1?S?¥ ??b
?
 ?Zi% ¥1o
^T b# ?Z?
¥1?S?
8031Kv V[ ?Z 64 KB
0000HjFFFFHb %?i% ?
1?S?¥y
íμ
?B?
^
ê
¥ ?¤ZEB?
^
i% ?
¥1?LD?
1?L¥ ?¤b ??1?S?
HA? £
ê
1?è
üb
' è? 2732¥
ê
9
^¤1yN?B? Hq 9
^
@¥
6? 2732μ 12H1?LD 8031¥? 12ê1?M
?I
2T ?/
LTè
^?"d ?Z
B
EPROM 2764 h?v

6
? ? b ?¤ZEV7 ??
LTe? 2764¥1?S?b
(7)?EPROM¥
P¨b
i%  ?Zè
^
^?
?¨"d¥?
?Z?soμ??
¨"d¥ èq
!9??
?
ü??YV+?¥I?y 
B?
?1I? EPROM% %? 2732? ?a| 2732??
¨e¥?V

?Z??i% B?1o?Vb
?
èˉê
H PC=0000H1?V 2732¥ 0000H?í
|·
7 ?a 7
S3?·
7b
?T??31 Qˉ?
k V[¨,?L?" 5| 2732
?¥
= ??" ?a%??a¥??é??
kb
?T1V EPROM?????l¥Vì3
P¨°
V·
7
MOVC A,@A+DPTR
MOVC A,@A+PC
12.1.3 EEPROM ?Z
L è
è?" VI?oi%  EEPROM
^B? V¨è ZE
L?"I?¥oi% 
;μ RAM V V?  ¥
+?? μd^
>?i%  ROM?èa ˉ
 ?
i %
¥ a?byN EEPROM?
i%  ?Z? V[
¨T??i% 9 V[¨T
i% à? 8S
I
1
P¨??qè
^ ??b
EEPROMT1??i% 
P¨
H CPU | EEPROM
] |B? EPROM?TM] ? EEPROM¥ ?
HW?
éA?¨ èq?q ?_? ??
ùb
è 12.2  8031?

 ?Z 2KB EEPROMb
(1) ê4?
b
2816A 2817A (
? 5 Vè?" VI?oi%   ?
?
^ 2K?8êb 2816AD 2817A¥?]-)? 2816A¥
?
HW1 9j15 ms? ?? èq ü
H e?D?qè
^í1
2817A ?¨?q?? ?_??T
^???b
Ná
ìê¨ 2817A?
??? ?Z 2KB EEPROM
2817A¥
^ DIP28?¨?B +5 VèKvyTè
@ 1
150 mA??è
@1 55 mA
HWKv1 250 nsb
=
!μ
I?
3¥úa


3è
^ í3?FI?è÷ ?

' VyTb
BUSY/RDY
2817A ?B?3?¥·
7

- -  1 ? 1 
1
 ? ¥? íé ?? " y7 í3 é?
ê¥3? /?
?"?Tb
2817A¥5? ?m 6.4
Ub ? A0jA1011?L I/O0jI/O7
1
L 1
êL 1
?L?è
üμr
1
?L?è
üμr 1?è
ü
HV
U
2817A?  ?T)?

úè
ü
HV
U?T?8
VCC1 +5 Vè÷ GND1¤1
b
2817A¥?TD
Y EPROM¥M]
?]¥o
^ V
[Lé?3?¥ ?b
CE
OE
BUSY/RDY
RDY/BUSY
1
NC
2
A7
3
A6
4
A5
5
A4
6
A3
7
A2
8
A1
9
A0
10
I/O0
11
I/O1
12
I/O2
13
GND
14
I/O3
15
I/O4
16
I/O5
17
I/O6
18
I/O7
19
CE
20
A10
21
OE
22
NC
23
A9
24
2817A
A8
25
NC
26
WE
27
VCC
28
m
m
12.4 2817A¥5?
¥5?
2817A¥ ?V? ?/ CPU_ 2817A?3? ?

7
a 2817AL
í i1 ?a
# e??|V7 ?BQ?
Tb 2817A¥ ?
HWv?1 16 msP·N
ùW 2817A¥
???è
üV
U 2817A?é??TN
H
¥
9L
?úE
y7
? CPUN
ùW3? 
¥ ?b?BQ
3? ??T?8 2817AL|L?ú?N ?Y? CPUb
(2) ?qè
^mb
?
 ?Z 2817A¥?qè
^m ?m 12.5
Ub
P2.0
P2.1
P2.2
WR
P0.0
P0.1
P0.2
P0.3
P0.4
P0.5
P0.7
P0.6
18
17
14
13
8
7
4
3
19
16
15
12
3
9
6
5
2
4
5
6
7
8
9
10
27
21
24
25
19
18
17
16
15
13
12
11
20
29
30
16
23
22
21
32
33
34
35
36
37
38
39
111
D7
D6
D5
D4
D3
D2
D1
D0
Q7
Q6
Q5
Q4
Q3
Q2
Q1
Q0
WE
A10
A9
A8
A7
A6
A5
A4
A3
A2
A1
A0
I/O7
I/O6
I/O5
I/O4
I/O3
I/O2
I/O1
I/O0
OE
ALE
PSEN
GOE
GND
GND
28 14 20
VCC GND CE
EA
31
GND
8031
2817A
2K?á8
74
L
S3
7
3
RD
17
P1.0
1
2
3
1
RDY/BUSY
1
74LS08
£?5 V
£?5 V
3 k
&
mm 12.5 ?
 ?Z?
 ?Z 2817A EEPROMè
^è
^
(3) ?L
a
ü
? 1?Lbm 12.5? 2817A¥ 11H1?L
A0jA10 ?

1 2K?8ê 2
11
=2?1024=2K?¥? 8ê A0jA7YV
íi 
74LS373D P0 g ?¤ú 3ê A8jA10°¤D P2 g¥ P2.0jP2.2 ?¤ b
?
Lb 2817A¥ 8ê
L°¤D?
¥ P0 gM ?b
è e ?Lb?
D 2817A¥ e?L ?¤?¨
|??

i%  bW??i%  bWi¥ZE
P¤ 2817A; V[T 1
??i% 
P¨? V[T1
i% 
P¨b
?
?¨? e?i% ¥5?μ[ ??
—— e???i% ¥ ? T 3?·
7¥ |·¨
3
? MOVC A,@A+DPTR·
7
Hμr
—— e?
i% ¥?T3? MOVX @DPTR,A
MOVX @Ri,A
Hμr
—— e?
i% ¥?T3? MOVX A,@DPTR
MOVX A,@Ri
Hμrb
m 12.5? 2817A e?L¥ ?LZE ?/
°¤¤1b??"d?o ?Z
B???i% ?
y
N
ê
°¤¤1V
U 2817AB°$ê?b
PSEN
RD
WR
CE
 8031¥??i% êY?|
i %   ?| ü
V,D,?TaD 2817A¥
??|M ?b?"o1a? μ
B?μrü V[ 2817Aé??T
b9ü
^
a   2817A
; V[ AT??i%  |·
79 V[ AT
i% 
b
D 8031¥
i %  ?|M ?o13?
i% 
?T·
7ü V[a 2817A? ?
b
D 8031¥ P1.0M ??¨°?ZE 2817A¥
?Té?5 ?b?a?T
ùW ?1?è
ü?3??a?8
H 1úè
üb
OE
WE
BUSY/RDY
BUSY/RDY
BUSY/RDY

L_? 2817A ? T
^ ? ? ?9 V[¨?Z
T
L
CZE
^| 2817A¥QMa D 8031¥?
{ ??
M ?b? 2817A
?a?B?3?L_?
4? h pb
m 12.5? 2817A¥1?S?
^ 0000Hj07FFH
í1¥5
? | 0?1?S??
^?B¥b
(4) 2817A¥
P¨b
?vm 12.5 ?¤za ?To
^ü 2817AT1??i% 
P
¨
P¨ZE] EPROMM]b EEPROM9 V[YVI? |?
?%é ?b
BUSY/RDY
10
/ INTINT
?T| 2817AT1
i% ?T]
P¨á
RAMB
"°¤Vó?¥1??í? |
' Vb_ 2817A?
?¨ MOVX @DPTR,A·
7b
12.1.4 �?i% ?
V

 ?
L è á
ì V [ 8 ? ? Z ? ? i %  ¥B?ZE b
??i% D?
¥ ?Ls1 ? ?
(1)
LYèμ 8ê
L? P0 g4b
(2) 1?L1?L¥H
%?
??i% ¥ ?
b? 8ê1
?L? P0 g4ú 8ê? P2 g4 8
P¨
H1?L
j ?
Z ?
7?b
(3) e?Li% ¥
??|D?
¥ |·?|M ?
i% 
êL¥¤E %?
??i% ¥1?S??o?¨B
??i% ?
H V[°¤¤1??¨
H1
P¨r
 ?
ê?b
1,è¨ EPROM?
1)?EPROM 2716
2716
^ 2K?8ê¥,?L?"è VI?oi% ?B
+5 Vè?
HKv?{1 252 mW???{1 132 mW

HWKv1 450 ns
?
T1 DIP24b2716μ1?L 11H

A0jA10
L 8H
O0jO7 1
êL?è
ü
μr 1

{
??|?è
üμ r  VPP1I?è
÷ VCC1yTè÷b
CE
OE
2)?EPROM 2764
2764
^ 8K?8ê¥ EPROM?B +5 VèyTè
@1
75 mA??è
@1 35 mA
HWKv1 250 ns DIP28

b 2764Aμ 13H (A0jA12)1?L

{L
O0jO7 1
êL 1

{
?L 1I?

{ ?
 VPP1I?è÷ VCC1yTè÷b
3)?EPROM 27128
27128
^ 16K?8ê¥ EPROM?B +5 VèyTè
@
1 100 mA??è
@1 40 mA
HWKv1 250 ns
DIP28
b 27128Aμ 14H (A0jA13)1?L

{L
O0jO7 1
êL 1

{
?L 1I
?

{ ?
 VPP1I?è÷ VCC1yTè÷b
CE
OE
PGM
CE OE
PGM
4)?EPROM 27256
27256
^ 32K?8ê¥ EPROM?B +5 VèyTè
@1 100
mA??è
@1 40 mA
HWKv1 250 ns DIP28
b
27256μ 15H A0jA141?L

{L O0jO71
êL1

{
?L VPP1I?è÷ VCC1yTè÷b
2716a2764a27128 27256¥5? ?m 12.6
Ub
2,?
 ?Z EPROM??è
^
1) ?ZB
27128A
?
 ?Z 16 KB????i% B?ê¨ 27128A EPROM?
?qè
^ ?m 12.7
Ub
A7
1
A6
2
A5
3
A4
4
A3
5
A2
6
A1
7
A0
8
O0
9
O1
10
O2
11
GND
12
O3
13
O4
14
O5
15
O6
16
O7
17
CE/PGM
18
A10
19
OE
20
VPP
21
A9
22
A8
23
VCC
24
2716
1
A12
2
A7
3
A6
4
A5
5
A4
6
A3
7
A2
8
A1
9
A0
10
O0
11
O1
12
O2
13
GND
14
O3
15
O4
16
O5
17
O6
18
O7
19
CE
20
A10
21
OE
22
A11
23
A9
24
A8
25
NC
26
PGM
27
VCC
28
2764
VPP
VPP
1
A12
2
A7
3
A6
4
A5
5
A4
6
A3
7
A2
8
A1
9
A0
10
O0
11
O1
12
O2
13
GND
14
O3
15
O4
16
O5
17
O6
18
O7
19
CE
20
A10
21
OE
22
A11
23
A9
24
A8
25
A13
26
PGM
27
VCC
28
27128
VPP
1
A12
2
A7
3
A6
4
A5
5
A4
6
A3
7
A2
8
A1
9
A0
10
O0
11
O1
12
O2
13
GND
14
O3
15
O4
16
O5
17
O6
18
O7
19
CE
20
A10
21
OE
22
A11
23
A9
24
A8
25
A13
26
A14
27
VCC
28
27256
mm 12.6 è¨è¨ EPROM?
5?m?
5?m
m 12.7 ?
 ?Z 27128 EPROMè
^
P2.0
P2.1
P2.2
P2.3
P0.0
P0.1
P0.2
P0.3
P0.4
P0.5
P0.7
P0.6
18
17
14
13
8
7
4
3
19
16
15
12
3
9
6
5
2
4
5
6
7
8
9
10
23
21
24
25
19
18
17
16
15
13
12
11
2229
30
24
23
22
21
32
33
34
35
36
37
38
39
111
D7
D6
D5
D4
D3
D2
D1
D0
Q7
Q6
Q5
Q4
Q3
Q2
Q1
Q0
A11
A10
A9
A8
A7
A6
A5
A4
A3
A2
A1
A0
O7
O6
O5
O4
O3
O2
O1
O0
OE
ALE
PSEN
GOE
GND
GND
24
14 20
VCC
GND
CE
EA
31
GND
8031
27128
16K?8
74
L
S37
3
A12
A13
P2.4
P2.5
25
26
2
26
VPP
PGM
+5 V
+5 V
1
27
mm 12.8 ?
 ?Z?
 ?Z 2764 EPROMè
^è
^
2) ¨r
E ?ZB
¨r
E ?ZB
2764
P0.0
P0.1
P0.2
P0.3
P0.4
P0.5
P0.6
P0.7
PSEN
8031
ALE
G OE
D7
D6
D5
D4
D3
D2
D1
D0
EA
74LS
138
P2.0
P2.1
P2.2
P2.3
P2.4
P2.5
P2.7
P2.6
Y0
O0
O1
O2
O3
O4
O5
O6
74
LS
37
3
2764
(8K?8
)
VPP
VGM
+5 V
Q7
Q6
Q5
Q4
Q3
Q2
Q1
Q0
OE
CE
A1
A0
A2
A3
A4
A6
A7
A5
A8
A9
A10
A11
A12
O7
m 12.8? 2764¥
ê
àμ¤17
^YV 74LS138r
¥
{
?4¥??ZE?1r
Eb?]
H ?Z
ROM
Hèè?¨r
E ?sYê??
b
3,è¨ EEPROM?
"
 è 12.2?
P¨¥ EEPROM 2817A-?訥 EEPROM?
μ 2816Aa2864A?b
1)?EEPROM 2816A
2816A¥i% ?
1 2K?8ê?B +5 Vè?31
ê

? ?è÷b 2816A
H ?
  |
HW? ?
@ B ? ? ? i% ¥1 p? ?
HW?é3 9j15 msb ?
HW? ?? èq e?b 2816A¥5? ?m 12.9
Ub
2)?EEPROM 2864A
2864A
^ 8K?8ê EEPROM?B +5 VèKvyTè
@
160 mAKv??è
@ 60 mA??
HW 250 nsb???
=?
!μ,:
,y7
?  y
 ?b 2864A
=? V4
I?
3¥ ???
HI?2
V[ó°?S?b 2864A¥

?
T1 DIP28 5? ?m 12.9
Ub
4,?
 ?Z EEPROM??è
^
¨?
 ?Z EEPROM 2864AT1
i% ¥?qè
^ ?
m 12.10
Ub
12.2
i%  ?Z
i%  ?Z
12.2.1 ?
 RAMà
RAM
^¨ ?ibò?
¥  MCS-51"
 8ê?

=?
μ 128 B RAMi%  CPU
=? RAM μ~?¥?T·
7b?
^??
¨?
L
H
?" ) ?v


H? L
=
4¥ RAM
^ ù ù ? ¥ bN
H  á
ì V [ ?¨?
¥ ?Z?
 ?Z??
i% b
LT 6¥? I?? 1ü
^B? ?Z RAM
¥
P¨
L èb
è¨ ¥? ?
i% μá
RAM
Static Random Access
Memory—SRAM ?
RAM 
Dynamic Random Access
Memory—DRAM
?b -? /
úB??
^ 8ê z
^? ?Z Ov
DM] ?
¥ EPROM??Y ?μ ???
e è
^
! 9 
P ¨ Z L  ? ?
^ " ? ?  ? ' ú?{vb
a ?" ? ú  ? ' ?  ?{ M  ? ?  ? ?
^ 3 19FB?
?è
^?F
6?¥?'b
MCS-51?
 ?Z
?
i% ¥1?L9
^? P0 g
P2 g4¥yNKvù?S?1 64 KB
0000HjFFFFHb
B? f ?/ SRAM¨??31l? 64 KB
i% ¥l
"d DRAMüè¨?31v? 64 KB¥v"db
12.2.2 SRAM ?Z
L è
1?¨"d?o ?ZB
RAM
è 12.3 B?
?¨"d? ?Z 2 KBá
RAMb
(1) ?
ê4b
?
 ? Z
i %  è¨ ¥á
RAM?
μ 6116
2K?8
êa 6264
8K?8êa 62256
32K?8ê?b
? 5
" ?
¥1 pá
ìê¨ SRAM 6116b
^B??¨
CMOSy\??¥ SRAM?¨?B +5 Vè
{ ? /
{è
ü (D
TTLY ? μ??{?TZ
Tb? CPU
àμê???
H

=1?
)???{
 V[h
 80%[
¥?{bCE
6116¥5?D EPROM 27165?Y ?5? ?m 13.11
Ub
A7
1
A6
2
A5
3
A4
4
A3
5
A2
6
A1
7
A0
8
I/O0
9
I/O1
10
I/O2
11
GND
12
I/O3
13
I/O4
14
I/O5
15
I/O6
16
I/O7
17
CE
18
A10
19
OE
20
WE
21
A9
22
A8
23
VCC
24
6116
m
m
12.11 61165?m
5?m
6116μ 11H (A0jA10)1?L 8H (I/O0jI/O7)
_

L 1
êL?è
üμr 1
?L?è
üμr 1

?L?è
üμrb 6116¥?TZ
T ?V 12.2
Ub
V 12.2 6116¥?TZ
T
CE OE WE
Z
T
I/O0jI/O7
H
? ? ?ê? úE
L L H

O0jO7
L H L

I0jI7
L L L

I0jI7
(2) ?qè
^b
?
D 6116¥?q ?¤ ?m 12.12
Ub
m 12.12 ?
 ?Z 2 KB RAMè
^
P2.0
P2.1
P2.2
P2.7
P0.0
P0.1
P0.2
P0.3
P0.4
P0.5
P0.7
P0.6
18
17
14
13
8
7
4
3
19
16
15
12
1
9
6
5
2
2
3
4
5
6
7
8
18
19
22
23
17
16
15
14
13
11
10
9
30
28
23
22
21
32
33
34
35
36
37
38
39
111
D7
D6
D5
D4
D3
D2
D1
D0
Q7
Q6
Q5
Q4
Q3
Q2
Q1
Q0
CE
A10
A9
A8
A7
A6
A5
A4
A3
A2
A1
A0
I/O7
I/O6
I/O5
I/O4
I/O3
I/O2
I/O1
I/O0
ALE
G OE
GND
24 12
VCC GND
GND
8031
6116
2K?8
74
L
S
3
7
3
WE
WR
16
27
 5 V
RD
17
22
OE
(3) ?L
a
üb
6116D?
¥ ?L ?/
1?L A0jA10 ?¤?
1?9L¥ A0jA10' P0.0j
P0.7aP2.0aP2.1aP2.2
11?b
L I/O0jI/O7 ?¤?
¥
L' P0.0jP0.7b
e?L
ê
?¤?
¥ P2.7'?
1?9L¥K
úê A15 
?L ?¤?
¥
i%  e?L  

?L ?¤?
¥
i%  e?L b
CE
OE
RD
WE
WE
(4)
? RAM1?S?¥ ??#
P¨b
?vm 12.12¥ ?L
ê
°¤D
B1?L P2.7M ?
?? ?ZZE?1LêEbA ?oμ P2.7=0?
ê??
6116# 1?S? ?? ?/
8031 P2.7 P2.6 P2.5 P2.4 P2.3 P2.2 P2.1 P2.0
P0.7 P0.6 P0.5 P0.4 P0.3 P0.2 P0.1 P0.0
A15 A14 A13 A12 A11 A10 A9 A8 A7
A6 A5 A4 A3 A2 A1 A0
6116 A10 A9 A8 A7
A6 A5 A4 A3 A2 A1 A0
0 ????0000
0000000
0 ????0000
0000001
0 ????0000
0000010
0 ????0000
0000011
0 ????1111
1111111
?,?”V
U? 6116í1¥5? | 01? V[b
?TD 6116í1¥5? | 0
*
1 6116¥1?S?
^
0000Hj07FFH ?TD 6116í1¥5? | 1
*
1 6116¥1?S
?
^ 7800Hj7FFFHb
?
 RAM¥"
 V[
P¨
LT 6?C¥·
7
MOVX @DPTR,A  64 KB
= ?

MOVX A,@DPTR  64 KB
= |

? V[
P¨[/? 256 B¥·
7
MOVX @Ri,A  ? 256 B
= ?

MOVXA @Ri  ? 256 B
= |

2]
H ?Z?? RAMD?? I/O

LT 6?á
ì???? RAMD?? I/O g?¨M]¥
 /·
7=?
^dBI?¥y N? ]
H ?Z =?
H  ü
A? I
n1?¥ ?s
¥bYè?¨r
E ?
LC1? ¥s
¥b/
^B??"¥ è5b
è 12.4 ?Z 8 KB RAM1?S?
^ 2000Hj3FFFH
i O μ?B? ?1? (T1?? I/O ?Z1?b
(1) ?
ê4b
?á
RAM?
6264b6264
^ 8K?8ê¥á
RAM
?
¨ CMOSy\?/?B +5 Vè-??{ 200 mW?? |
HW 200 ns
?
T1 DIP285? ?m 12.13
Ub ? A0j
A121 13H1?L I/O0jI/O71 8H
L
_ 1
êL 1
?è
üμr CE21
êL 2úè
üμr 1
??|L?

üμr 1?|L?è
üμrb
NC
1
A12
2
A7
3
A6
4
A5
5
A4
6
A3
7
A2
8
A1
9
A0
10
I/O0
11
I/O1
12
I/O2
13
GND
14
I/O3
15
I/O4
16
I/O5
17
I/O6
18
I/O7
19
CE1
20
A10
21
OE
22
A11
23
A9
24
A8
25
CE2
26
WE
27
VCC
28
6264
m
m
12.13 62645?
5?
?3-8r
 74LS138b5
"1 p ?Z RAM¥1?
2000Hj
3FFFHS?
^?B¥ ?1?¨??? I/O¤ g
1? I/O g
¥ ?Z 12.3 12.4?o
b???? I/O]¨?? RAM¥
1?S??T·
7?
^ MOVX·
7yN I/O RAM]
H ?
Z
HA?é?i%  bW¥ ? s
¥ b? ú ? ¨ ? r
Z
T 
6264¥i% ?

^ 8K?8ê]¨
?
¥ 13H1?L A0j
A12
:?¥ 3H1?L A13jA15YV 74LS138 ?é? ?r
b
(2) ?q ?Lb
¨?
 ?Z 8 KB SRAM¥?q ?Lm ?m 12.14
Ub
P0.0
P0.1
P0.2
P0.3
P0.4
P0.5
P0.6
P0.7
WR
RD OE
WE
CE1
6264
8051
ALE
G
OE
EA
74LS
138
P2.0
P2.1
P2.2
P2.3
P2.4
P2.5
P2.7
P2.6
Y1
CE2 5 V
I/O0
I/O1
I/O2
I/O3
I/O4
I/O5
I/O6
I/O7
D7
D6
D5
D4
D3
D2
D1
D0
Q7
Q6
Q5
Q4
Q3
Q2
Q1
Q0
A1
A0
A2
A3
A4
A6
A7
A5
A8
A9
A10
A11
A12
m
m
12.14 ?
D
?
D
6264 SRAM¥ ?¤
¥ ?¤
?
¥ú ?ê1?L A13aA14aA15¨ ?é? 3-8r

r
{¥¤ 6264¥
êL
:?¥r
{¨?êY 
¥
I/O ?Z¤ g
6264¥
êL CE2°¤¤ +5 Vúè
ü
6264¥
{ 
??|¤?
¥
??|¤?
¥b
(3)?6264¥1?S?b
?
êL#1?L¥ ?¤ 6264¥1?S? ?? ?/
8031 A15 A14 A13 A12 A11 A10 A9 A8
A7 A6 A5 A4 A3 A2 A1 A0
6264 A12 A11 A10 A9 A8
A7 A6 A5 A4 A3 A2 A1 A0
00100000
00000000
00100000
00000001
00100000
00000010
00111111
11111111
#
yN 6264¥1?S?1 2000Hj3FFFHb
12.3 i?
i?
I/O g ?Z
g ?Z
12.3.1 MCS-51
=?i? I/O g# T¨
51"
?

=?μ 4?
_¥i? I/O
g P0jP3
]
32???b P0 g¥
Bê V[ z? 8? TTLμ P1jP3 g¥μ
?1 ?? TTLμbμ1 4?
g¥2#W%
a
ü -
¥
μ1c??XTVo
? ú?
b
í
?i%  ?Z¥"d?? 4?
g? V[T1
_
Y¨ I/O g
P¨bYV 13.1 13.2?¥o
á
ì?? μ
? ?Zi% ¥"d? P0 gs
H1T1? 8ê1?L

L P2 gT1ú 8ê1?Lb?
H P0 g?s ??¥ P2 gí
ETY¨ I/O gb
P3 g μ?=?
?¨"d? 9è $
P ¨b yN  v 
¥?¨"d???
4ó¨
P¨¥oμ P1?s P2a
P3 gb
8

 MCS-51?
¥ I/O
gYè31 ? [L
÷¥?
!
è ?A
U ao
é? ó"b
 51?
? ?Z¥ I/O g?¨D
?
i% M]¥ù?
ZE
μ ?Z¥ I/O g[#YV ?Z I/O g ?¤¥?
!?D
? RAMdBI?yN
? I/O g¥
{ ? /
{·
7ü
^`ù
? RAM¥·
7'
MOVX @DPTR,A
MOVX @Ri,A
MOVX A,@DPTR
MOVX A,@Ri
?Z I/O g¥ZEμ ??e? ¥ I/O g ?Za?¨ VI?¥
i? I/O¤ g?
?Z[# ?¨1? gé? I/O g¥ ?Zb'c×
?o
 -
? ?ZZE#
L=?¨ ?¨1 ? g ?Z¥ZE?
8co
b
12.3.2 e?¥ I/O g ?Z
e?¥ I/O g ?ZYè
^?¨ TTLCMOSè
^
íi a ?
ê?T1 ?Z?
YV P0 g ?
LC ?Z¥B?Z?b
μ è
^e?a?'?a
¥?
2¥+?b
1, ?Z
L è
m 12.161? ¨ 74LS244T1 ?Z
{ ?a 74LS273T1 ?Z
{
¥e? I/O g ?Zb
P0.0
P0.1
P0.2
P0.3
P0.4
P0.5
P0.6
P0.7
P2.0
WR
RD
CLR
S1
 5 V
Y1
G1
8031
74L
S
2
7
3
74
LS2
4
4
G2
CP
D0
D1
D2
D3
D4
D5
D6
D7
Q0
Q1
Q2
Q3
Q4
Q5
Q6
Q7
Q0
Q1
Q2
Q3
Q4
Q5
Q6
Q7
D0
D1
D2
D3
D4
D5
D6
D7
LED0
LED1
LED2
LED3
LED4
LED5
LED6
LED7
S0
S2
S3
S4
S5
S6
S7
Y
1
mm 12.16 e?e? I/O g ?Zè
^ g ?Zè
^
2,?
# ?L
a
ü
m 12.16¥è
^??¨¥?
1 TTLè
^ 74LS244a
74LS273b ? 74LS2441 8
L z?  ( ?
{ )a1?

üμr¥
P

b?=?-B1ú è
ü
H
{1 ?
b
74LS2731 8D(? 1?è
üμr¥ b"
b? =0
H
{
?1 0 OD 
{ ?
í1 CP
^
Hò?|? CP??è
ü
_úè
üKM
H Y D
{ ?
.
? Q
{
b
P0 gT1
_ 8ê
L;
V 74LS244
{ ?
?
V 74LS273
{
b
{ ? e??|? P2.0M,,a??b?=??1 0
H
74LS244¥ e?
μr ê Y 74LS244??¥?
{ ?? P0
9L
b? D 74LS244M ?¥?o?
àμ?/
H
{ ? ?1
1 ??/
o5
L
{ ?1 0b
{ e??|? P2.0M,,a??b?=??1 0a
74LS273¥ e?
μrêY 74LS273 P0
¥

í i ?
74LS273¥
{
 e??;= 5 LED?
L
{1 0
HM
?¥ LED?;b
3,?I/O g1? ??
y1 74LS244 74LS273?
^ P2.01 0
H$êY¥
[=?
¥ g1??1 FEFFH
??1??
^?B¥o1 £ P2.0=0

1?êí1b?
^??s Y? e?y7
??|? V
]
H1 0
3?
{ ?·
7 ? MOVX A @DPTRMOVX A
@Ri
Hμr 3?
{·
7 ? MOVX @DPTR AMOVX
@Ri A
Hμr
[

=???
3
lb
4,I??¨
/
??
LC¥?
^?/ ?io?¥ LED?;b
CONT MOV DPTR #0FEFFH 
·?·_ g1?
MOVX A @DPTR  _??o_ 74LS244 ?

MOVX @DPTR A  _ 74LS273
{
 z? LED
SJMP CONT  ?ì
* description:
*
Y?,J?
??
TRT,MOV TMOD,#20H
MOV TH1,#0F3H
MOV TL1,#0F3H
SETB TR1 ;T1
S
Po+
q1 2400
MOV SCON,#50H ;1 g
S1Z
T 1
?¤
l
RPT,MOV R0,#20H
MOV R6,#10H ;é7i 
S
MOV R5,#00H ;r7i 
S
MOV SBUF,R6 ;?
é
L1,JBC T1,L2 ;???
?
AJMP L1
L2,MOV A,@R0 ; |

MOV SBUF,A ;?

ADD A,R5 ;?? ?F
R5
L
MOV R5,A
INC R0
L4,JBC TI,L3
AJMP L4
L3,DJNZ R6,L2 ;
 16?

^??
?
MOV SBUF,R5 ;?
r
MOV R5,#00H
L6,JBC TI,L5
AJMP L6
L5,JBC RI,L7
AJMP L5 ;?Yís
L7,MOV A,SBUF
JZ L8 ;?
? ?Rí
AJMP RPT ;?
μp×?
L8,RET
END
L
L
(
Y?
Y?
)
void init_serialcomm(void)
{
SCON = 0x50; //SCON,serail mode 1,8-bit
UART,enable ucvr
TMOD |= 0x20; //TMOD,timer 1,mode 2,8-bit
reload
PCON |= 0x80; //SMOD=1;
TH1 = 0xF4; //Baud:4800 fosc=11.0592MHz
IE |= 0x90; //Enable Serial Interrupt
TR1 = 1; // timer 1 run
// TI=1;
}
void send_char_com(unsigned char ch) //_1 g?
B?3?
_1 g?
B?3?
{ SBUF=ch;
while(TI==0);
TI=0
}
void serial () interrupt 4 using 3 //1 g¤
l?f
1 g¤
l?f
{
if(RI)
{
unsigned char ch;
RI = 0;
ch=SBUF;
if(ch>127)
{ count3=0;
inbuf1[count3]=ch;
checksum= ch-128;
}
}
}