Title: ??LCD??????????
1????????
2??? ?????????
???????? ????????? ?? 8279?????/?????????
??LCD?????????? ?????????? ?????????? ??DAC?ADC
?? ??????
31. ????????
??????
- ?????????????????? ?????,??????,?????????????
? - ????????????????
- (1)????????
- (2)?????,??????????
- (3)????????
- (4)??????????
- (5)??????????????????
4??????
?????
1????????(?????) 2??????(?????)?????????????1020
ms,??????????,????????
????
??????????1???????????,????????????????? n??????
??????????????????????????????? n?????????,?????
?????????????
5??????
??????
6??????
??????
??????,???????????????????????????????,???????????
,????????????????,??????????
?????
?????
72. ?????
??????
?????? ORL P1,0FH ????????? MOV
A,P1?????? ANL A,0FH ??????,??????
V
10kO4
µP
? ?
??????????I/O????? ????I/O??????????????
8???????????
??????
???????? 1)??? ???????????,??? ????????????,??
??? ???????????????? 2)???
????????,?????? ??????????????09? ???0AH0FH????
10H ? 3)??? ???????????????
?????????,??????? ????????????????, ????????,????
???? ??
9??????
???????
10??????
??8255??I/O??????
11????????
??????
?????????,??????,????????????????????,???
???????????,?????
???? ????
???????
12????
??????
13??????
??????
1)???????????????X2,X1?X0??0,??????Y 3?Y2? Y1?
Y0????????,????FH,??????,???FH? 2)?????,???10ms,??
?????????? 3)???????,???????????????????????????X2
?0,??????,?????FH,????????,??X2?0,????????????????
??????
14??????
- KEYINS MOV P1,0FH
- MOV A,P1
- ORL A,0F0H
- CPL A
- JZ KEND
- MOV R4,0
- MOV R2,0EFH
- MOV R7,4
- KS1 MOV P1,R2
- MOV A,P1
- ORL A,0F0H
- CPL A
- JNZ KS2
- MOV A,R4
MOV A,R4 ADD
A,4 MOV R4,A
MOV A,R2 DJNZ R7,KS1
SJMP KEND KS2 JB ACC.3 ,KS3
RL A INC R4
SJMP KS2 KS3 MOV A,R4
RET KEND MOV A,0FFH RET
15??????
????????
PA0
P2.7
CE
PA1
P2.0
IO/M
PA2
WR
WR
PA3
0 1 2 3
RD
RD
PA4
ALE
ALE
4 5 6 7
PA5
P0
D0D7
8 9 A B
PA6
C D E F
PA7
8031
8155
20µF
RESET
5V
1K
16?????
??????
17???????
??????
1)??PA??????0??,?PA???????????,?????(E?)???,???P
A??????????1101,?????0???????????? 2)??????,??PA
??????0??,?PA??????????,???PA??????????0111,??,?
?0??????????????????????????01111101,???????????
????????????????
18????
??????
?????????????????????,???????????? ???????????
1)????????????,????ROM??????????????????????????
????????????????????? 2)?????????????????????????
????????????????????????????????????
192. ????
??????
??????????????,??????,????????????????
????????????
1.???????????74148(8-3???) ????????????,??????
,???????? 2.?????/???? ?8279 ???????,????????,??
??????
20??????
0
A2
10
A2
6
1
11
A1
A1
2
7
12
3
A0
13
A0
9
4
1
74148
5
EI
2
8
6
3
7
4
a)????
b)???
21??????
7 6 5 4 3 2 1 0
15 14 13 12 11 10 9 8
CLK
RL7 RL6 RL5 RL4 RL3 RL2 RL1 RL0
A0
ALE
74LS373
8051
P0.0 P0.1 P0.2 P0.3 P0.4 P0.5 P0.6 P0.7
D0 D1 D2 D3 D4 D5 D6 D7
SL0 SL1 SL2
74LS138 Y0Y7
BIC 8708
8279
VCC
P2.7
CS
5V
dp
g
e
c
d
a
WR
f
b
WR
B0 B1 B2 B3 A0 A1 A2 A3
RD
RD
BIC 8708
INT1
IRQ
20µF
RESET
5V
CNTL
2K
SHIFT
5V
22 2 . ??????
- ???????,???????
- ????????,??LED(Light Emitting diode)
- ?????,??LCD(Liquid crystal Display)
- ???????CRT,??????????
- ??????????????
- ???(7?,????)
- ????(57,58,88???)?
- ???????????????
-
??????????? - ???????????????
- ??????,???????????,???????.????????,??????,??????
?
23LED?????
??????
- 1 LED????
- LED----?????.
- LED????? 1.2V 2.6V?
- ???? 5mA 20mA?
- ?????????, ????????????.
- LED?????? ??????????
- ?.??LED???
- ????????
- ????.
24LED?????
- LED??????,??????????????LED??/?????????RUN???????,
RUN1??????RUN0????????????P1.7???LED,??????????
?? - LED BIT P1.7
- RUN BIT 20H.0
- ?LED???????
- MOV C,RUN
- CPL C
- MOV LED,C
25??????
???LED??????,????????????? ??LED??????????????????
???09????????
(a)??? (b)???
(c)???? ??LED???
26LED????
- ?N?LED???????N?LED???????4?LED??????????
- N?LED????N?????8N??????????????,????????????????
?? - ????????????,
- ???????????????
- LED???????????????????,
27(No Transcript)
28 ?LED??????
- LED?????????????,??????(????)????????(??5V)??????
(adp)????8????????? - ?????????,??????????????,?????????????,???????????
??,??????????????????,????????????
29(No Transcript)
30 ?LED??????
- ???LED???,????????,??????????????????,???8?I/O???,
??????????? - ?????????????????I/O????,??????????
31(No Transcript)
32- ?????????8?I/O?,????????4?I/O??
- ??????????,???????????????????,????,??????????????
??,4?LED????????? - ????LED???????????????,???????????,??????,????????
???????,???????????????, - ??,??????????????????,??????,4?LED??????????????,?
??????????
33- ??,?????,???????????????,????????????????,????????
????????????,?????,?????????????,?????????????????
,????????????????, - ???????????????,??????,??????,??????,????????????,
- ???????????????????????,????????
34- LED???????????????????????8?LED???,???????50Hz,
- ????????1ms??.??????8???,??8ms,????12msCPU????????
???????1ms?????????????????,???????????????????,??
????,?????????????????,??????????????,???????,??CP
U?????? - ??,?????,???????CPU??,????????????CPU?????????????
35??????????,???????,?????.
??????
- 1. ????( ?????/?????)
- ??????????,???????
362. ????
??????
- ?????,?BCD????????????????
37?. ???LED???
??????
- ?????????,????????,????????
- ????????5?7???
38LCD(?????)??
??????
- 1. LCD?????
- LCD???????????????? LCD???????????????????LCD?????
????????????????????LED??????,???,????LED?1/3??
39LCD(?????)??
??????
LCD??????????????,???????????,???????????????,????
????????,???????????????????,????????,????????????
??????????,???????????,?????????????90?,??????????
?,????????????,????????????90???,???????,????????(
????)??????????,??????????,???????????????,??????
??,?????????,????????(????)???????????????,???????
???
40?????(LCD)??
??????
- 2. LCD??????
- ????(ms?)?????????????????????,??????????????????
?,??????????????????,???????????????????????2030m
s?? ? - ????320V
- ??5mW/cm2100mW/cm2
413.LCD????
??????
- LCD???????ag???????,???????COM??????????,????????
??
??
?
??????????25100Hz?
42??????
- 2.LCD?????
- ????????????????LCD???,?????????????
- ???????????????????????,??????????,??LCD????
- ??????????????????,????????????,?????????????????
???????????,?????1/2,1/8,1/11,1/16,1/32,1/64?,???1
/2,1/3,1/4,1/5,1/7,1/9??
43??????
A???????B???????
c
(a)????(b)???(c)???? ?????????
442. ???????LCD??
??????
45??????
???LCD??
??????,?CPU??,????LCD?????,??LCD????,??LCD????????
?????
46LCD???????????
??????
47LCD???????????
??????
- 1.????
- ?LCD??160?,???128????????,?????????8?,??????20???,
?????????8?,??????16???????????20x16320???,??????
???????1??,????????????320????????320????16?,??20?
???????????RAM?????????????????,????????????????
48LCD???????????
??????
- 1.????
- (1)?????????????
- TBUF EQU 4000H ?????????
- TXMAX EQU 20 ??(?)????20???
- TYMAX EQU 16 ??????16???
- TCLR MOV DPTR,TBUF ???????????
- CLR A
?0?????? - MOV R2,TYMAX ?16?
- TCLR1 MOV R3,TXMAX ??20??(??)
- TCLR2 MOVX _at_DPTR,A
- INC DPTR
- DJNZ R3,TCLR2
- DJNZ R2,TCLR1
- RET
49LCD???????????
??????
- (2)?????
- TX DATA 30H ???????
- TY DATA 31H ???????
- ?????
- MOV TY 6 ???????
- MOV TX,8???????
- LCALL SOUT ???????????
- DB Hello!,0 ?????(0???????)
- MOV TY,8 ???????
- MOV TX,8 ???????
- LCALL SOUT
- DB Goodbye!,0
50LCD???????????
??????
- ????????
- SOUT MOV DPTR,TBUF ????,??????
- MOV A,TY
- MOV B,TXMAX
- MUL AB
- ADD A,TX
- JNC SOUT1
- INC DPH
- SOUT1 ADD A,DPL ???????P2R1?
- MOV R1,A
- MOV A,B
- ADDC A,DPH
- MOV P2,A
- POP DPH ????????????
- POP DPL
51LCD???????????
??????
SOUT2 CLR A
??1??? MOVC A,_at_ADPTR
INC DPTR ??????? JZ
SOUT3 ?????????? MOVX
_at_R1,A ??,??????? INC R1
????????? CJNE R1,0,SOUT2
INC P2 ??
SJMP SOUT2 ????????? SOUT3JMP _at_ADPTR
???????,??????
52LCD???????????
??????
- (3)????????????????????????????????????????,????
???BCD????R5?,?????????R6?,?????????BCD????R7?,???
????? - DOUT MOV DPTR,TBUF ????,??????
- MOV A,TY
- MOV B,TXMAX
- MUL AB
- ADD A,TX
- JNC DOUT10
- INC DPH
53LCD???????????
??????
- DOUT10 ADD A,DPL
- MOV DPL,A
- MOV A,B
- ADDC A,DPH
- MOV DPH,A???????DPTR?
- CLR F0 ???????
- MOV A,R5 ????
- SWAP A
- LCALL DOUT0
- MOV A,R5 ????
- LCALL DOUT0
- MOV A,R6
- SWAP A
- LCALL DOUT0
- MOV A,R6
- SETB F0 ???????
- LCALL DOUT0
MOV A,. LCALL DOUT2
MOV A,R7 SWAP A LCALL
DOUT0 MOV A,R7 LCALL DOUT0
RET DOUT0 ANL A,0FH JNZ DOUT1 JB
F0,DOUT1 SJMP DOUT2 DOUT1 ADD A,30H
SETB F0 DOUT2 MOVX _at_DPTR,A
INC DPTR RET
54LCD???????????
??????
- DOUT10 ADD A,DPL
- MOV DPL,A
- MOV A,B
- ADDC A,DPH
- MOV DPH,A???????DPTR?
- CLR F0 ???????
- MOV A,R5 ????
- SWAP A
- LCALL DOUT0
- MOV A,R5 ????
- LCALL DOUT0
- MOV A,R6
- SWAP A
- LCALL DOUT0
- MOV A,R6
- SETB F0 ???????
- LCALL DOUT0
MOV A,. LCALL DOUT2
MOV A,R7 SWAP A LCALL
DOUT0 MOV A,R7 LCALL DOUT0
RET DOUT0 ANL A,0FH JNZ DOUT1 JB
F0,DOUT1 SJMP DOUT2 DOUT1 ADD A,30H
SETB F0 DOUT2 MOVX _at_DPTR,A
INC DPTR RET
55LCD???????????
??????
2.???? ?LCD??????????160x128?????8????????????1??
,????20????????8???,??1??????????,??0????????????
??????,?????????????128?,??????????128x202560???
56LCD???????????
??????
(1)????
GBUF EQU 4200H XMAX EQU 160 XBMAX
EQU 20 YMAX EQU 128 GCLR MOV
DPTR,GBUF CLR A
MOV R2,YMAX GCLR1 MOV R3,XBMAX GCLR2
MOVX _at_DPTR,A INC DPTR
DJNZ R3,GCLR2 DJNZ
R2,GCLR1 RET
57LCD???????????
??????
(1)????
MOV DPL,A CLR A ADDC A,DPH MOV DPH,A MOV A,B ADD
A,2 MOVC A,_at_APC SJMP PDOT1 DB
80H,40H,20H,10H DB 08H,04H,02H,01H PDOT1MOV
R2,A MOVX A,_at_DPTR ORL A,R2 MOVX _at_DPTR,A
RET
X DATA 32H Y
DATA 33H PDOT MOV DPTR,GBUF
MOV A,Y MOV B,XBMAX MUL AB ADD A,DPL
MOV DPL,A MOV A,B ADC A,DPH MOV DPH,A MOV
A,X MOV B,8 DIV AB ADD A,DPL
58LCD???????????
??????
(2)??????
MOV R2,LB MOV A,0FFH HLINE2 MOVX A,_at_DPTR
INC DPTR DJNZ R2,HLINE2
RET ???????? MOV Y,20H MOV XB,2 MOV
LB,16 LCALL HLINE
X DATA 34H Y
DATA 35H HLINE MOV DPTR,GBUF
MOV A,Y MOV B,XBMAX MUL AB ADD A,XB
JNC HLINE1 JNC DPH HLINE1ADD A,DPL MOV DPL,A
MOV A,B ADDC A,DPH
MOV DPH,A
59 CRT?????
??????
- ???????????
- 1 ????CRT??????
- ????CRT??????
60????????
- 1?????
- ????
- ??????,???,???,?????????????????????,?????
- ????
- ?????,???????,????,??????????,?????
- ????
- 2????
- ??????????????
61???????
- ???????????
- ??????????????????????????????????????,????
?????????,??????????????,???????????,?????2?,?????
,?????????????????????GP-16????????96?? - 2.GP-16??????????
- ????16????????,??????8051?????,???????????
???,?????????????????????????????,????????????????
?????????
62GP-16??????????
?? 12 310 11 12 13 14 1516
?? 5V D0D7 CS WR RD BUSY ?
63P0.0
D0
?????????? GP16 EQU 7FFFH GP-16????? BUSY BIT
P3.3 BUSY??????
P0.1
D1
P0.2
D2
P0.3
D3
P0.4
D4
8051
P0.5
D5
GP16
D6
P0.6
D7
P0.7
P3.6
WR
P3.7
RD
CS
P2.7
BUSY
P3.3
GND
GND
64GP-16????????
GP-16??????2??,?1???4?????,?4?????n????????mm?
??n?m????????GP-16???????7???,?????n??????????????
??????????,?????n??????8,??n10,???????3?????????m
m??????,?????????????????1???4?????????????
???(????4?) ???(????4?) ????
??? ???? ????
1000 8 ???
1001 9 ?????
1010 A ????????
1011 B ??????
65GP-16????????
- 1.?????(8n mm)GP-16???????,??????n x
mm??,?????BUSY??,?????????,??8A 04????40??,???? - PASS MOV DPTR,GP16
- PASS0 JB BUSY,PASS0 ???????
- MOV A,8AH ?????,????10??
- MOVX _at_DPTR,A
- MOVA,4 ???4???
- RET
66GP-16????????
- 2.???????(9n mm)GP-16???????,??????????,????16???
(??)?,????,???????1?,mm?????????GP-16????????128??
??ASCII?????,??128????????,?????????????????,?????
???????(0AH),??????,????????,?????????,???????????
BCD???????R2(??)R3(??)R4(??)?,??????????? - PRSUM MOV DPTR,GP16
- PR0 JB BUSY,PR0 ???????
- MOV A,9AH ???????,????10??
- MOVX _at_DPTR,A
- MOVA,1 ??1???
- MOVX _at_DPTR,A
-
67GP-16????????
- MOV A,99H ????
- MOVX _at_DPTR,A
- CLR F0 ???????
- MOV A,R2 ???????
- SWAP A
- LCALL POUT
- MOV A,R2 ???????
- SWAP A
- LCALL POUT
- MOV A,R3 ???????
- SWAP A
- LCALL POUT
- MOV A,R3 ???????
- SETB F0
- LCALL POUT
68GP-16????????
- MOV A,. ?????
- MOVX _at_DPTR,A
- MOV A,R4 ???????
- SWAP A
- LCALL POUT
- MOV A,R4 ???????
- LCALL POUT
- MOV A,94H ?????
- MOVX _at_DPTR,A
- MOV A,0AH ????
- MOVX _at_DPTR,A
- RET
69GP-16????????
- ????A?BCD??4????ASCII???????,?????????
- POUT ANL A,0FH ??4?
- JNZ POUT1 ????????
- JB F0,POUT1 ?????,0??????
- RET
- POUT1 ADD A,30H ???ASCII?
- MOVX _at_DPTR,A ??????
- SETB F0 ????
- RET
70GP-16????????
- 3.??????????(An mm)???????????,????4????,???????,
????? - 00H XX XX XX XX
- 04H XX XX XX XX
- 08H XX XX XX XX
- 0CH XX XX XX XX
-
71GP-16????????
- 4.??????(9n mm)GP-16?????????????,??????????(96??
)?????,?????????????????,??????????????????,??????
?????????????,??????????8??,???????1,????0.
72?????????
??????
- 1????????
- ?????????????????,??????
- ?????????????
- 2????????
- ????
- ?????
- ??????????????
- 3????????
73 A/D???????
- ?/?(A/D)?????????,
- ??,?????????????????????A/D????????????????????
- ???????????A/D?????8051???????????????
- ?????A/D???,?????????????,?????A/D?????
- ???A/D???,???????????????????,????????????????????
??????
74???????A/D?????
- ?????A/D????????????????A/D???,???????DN1????
D0?????????????????
75N???????A/D???????
76???????
- ????????.?????????N???????DN-1?l,????0,N????????D
/A???????????????Vn,?????Vx??? - ?VxgtVn?,???DN-11,
- ?VxltVn?, ?DN-1?0?
- ??,???????????DN-2?1,?????????D/A????Vx??,??????,?
????D0?1??0??,??DONE???????????
77- ??,??N????,N????????????????,?????????
- ?????????????????????,????????????,??????????????
- ??ADC0809,??????640kHz?,?????64µs?
78?????A/D?????
- ???A/D????????????,??????Vx???????,????????????
???,
79????????
80- ?????,??????A/D?????????
- ???????????????????Vx?????????,?????T0??Vx??,???
????Vx??? - ???????????????Vx???????Vr?,??????,??????Vr??,???
?????T0??????????????(?????),?????????????,???????
?
81- ???????Tx????????(????????)?????,
- ?????????????Tx???Vx,
- ?
- Vx(Tx/T0)Vr
- ??????T1??????????????
82- ??????????????(VxgtV)?????
- ??V??,?T0????????????????,???????,???????T????
83- ???????????????????A/D?????,??????????
- ??????????????,??????????
- ????????A/D???????????,???????????????
- ?????????3?????A/D???MC14433(?????1l?????)?4?????A
/D???ICL7135(?????14?????)?
84?? A/D??????????
- 1.???
- ?????????(????????????????1)???????(???
?????????????1)??,????10?D/A???,?????0.0001 -
85- ?????,???,??????????????????????,?????,??,????????
???????????? - ??,????D/A???AD7541?????12?,????D/A???DAC0832?
????8???
862.???(Linearity)
- ????????????(Non- Linearity),????????????????????
???? - ???????????????????????
- ADC????????,
- ??????1/2LSB?
87- 3.????
- ???????????????????,??????????????????????????
????????????????????????????????,??????????,??????
??? - ????,??????????????????????????????????????,??
?????????????????????,????????D/A??????????????
88- 4.????
- ???????D/A???,????????????????????????,??????
???,?????????????????????????????????????D/A????,?
??????????????????????? - ??????,??????????????????????,?????????(???????)?
??????1/2LSB(???????????)???????
89- 5.????
- ?????????????????????????????????????????????
??????????????,??????,????????
905.????(Conversion Rate)
- ADC????????????????????,?????????
- ?????A/D???????(??????)?????????
916.?????
- ??????A/D???????????(05)V,(010)V,(-55)V
?? - ?????????,???A/D???????????????1/2n(n???????
)?????0???2n??????????? - ??12??A/D???,??????10V,??????????????
- 10V212-1/2129.9976V?
92A/D???????????
- A/D????
- 1.??A/D??
- ??????/????/??I/O(ADCON1)
- ??A/D????(ADCON0)
- ??A/D????(ADCON0)
- ??A/D??(ADCON0)
- 2.???A/D???
- ?ADIF?
- ?ADIE?
- ?GIE?
93A/D???????????
- A/D????
- 3.?????????
- 4.????,??GO/DONE?
- 5.??A/D?????
- 6.?A/D?????
- 7.??????,????1?2???A/D???????TAD??????2 TAD
,??????????
94A/D??????
- 1.???A/D???????,????????????????????????????
- 2.??A/D???????A/D???????TAD ??10?A/D??????12
TAD????? A/D??????????? - 3.?????????
- 4.??????A/D???
- 5.??????
- 6. A/D??/???
95MCS-51????A/D?????
- ??ADC0809 A/D???? ADC0809?CMOS?????????8?A/D???
?, - 28?????????,???A/D????????????????
- ?8???????,????8????????,????A/D????????
96MCS-51????A/D?????
- ??ADC0809 A/D???? ADC0809?CMOS?????????8?A/D???
?, - 28?????????,???A/D????????????????
- ?8???????,????8????????,????A/D????????
97ADC0809????????
98??????
- IN0IN78????????????
- DB0?DB78????????
- START???????????,A/D???????
- ALE??????,??????????????????,???????????,????????
????? - ADDA?ADDB?ADDC???
99- EOC??????,??????????????,EOC??????????EOC???????
???????A/D?????????????????????????? - OE????????
- CLK????,??????640kHz?
- Vref()?Vref(-),A/D?????????
- Vcc????????CMOS??,?????????,???5 ?15V?
1008???????????????
ADDC ADDB ADDA ????
0 0 0 IN0
0 0 1 IN1
0 1 0 IN2
0 1 1 IN3
1 0 0 IN4
1 0 1 IN5
1 1 0 IN6
1 1 1 IN7
101ADC0809????
102- ?ALE1??,???????(ADDA,ADDB,ADDC)???????
- ?ALEO?,???????????START??????ADC0809,???????A/D??
? - EOC??????????,??????0,??????1?
- OE????????,???????????????,???0809?????????
103 ??ADC0809?8031??
- ADC0809?8031?????????,????????,????????????
- ??ADC0809??????????,??????803l??????ADC0809???????
???I/O?,???????. - ?P2.7?WR???????????(START)?ALE?,????????ADC0809?AD
DA?B?C?, - ????ADC0809?IN0??????7FF8H?
104?????????
105??ADC0809?????
- ???????ADDA?B?C,?ALE??????????
- ?START????A/D??.?????MOVX _at_DPTR,A??,
??WR??,?ALE?START??,????????A/D??? - A/D????,EOC????????
- ????MOVX A,_at_DPTR??RD???OE???,??????????,8??????CP
U????A??
106??????
- ORG 0013H
- AJMP SINT1
- ADC SETB IT1 ?????
-
??1????? - SETB EX1 ??INT1??
- SETB EA ?????
- MOV DPTR,7FF8H ??0??
- MOVX _at_DPTR,A ??ADC0809
- ? ? ? ?
- SJMP
107??????
- SINT1 MOV DPTR,7FF8H ???A/D????
- MOVX A _at_DPTR
- MOV 50H, A ????
-
RAM 50H? - CLR EX1 ???
- RETI ????
108MCS-51?8051?????????
109??????,??????
- ADC MOV DPTR,7FFFH ??ADC0809
- MOV A,00H ?0??
- MOVX _at_DPTR, A ??
- SETB P3.3 ?P3.3????
- NOP
- JNB P3.3, ??A/D????
- MOVX A, _at_DPTR ?????
- MOV 50H, A ????RAM?
-
110D/A????????????
- ??D/A?????,?????????????????
- ????????D/A?????
- ????????????????????????????????
111- ???????D/A????????????????????????????????????
????????????,????????????????????????????????????
????,??????????????????????
112- ??AD7520,???????
-
- ???????
-
- ??,????10???????,?????????????????????,???????
113D/A????MCS-51????????
- DAC0830/0831/0832?8?????D/A??????,??????????
- ????????????????????????????,?????????????????
- ??D/A????8???????8?DAC??????D/A????????????? ?
114??DAC0832??????????
- DAC0830???????????????????8?DAC,?????MCS
?51?????,????????? - ????8?
- ??????1us
- ???????????????
- ?????????????
- ??????(?5V15V)
- ???,200mW?
115- ???DAC0830??DAC???,???????????
- DAC0830???????D/A???,???????????,?????????????,??
???????,?ILE?WR1?WR2?XFER?? - ?????????,???????D/A????????
- DAC0830???????,?????????
- DAC0830??????D/A???,??????????,?????????
116- ?1?????????????????????a???????????,?b????????????
?????5V,?a????0-5V,b?????5V???
117- DAC0830?8???????8?DAC????8?D/A????????
DI7 (MSB) DI0 (LSB)
D7 Q7 ?? ?? ?(8) D0 Q0
DAC ??? (8)
D/A ??? (8)
VREF IOUT2 IOUT1 RfB AGND VCC DGND
ILE CS WR1 WR2 XFER
118- DAC0830????????
- DI07?????
- ILE??????,?????
- CS ?????????,?????,
- WR???????????,??????????LE1?ILE?CS?WR1?????????I
LE?????CS?????WR1???????,?LE1?????LE1?????,??????
?????????????,LE1????????????????????
119- XFER??????,??????WR2?DAC??????????DAC???????LE2,
?XFER?WR2?????????XFER????,WR2?????,??LE2?????LE2
?????,DAC?????????????????,LE2???,??????????DAC???
? - VREF?????????
- Rf0 ????????,??????????
- Iout1?Iout2?????????IOu T1?IOuT2?????,IOuT2?IOuT
1?DAC???????????
- Vcc ???????
- AGND ??????
- DGND ????
120??0832?0831????????
- DAC0830???8031???????????????????????????
??? - 1.????????
- ??????????D/A??????????,??????????,??
?????????,????,?ILE?5V,???????CS???????XFER??????
???(???P2.7),???????????8031?WR???,??????DAC0830?,
????WR????,DAC0830???????????????D/A?????
121- ??????????????D/A??
- MOV DPTR , ADDRES ??DAC0830
- MOV A, DATA
- MOVX _at_DPTR,A ????P0???P2.7??????
,WR???????D/A??????
122 MOV
SP, 53H CLR
A
MOV R1, 17H LOOP
MOVX _at_R1, A
ACALL
DELAY INC
A AJMP
LOOP DELAY
123- 2.????????
- ????D/A????,??????D/A?????,???????????????
- DAC0830???????,?????????D/A???????????
- 1)CPU??????????D/A?????????????????????????
- 2)??CPU????D/A?????????,???D/A??????????????DA
C???,?????????
124- ?6.3?5??????????D/A???????
- 8031?P2.5?P2.6??????D/A????????,??????P2.7????D/A
????XFER?????????WR?????WR1?WR2???,???MOVX?????,8
031?????????
125- ????8?????????D/A???????
- MOV DPTR, 0DFFFH ??DAC0830(1)
- MOV A, data1 datal??DAC0830(1)??
? - MOVX _at_DPTR, A
- MOV DPTR, 0BFFFH ??DAC0830(2)
- MOV A, data2 data2??DAC0830(2)??
? - MOVX _at_DPTR, A
- MOV DPTR, 7FFFH ?0830(1)?0830(2)??WR
- MOVX _at_DPTR, A ??,????D/A????
12612?D/A???DAC1208?????
- ???, 12?D/A??.
- ??????8???????4????????.
- ??????12?DAC???.
- ??????
- 1 12?????????????
- BYTE1/BYTE2
- 0??12???????4?????
- ?4?? ?????
- ??????DAC 0832(?2-27)
127?2-27 DAC1208?8031????????
128DAC1208?8031?????
- ????12?????????????DATA?DATA1???,???
???(DATA)??8???,(DATA1)??4???(????????????)?????
????D/A????????
129- ??? ????????
- ?????D/A????????????????????????????
- ???????
- START MOV DPTR,
7FFFH - LOOP1 MOV R7,
80H - LOOP2 MOV A,
R7 - MOVX
_at_DPTR,A - DJNZ
R7, LOOP2 - SJMP
LOOP1
130- ???????
- START MOV DPTR, 7FFFH
- LOOP1 MOV R6, 80H
- LOOP2 MOV A, R6
- MOVX _at_DPTR,A
- INC R6
- CJNE R6,
0FFH,LOOP2 - SJMP POOP1
131- ???????
- START MOV DPTR, 7FFFH
- LOOP1 MOV R5, 00H
- LOOP2 MOV A, R5
- MOVX _at_DPTR,A
- INC R5
- CJNE R5,
0FFH,LOOP2 - SJMP LOOP1
132A/D?????
1 A/D????? AD?????????????????,????????4?
,????A/D????????A/D?????????A/D???????A/D????
???????????A/D?????????A/D????????A/D????????
??????,??????,???????????????,??,?????????????????
??
133 ??????A/D??????????,?????A/D??????????,??
??????,?????????µs???µs???????????????A/D??????
(1)ADC0801ADC0805?8?MOS?A/D???(??????????
?)? (2)ADC0808 / 0809?8?MOS?A/D????
(3) ADC0816 / 0817??????????????16???,?????ADC08
08 /0809??????
1342 ??A/D?????ADC0809 ADC0809????8?8???????
A/D???,CMOS??? 1)ADC0809???????
ADC0809??????????? ??,???????8?????,??8???
?????,????A/D????????????????????A?B?C????????????
,???????????,?????
135ADC0809??????
136?????
8?A/D?????????,???????????????????????256
R?????????? ?????????????????????
137 2. ???? ADC0809???28?????????,????
???5.39?
138 3 MCS-51????ADC0809??
ADC0809?8031????????????? ????????????,??8????????
?,??A/D?????????????
139ADC0809?8031??????
140 1. 8??????? A?B?C????????????????,?
????????0809???????,????????????????,???????????,?
????????,?????????????????,????P2.0??,????????????
??????????,?ADC0809?????????
141 ??????0,?8???IN0IN7??????0000H0007H?
??,???????????PX ?????,???????????????,??,8????
???????????????????P2.7?P2.6?P2.5??3-8???????????,
??,???ADC0809 8??????????
142 2. ??????? A/D?????????????,??????
????????????????????????A/D????,?????????????,????
?????,?????????? 1) ??????
????A/D?????,???????????????????????,ADC0809?????1
28 µs,???6 MHz?MCS-51???R 64??????????????????,A/D
???????????????,??????,?????????,???????????
143 2) ???? A/D????????????????,??ADC
0809?EOC????,???????,????EOC???,??????????,???????
?? 3) ???? ????????????(EOC)??????
??,???????????? ???,EOC??????????????UMDJ,
???????????????????????????? ??????????,????????,?
????????????
144 4 ???? ????8?????????????,???????????RAM
78H7FH???,????????????????????? ?????
ORG 0000H ???????
AJMP MAIN ?????
ORG 0013H ?????? AJMP
INT1 ????????
145 ??? MAIN MOV R0,78H ???????
MOV R2,08H
8????? SETB IT1
????
SETB EA ???
SETB EX1
???? MOV DPTR,6000H
??0809 IN0??
??
MOV A,00H
?????,A??
???
146 LOOP MOVX _at_DPTR,A ??A/D??
HERE SJMP HERE ????
DJNZ R2, LOOP
???????????? INT1 MOVX A,_at_DPTR
?A/D???? MOV _at_R0,A
?? INC DPTR
???? INC R0
?????? RETI
??
147AD574??????
- AD574?12????????A/D???,????????25?s,??????1L
SB?AD574????????????????????????,???????????????
?????,?????????????????????????????,????????,????
???010V?020V,????????,???????-5V5V,-10V10V?
148?2-8 AD574??????
149AD574???????????
- CS ????,??????
- CE?????,??????
- R/C ?/????,???A/D????,????A/D???
- 12/8 ??????????,??12?,??8??
- STS??????,??????,???????
150- A0??????R/C???,A0??,??8?A/D??A0??,??12?A/D???
- ?R/C???,A0??,???4???A0??,???8???
- ??5??????????A/D????????2-2???
- STS??????,???????,????????
- REF IN??????
- BIP OFF??????
- DB11DB012?????
- 10VIN,20VIN???????
151 AD574?8031????????
- ??AD574??????,8031????AD574?????????2-9???
???????8031??8???P2.0P2.7????,??????????????????A
/D????1FH,???4?????7FH,???8?????3FH?
152?2-9 AD574?8031????????
1538031/51????????
- ??8031/51?????????8???,?12?A/D????????????
- ???????????,????????A/D??????,?DOUT????,??
?DOUT??????,????????? - ??????????
1543.??A/D???????????
- ?????????
- ?????????,
- ???????
- ????????????,?????
- ??????
- ???????????