Организация обмена информацией между микроконтроллером семейства MCS-51 фирмы Intel и персональным компьютером
ANOT?CIJA
?aj? darb? tiek apl?kota inform?cijas apmai?as organiz?cija starp
person?lo datoru un firmai Intel MCS-51 mikrokontrolieri. Darb? tiek
uzr?d?ti mikrokontroliera programmas algoritmi un t? ar? struktur?l?s
piesl?gumu sh?mas pie person?lo datoru portam.
Darba apjoms 47 lappuses.
MCS-51
Intel.
,
.
47 .
ANNOTATION
In given document is considered organization of information exchange
between the personal computer and family MCS-51 Company Intel
microcontroller. There is presented the algorithms of microcontroller
software, as well as structured schemes of connecting a microcontroller
to ports of the personal computer.
Volumes of work 47 pages.
.
-
-
-
-
-
-
-
,
- .
- (, ,
, ),
, .
.
.
.
,
I8080,
. ,
,
.
,
.
MCS-51 Intel.
- ,
- ,
.
MCS-51 Intel.
1.
()
- .
,
.
,
.
,
,
,
.
( ) ,
,
, , -
,
- .
2 10
.
,
:
(/ )
;
;
.
, ..
, ,
:
;
.
, .
,
.
,
, , -,
- ..
, .
,
(- , ,
), , ,
: , , ,
.
, , .
, ,
, ,
.
.
, ,
( ,
, ).
, (
,
).
, .
,
,
.
,
,
, .
,
.
- .
,
, ,
.
.
.
, .. ,
.
.
. ()
. :
,
,
(
) ..;
,
(
);
.
.
-,
.
, .
,
.
.
.
, :
;
.
.
.
, ..
, .
, ..
,
. ,
. , ,
.
.
1.1
:
;
.
:
;
.
:
, , ;
;
;
- ;
-
.
1.2
Intel MCS-51
[3].
.
1.2.1
[3]
RS-232C.
,
.
,
Centronics.
.
,
.
.
,
.
. ,
.
[3] ,
, .
, .. ,
.
.
,
.
.
,
, .
,
.
1.2.2
[3]
RS-232C .
. .
+12 12 . .
,
. ,
RS-232C .
+12 12 .
[3] 8031.
.
.
, ,
. ,
.
3 -
.
.
,
.
,
,
.
1.3
,
MCS-51
:
.
.
,
, - ,
.
.
.
, .
.
.
.
.
, ,
.
.
.
,
. ,
, .
, .
, .
,
,
.
.
.
.
.
.
.
, .
,
. 8 .
,
.
.
,
, ,
.
.
.
2.
2.1
RS-232C.
()
.
-51
:
0. RxD
( P3.0). TxD ( P3.1)
,
. 8 .
.
1. TxD,
RxD. 10 : -
(), , -
(). / 1.
2. TxD,
RxD. 11 : -
(), , 2 -
(). 8
SCON. 8 SCON
0 1, , ,
PSW
( ).
RB8 SCON.
2
32 64.
3. 3 2
, 3 / 1.
2, ..
/.
.
2.1.1 /
/, ..
() 2
SMOD .
:
f=(2SMOD/64)f.
, SMOD=0 (1/64)f,
SMOD=1 (1/32)f.
/ 115,2 [6].
, SMOD=1.
f=1,8432 , 57,6 .
1 2.
2.1.2
2 .
11 :
;
;
,
;
.
2.1.3
RS-232
MCS-51,
. RS-232C +12 12 .
MCS-51 +5 .
, ,
.
:
;
;
;
;
.
. 1. MCS-51 Intel
.
,
ADM202
Analog Devices. ,
[4].
( P3.0),
( P3.1).
2.6.
.
2.7.
2.1.4
,
, ,
. ,
,
.
+5V, ,
.
2.
. 2. .
, .
2.2
,
.
, ,
(,
).
5378.
2. ,
,
, ..
, ,
100 . 300 .
,
. ,
.
. 3. .
.
,
.
2.3
2.3.1 MCS-51
() RST
( ) . RST
. RST S5P2
. RST , ALE PME
. 0 RST.
ѻ :
,
0 3, SBUF ;
07;
,
;
0 , 0 3
ALE PME,
;
PCON, IP IE
;
0 3 1.
RST .
.
2.3.2
2.3.2.1
,
:
;
;
;
;
;
.
.
.
:
2 ,
, ;
SMOD
1;
.
. 4.
,
.
,
R0.
,
R4 .
.
. 5.
,
.
5.
:
01h - 1 -
;
02h - 2 -
;
03h - 3 -
;
04h - 4 -
;
05h - 5 - ;
06h - 6 -
;
- 7 -
.
2.3.2.2
,
DPTR.
.
6.
. 6.
.
. 7. .
,
.
R4.
DPL.
, ,
DPH.
,
R4.
R4.
0Fh.
0.
7.
2.3.2.3
() .
, .
,
.
,
. ,
,
, .
(, INT0)
.
. 8.
.
:
INT0 û,
INT0=0 .
INT0, 2.
, ..
.
û.
, ,
P3.2.
INT0. ,
,
( INT0=0
).
.
.
9.
. 9. .
INT0 .
:
,
DPTR ;
2,
;
R4 .
,
R3.
. ,
, , DPTR
,
.
INT0 10.
. 10. INT0.
,
.
INT0
.
:
01h - ;
02h - ;
03h - ;
04h - ;
05h - ;
06h - ;
07h - ;
08h - ;
.
, ,
, .
R5, ,
.
,
P2.5
.
,
P2.5 .
11.
. 11.
.
3
.
.
2.3.2.4
.
. .
. R1 R2.
12.
. 12.
.
, ,
.
.
13.
. 13.
.
DPTR.
,
, DPTR,
.
, ,
.
2.3.2.5
.
,
,
.
14.
. 14.
.
R1.
2.3.2.6
2 .
2 .
,
.
, ,
DPTR.
.
, ,
, .
15.
. 15. .
,
.
07FFh.
2.3.2.7
. ,
,
.
16.
. 16.
.
R1. - FFh.
2.3.2.8
0Fh.
.
, ,
.
,
R4,
R4 .
R7.
R4
.
17.
. 17. .
2.3.2.9
18.
. 18. .
.
,
, , .
,
.
,
R4 00h,
.
. ,
, , ,
, .
,
.
, , .
,
.
,
P2.7.
2.3.2.10 .
, ,
.
, ,
, R0.
,
.
19.
. 19. .
,
R4 00h,
.
,
R4 00h,
.
R6.
MCS-51
Intel. , ,
,
.
, ,
.
,
.
.
̻ / .., ..
. / / 1994 .
/ .., .., .. / ,
/ 1990 .
MCS-51
/ . / , / 1998 .
1996 IC Master for Windows / / Copyright Heart business
puplishinc.
STANDART IBM PC. , ,
/ / 1991 .
-. MS-DOS Windows / ..
, .. / / - / 1995 .
1
() ()
SMOD=0 (1/64) SMOD=1 (1/32)
1 115,2 7,3728 3,6864
2 57,6 3,6864 1,8432
3 38,4 2,4576 1,2288
4 28,8 1,8432 0,9216
5 23,04 1,4746 0,73728
6 19,2 1,2288 0,6144
7 16,457142 1,053257 0,526628
8 14,4 0,9216 0,4608
9 12,8 0,8192 0,4096
10 11,52 0,73728 0,36864
12 9,2 0,6144 0,3072
2
SMOD=0
() ()
SMOD=0 (1/64) SMOD=1 (1/32)
1 115,2 7,366503 7,378725
2 57,6 3,673807 3,698251
3 38,4 2,438711 2,475377
4 28,8 1,818014 1,866903
5 23,04 1,443078 1,504189
6 19,2 1,191022 1,264355
7 16,457142 1,009183 1,094738
8 14,4 0,871229 0,969007
9 12,8 0,762533 0,872533
10 11,52 0,674317 0,796539
12 9,2 0,538844 0,685511
SMOD=1
() ()
SMOD=0 (1/64) SMOD=1 (1/32)
1 115,2 3,683252 3,689363
2 57,6 1,836904 1,849126
3 38,4 1,219356 1,237689
4 28,8 0,909007 0,933452
5 23,04 0,721539 0,752095
6 19,2 0,595511 0,632178
7 16,457142 0,504592 0,547369
8 14,4 0,435615 0,484504
9 12,8 0,381267 0,436267
10 11,52 0,337159 0,398270
12 9,2 0,269422 0,342756