Browse Source

增加水位检测

liuhao 3 years ago
parent
commit
c9ddd98362

File diff suppressed because it is too large
+ 11 - 11
TEST_Prj/shuitianwuxian_c51/单片机程序/DEMO.uvgui.liuhao


+ 216 - 185
TEST_Prj/shuitianwuxian_c51/单片机程序/Listings/DEMO.m51

@@ -1,4 +1,4 @@
-BL51 BANKED LINKER/LOCATER V6.22                                                        02/17/2022  17:33:09  PAGE 1
+BL51 BANKED LINKER/LOCATER V6.22                                                        02/18/2022  11:34:52  PAGE 1
 
 
 BL51 BANKED LINKER/LOCATER V6.22, INVOKED BY:
@@ -59,7 +59,7 @@ LINK MAP OF MODULE:  .\Objects\DEMO (?C_STARTUP)
                     0009H     0002H                  *** GAP ***
             CODE    000BH     0003H     ABSOLUTE     
             CODE    000EH     0015H     UNIT         ?PR?TIMER0INIT?MAIN
-BL51 BANKED LINKER/LOCATER V6.22                                                      02/17/2022  17:33:09  PAGE 2
+BL51 BANKED LINKER/LOCATER V6.22                                                      02/18/2022  11:34:52  PAGE 2
 
 
             CODE    0023H     0003H     ABSOLUTE     
@@ -81,16 +81,17 @@ LINK MAP OF MODULE:  .\Objects\DEMO (?C_STARTUP)
             CODE    0CB8H     002CH     UNIT         ?PR?LCD1602_INIT?DRIVE_1602
             CODE    0CE4H     0027H     UNIT         ?PR?PUTCHAR?PUTCHAR
             CODE    0D0BH     001EH     UNIT         ?PR?_LCD1602_WRITE_ADDRESS?DRIVE_1602
-            CODE    0D29H     001BH     UNIT         ?PR?UARTINIT?MAIN
-            CODE    0D44H     0017H     UNIT         ?PR?_DELAY_XMS?MAIN
-            CODE    0D5BH     0015H     UNIT         ?PR?_STRLEN?STRLEN
-            CODE    0D70H     0010H     UNIT         ?PR?_LCD1602_DISP?DRIVE_1602
-            CODE    0D80H     000DH     UNIT         ?PR?_WRITE_1602_COM?DRIVE_1602
-            CODE    0D8DH     000DH     UNIT         ?PR?_WRITE_1602_DATE?DRIVE_1602
-            CODE    0D9AH     0009H     UNIT         ?PR?_DELAY_1MS?DRIVE_1602
-            CODE    0DA3H     0009H     UNIT         ?PR?DHT11_DELAY20MS?DHT11
-            CODE    0DACH     0005H     UNIT         ?PR?USART?MAIN
-            CODE    0DB1H     0005H     UNIT         ?PR?DHT11_DELAY32US?DHT11
+            CODE    0D29H     001EH     UNIT         ?PR?READ74HC165?MAIN
+            CODE    0D47H     001BH     UNIT         ?PR?UARTINIT?MAIN
+            CODE    0D62H     0017H     UNIT         ?PR?_DELAY_XMS?MAIN
+            CODE    0D79H     0015H     UNIT         ?PR?_STRLEN?STRLEN
+            CODE    0D8EH     0010H     UNIT         ?PR?_LCD1602_DISP?DRIVE_1602
+            CODE    0D9EH     000DH     UNIT         ?PR?_WRITE_1602_COM?DRIVE_1602
+            CODE    0DABH     000DH     UNIT         ?PR?_WRITE_1602_DATE?DRIVE_1602
+            CODE    0DB8H     0009H     UNIT         ?PR?_DELAY_1MS?DRIVE_1602
+            CODE    0DC1H     0009H     UNIT         ?PR?DHT11_DELAY20MS?DHT11
+            CODE    0DCAH     0005H     UNIT         ?PR?USART?MAIN
+            CODE    0DCFH     0005H     UNIT         ?PR?DHT11_DELAY32US?DHT11
 
 
 
@@ -118,10 +119,10 @@ SEGMENT                                          BIT_GROUP          DATA_GROUP
   +--> ?PR?_SENDSTRING?MAIN
   +--> ?PR?_WRITELCD1602_STRING?DRIVE_1602
 
-?PR?LCD1602_INIT?DRIVE_1602                   -----    -----      -----    -----      -----    -----
-BL51 BANKED LINKER/LOCATER V6.22                                                      02/17/2022  17:33:09  PAGE 3
+BL51 BANKED LINKER/LOCATER V6.22                                                      02/18/2022  11:34:52  PAGE 3
 
 
+?PR?LCD1602_INIT?DRIVE_1602                   -----    -----      -----    -----      -----    -----
   +--> ?PR?_WRITE_1602_COM?DRIVE_1602
   +--> ?PR?_DELAY_1MS?DRIVE_1602
 
@@ -178,10 +179,10 @@ SYMBOL TABLE OF MODULE:  .\Objects\DEMO (?C_STARTUP)
   -------         MODULE        ?C_STARTUP
   C:099DH         SEGMENT       ?C_C51STARTUP
   I:0042H         SEGMENT       ?STACK
-  C:0000H         PUBLIC        ?C_STARTUP
-BL51 BANKED LINKER/LOCATER V6.22                                                      02/17/2022  17:33:09  PAGE 4
+BL51 BANKED LINKER/LOCATER V6.22                                                      02/18/2022  11:34:52  PAGE 4
 
 
+  C:0000H         PUBLIC        ?C_STARTUP
   D:00E0H         SYMBOL        ACC
   D:00F0H         SYMBOL        B
   D:0083H         SYMBOL        DPH
@@ -217,59 +218,59 @@ SYMBOL TABLE OF MODULE:  .\Objects\DEMO (?C_STARTUP)
   D:0090H         PUBLIC        P1
   D:00A0H         PUBLIC        P2
   D:00B0H         PUBLIC        P3
-  C:0DA0H         PUBLIC        _delay_1ms
+  C:0DBEH         PUBLIC        _delay_1ms
   C:0A91H         PUBLIC        _L1602_printf
   D:00A8H         PUBLIC        IE
-  C:0D70H         PUBLIC        _LCD1602_Disp
+  C:0D8EH         PUBLIC        _LCD1602_Disp
   C:0CB8H         PUBLIC        lcd1602_init
   D:00B8H         PUBLIC        IP
   D:0098H         PUBLIC        SCON
   D:0088H         PUBLIC        TCON
-  C:0D8DH         PUBLIC        _Write_1602_date
+  C:0DABH         PUBLIC        _Write_1602_date
   C:0B91H         PUBLIC        _WriteLcd1602_String
   B:00A0H.6       PUBLIC        en
   C:0D0BH         PUBLIC        _LCD1602_Write_address
-  C:0D80H         PUBLIC        _Write_1602_com
+  C:0D9EH         PUBLIC        _Write_1602_com
   D:0008H         PUBLIC        String_Buff
   B:00A0H.7       PUBLIC        rs
   D:00C8H         PUBLIC        T2CON
   D:00D0H         PUBLIC        PSW
-  C:0D9CH         SYMBOL        L?0018
+  C:0DBAH         SYMBOL        L?0018
   -------         PROC          L?0017
   -------         ENDPROC       L?0017
-  C:0D9CH         SYMBOL        L?0018
-  -------         PROC          _DELAY_1MS
-BL51 BANKED LINKER/LOCATER V6.22                                                      02/17/2022  17:33:09  PAGE 5
+  C:0DBAH         SYMBOL        L?0018
+BL51 BANKED LINKER/LOCATER V6.22                                                      02/18/2022  11:34:52  PAGE 5
 
 
+  -------         PROC          _DELAY_1MS
   D:0006H         SYMBOL        xms
-  C:0DA0H         LINE#         14
-  C:0DA0H         LINE#         15
-  C:0DA0H         LINE#         16
+  C:0DBEH         LINE#         14
+  C:0DBEH         LINE#         15
+  C:0DBEH         LINE#         16
   -------         ENDPROC       _DELAY_1MS
   -------         PROC          _WRITE_1602_COM
   D:0007H         SYMBOL        com
-  C:0D80H         LINE#         19
-  C:0D80H         LINE#         20
-  C:0D80H         LINE#         22
-  C:0D82H         LINE#         23
-  C:0D82H         LINE#         24
-  C:0D85H         LINE#         25
-  C:0D87H         LINE#         26
-  C:0D8AH         LINE#         27
-  C:0D8CH         LINE#         28
+  C:0D9EH         LINE#         19
+  C:0D9EH         LINE#         20
+  C:0D9EH         LINE#         22
+  C:0DA0H         LINE#         23
+  C:0DA0H         LINE#         24
+  C:0DA3H         LINE#         25
+  C:0DA5H         LINE#         26
+  C:0DA8H         LINE#         27
+  C:0DAAH         LINE#         28
   -------         ENDPROC       _WRITE_1602_COM
   -------         PROC          _WRITE_1602_DATE
   D:0007H         SYMBOL        date
-  C:0D8DH         LINE#         31
-  C:0D8DH         LINE#         32
-  C:0D8DH         LINE#         34
-  C:0D8FH         LINE#         35
-  C:0D8FH         LINE#         36
-  C:0D92H         LINE#         37
-  C:0D94H         LINE#         38
-  C:0D97H         LINE#         39
-  C:0D99H         LINE#         40
+  C:0DABH         LINE#         31
+  C:0DABH         LINE#         32
+  C:0DABH         LINE#         34
+  C:0DADH         LINE#         35
+  C:0DADH         LINE#         36
+  C:0DB0H         LINE#         37
+  C:0DB2H         LINE#         38
+  C:0DB5H         LINE#         39
+  C:0DB7H         LINE#         40
   -------         ENDPROC       _WRITE_1602_DATE
   -------         PROC          _WRITELCD1602_STRING
   X:0030H         SYMBOL        x
@@ -298,10 +299,10 @@ SYMBOL TABLE OF MODULE:  .\Objects\DEMO (?C_STARTUP)
   -------         PROC          _L1602_PRINTF
   X:0000H         SYMBOL        x
   X:0001H         SYMBOL        y
-  X:0002H         SYMBOL        format
-BL51 BANKED LINKER/LOCATER V6.22                                                      02/17/2022  17:33:09  PAGE 6
+BL51 BANKED LINKER/LOCATER V6.22                                                      02/18/2022  11:34:52  PAGE 6
 
 
+  X:0002H         SYMBOL        format
   -------         DO            
   X:0005H         SYMBOL        ellipsis_40
   X:002DH         SYMBOL        ap
@@ -342,10 +343,10 @@ SYMBOL TABLE OF MODULE:  .\Objects\DEMO (?C_STARTUP)
   D:0007H         SYMBOL        x
   D:0005H         SYMBOL        y
   X:006DH         SYMBOL        buf
-  C:0D70H         LINE#         102
-  C:0D75H         LINE#         103
-  C:0D75H         LINE#         104
-  C:0D78H         LINE#         105
+  C:0D8EH         LINE#         102
+  C:0D93H         LINE#         103
+  C:0D93H         LINE#         104
+  C:0D96H         LINE#         105
   -------         ENDPROC       _LCD1602_DISP
   -------         ENDMOD        DRIVE_1602
 
@@ -358,15 +359,17 @@ SYMBOL TABLE OF MODULE:  .\Objects\DEMO (?C_STARTUP)
   D:00B0H         PUBLIC        P3
   X:005FH         PUBLIC        SdL
   X:0060H         PUBLIC        WdH
-  B:00A8H.7       PUBLIC        EA
-BL51 BANKED LINKER/LOCATER V6.22                                                      02/17/2022  17:33:09  PAGE 7
+BL51 BANKED LINKER/LOCATER V6.22                                                      02/18/2022  11:34:52  PAGE 7
 
 
+  B:00A8H.7       PUBLIC        EA
   B:0021H.1       PUBLIC        clear_flag
   X:0061H         PUBLIC        WdL
   D:00A8H         PUBLIC        IE
   X:0062H         PUBLIC        sw_val
+  C:0D29H         PUBLIC        Read74HC165
   X:0064H         PUBLIC        Bj_CNt
+  B:0090H.6       PUBLIC        IN_PL
   B:00A8H.4       PUBLIC        ES
   D:00B8H         PUBLIC        IP
   B:0098H.0       PUBLIC        RI
@@ -378,9 +381,9 @@ SYMBOL TABLE OF MODULE:  .\Objects\DEMO (?C_STARTUP)
   D:0099H         PUBLIC        SBUF
   D:0087H         PUBLIC        PCON
   D:0022H         PUBLIC        send_buff
-  C:0DACH         PUBLIC        usart
+  C:0DCAH         PUBLIC        usart
   D:0098H         PUBLIC        SCON
-  C:0D29H         PUBLIC        UartInit
+  C:0D47H         PUBLIC        UartInit
   X:0065H         PUBLIC        humi
   D:0089H         PUBLIC        TMOD
   D:0088H         PUBLIC        TCON
@@ -390,7 +393,7 @@ SYMBOL TABLE OF MODULE:  .\Objects\DEMO (?C_STARTUP)
   B:00A8H.3       PUBLIC        ET1
   B:0088H.5       PUBLIC        TF0
   C:000EH         PUBLIC        Timer0Init
-  C:0D44H         PUBLIC        _delay_xms
+  C:0D62H         PUBLIC        _delay_xms
   D:008CH         PUBLIC        TH0
   B:00A0H.1       PUBLIC        buzz
   D:008DH         PUBLIC        TH1
@@ -402,11 +405,13 @@ SYMBOL TABLE OF MODULE:  .\Objects\DEMO (?C_STARTUP)
   B:00B0H.7       PUBLIC        SW1
   B:00B0H.6       PUBLIC        SW2
   B:00B0H.5       PUBLIC        SW3
+  B:00B0H.6       PUBLIC        SCK
   X:0068H         PUBLIC        keyflag
   D:00C8H         PUBLIC        T2CON
   D:0032H         PUBLIC        showbuff
   X:0069H         PUBLIC        SET
   X:006AH         PUBLIC        SWH
+  B:0090H.7       PUBLIC        IN_Data
   X:006BH         PUBLIC        SWL
   D:00D0H         PUBLIC        PSW
   -------         PROC          _DELAY_XMS
@@ -414,15 +419,15 @@ SYMBOL TABLE OF MODULE:  .\Objects\DEMO (?C_STARTUP)
   -------         DO            
   D:0005H         SYMBOL        ix
   -------         ENDDO         
-  C:0D44H         LINE#         35
-  C:0D44H         LINE#         36
-  C:0D44H         LINE#         37
-  C:0D44H         LINE#         38
-  C:0D4FH         LINE#         39
-BL51 BANKED LINKER/LOCATER V6.22                                                      02/17/2022  17:33:09  PAGE 8
+BL51 BANKED LINKER/LOCATER V6.22                                                      02/18/2022  11:34:52  PAGE 8
 
 
-  C:0D5AH         LINE#         40
+  C:0D62H         LINE#         35
+  C:0D62H         LINE#         36
+  C:0D62H         LINE#         37
+  C:0D62H         LINE#         38
+  C:0D6DH         LINE#         39
+  C:0D78H         LINE#         40
   -------         ENDPROC       _DELAY_XMS
   -------         PROC          KEYREAD
   C:0755H         LINE#         53
@@ -474,14 +479,14 @@ SYMBOL TABLE OF MODULE:  .\Objects\DEMO (?C_STARTUP)
   C:0854H         LINE#         111
   C:0854H         LINE#         112
   C:0864H         LINE#         113
+BL51 BANKED LINKER/LOCATER V6.22                                                      02/18/2022  11:34:52  PAGE 9
+
+
   C:0866H         LINE#         115
   C:0866H         LINE#         116
   C:0873H         LINE#         117
   C:0875H         LINE#         119
   C:0875H         LINE#         120
-BL51 BANKED LINKER/LOCATER V6.22                                                      02/17/2022  17:33:09  PAGE 9
-
-
   C:0885H         LINE#         121
   C:0887H         LINE#         123
   C:0887H         LINE#         124
@@ -529,22 +534,22 @@ SYMBOL TABLE OF MODULE:  .\Objects\DEMO (?C_STARTUP)
   C:0C82H         LINE#         174
   -------         ENDPROC       TIMEISR
   -------         PROC          UARTINIT
-  C:0D29H         LINE#         176
-  C:0D29H         LINE#         177
-  C:0D29H         LINE#         178
-  C:0D2CH         LINE#         179
-  C:0D2FH         LINE#         180
-  C:0D32H         LINE#         181
-  C:0D35H         LINE#         182
-  C:0D38H         LINE#         183
-  C:0D3BH         LINE#         184
-  C:0D3DH         LINE#         185
-BL51 BANKED LINKER/LOCATER V6.22                                                      02/17/2022  17:33:09  PAGE 10
-
-
-  C:0D3FH         LINE#         186
-  C:0D41H         LINE#         187
-  C:0D43H         LINE#         188
+  C:0D47H         LINE#         176
+  C:0D47H         LINE#         177
+  C:0D47H         LINE#         178
+  C:0D4AH         LINE#         179
+  C:0D4DH         LINE#         180
+BL51 BANKED LINKER/LOCATER V6.22                                                      02/18/2022  11:34:52  PAGE 10
+
+
+  C:0D50H         LINE#         181
+  C:0D53H         LINE#         182
+  C:0D56H         LINE#         183
+  C:0D59H         LINE#         184
+  C:0D5BH         LINE#         185
+  C:0D5DH         LINE#         186
+  C:0D5FH         LINE#         187
+  C:0D61H         LINE#         188
   -------         ENDPROC       UARTINIT
   -------         PROC          _SENDDATA
   X:0003H         SYMBOL        p
@@ -573,79 +578,105 @@ SYMBOL TABLE OF MODULE:  .\Objects\DEMO (?C_STARTUP)
   C:0CB7H         LINE#         214
   -------         ENDPROC       _SENDSTRING
   -------         PROC          USART
-  C:0DACH         LINE#         216
-  C:0DACH         LINE#         218
-  C:0DACH         LINE#         219
-  C:0DACH         LINE#         221
-  C:0DACH         LINE#         222
-  C:0DAEH         LINE#         223
-  C:0DB0H         LINE#         224
+  C:0DCAH         LINE#         216
+  C:0DCAH         LINE#         218
+  C:0DCAH         LINE#         219
+  C:0DCAH         LINE#         221
+  C:0DCAH         LINE#         222
+  C:0DCCH         LINE#         223
+  C:0DCEH         LINE#         224
   -------         ENDPROC       USART
+  -------         PROC          READ74HC165
+  -------         DO            
+  D:0007H         SYMBOL        indata
+  D:0006H         SYMBOL        i
+  -------         ENDDO         
+  C:0D29H         LINE#         233
+  C:0D29H         LINE#         234
+  C:0D29H         LINE#         237
+  C:0D2BH         LINE#         238
+  C:0D2CH         LINE#         239
+  C:0D2EH         LINE#         240
+  C:0D2FH         LINE#         242
+  C:0D31H         LINE#         243
+BL51 BANKED LINKER/LOCATER V6.22                                                      02/18/2022  11:34:52  PAGE 11
+
+
+  C:0D32H         LINE#         244
+  C:0D32H         LINE#         245
+  C:0D36H         LINE#         246
+  C:0D38H         LINE#         247
+  C:0D39H         LINE#         249
+  C:0D3FH         LINE#         250
+  C:0D41H         LINE#         251
+  C:0D46H         LINE#         252
+  C:0D46H         LINE#         253
+  -------         ENDPROC       READ74HC165
   -------         PROC          MAIN
-  C:038BH         LINE#         231
-  C:038BH         LINE#         232
-  C:038BH         LINE#         233
-  C:038EH         LINE#         234
-  C:0391H         LINE#         235
-  C:03ACH         LINE#         236
-  C:03AEH         LINE#         237
-  C:03B5H         LINE#         238
-  C:03D0H         LINE#         239
-  C:03D3H         LINE#         240
-  C:03D3H         LINE#         241
-  C:03D3H         LINE#         243
-  C:03DCH         LINE#         244
-  C:03DCH         LINE#         245
-  C:03DEH         LINE#         246
-  C:03E7H         LINE#         247
-  C:03E7H         LINE#         248
-BL51 BANKED LINKER/LOCATER V6.22                                                      02/17/2022  17:33:09  PAGE 11
-
-
-  C:03EAH         LINE#         249
-  C:03EAH         LINE#         250
-  C:03ECH         LINE#         252
-  C:03F1H         LINE#         253
-  C:03F8H         LINE#         254
-  C:03F8H         LINE#         256
-  C:0413H         LINE#         257
-  C:0427H         LINE#         258
-  C:043CH         LINE#         259
-  C:0457H         LINE#         260
-  C:0473H         LINE#         261
-  C:0504H         LINE#         262
-  C:0504H         LINE#         263
-  C:0506H         LINE#         264
-  C:0508H         LINE#         265
-  C:0508H         LINE#         266
-  C:050AH         LINE#         267
-  C:050AH         LINE#         268
-  C:0540H         LINE#         269
-  C:0549H         LINE#         270
-  C:054CH         LINE#         272
-  C:054CH         LINE#         273
-  C:054FH         LINE#         274
-  C:054FH         LINE#         275
-  C:0551H         LINE#         277
-  C:0556H         LINE#         278
-  C:055DH         LINE#         279
-  C:055DH         LINE#         280
-  C:0578H         LINE#         281
-  C:0578H         LINE#         282
-  C:0578H         LINE#         283
-  C:0578H         LINE#         284
-  C:0584H         LINE#         285
-  C:0595H         LINE#         286
-  C:0597H         LINE#         288
-  C:0597H         LINE#         289
-  C:0597H         LINE#         290
-  C:05A3H         LINE#         291
-  C:05C0H         LINE#         292
-  C:05C3H         LINE#         294
-  C:05C3H         LINE#         295
-  C:05C3H         LINE#         296
-  C:05CFH         LINE#         297
-  C:05ECH         LINE#         298
+  C:038BH         LINE#         257
+  C:038BH         LINE#         258
+  C:038BH         LINE#         259
+  C:038EH         LINE#         260
+  C:0391H         LINE#         261
+  C:03ACH         LINE#         262
+  C:03AEH         LINE#         263
+  C:03B5H         LINE#         264
+  C:03D0H         LINE#         265
+  C:03D3H         LINE#         266
+  C:03D3H         LINE#         267
+  C:03D3H         LINE#         269
+  C:03DCH         LINE#         270
+  C:03DCH         LINE#         271
+  C:03DEH         LINE#         272
+  C:03E7H         LINE#         273
+  C:03E7H         LINE#         274
+  C:03EAH         LINE#         275
+  C:03EAH         LINE#         276
+  C:03ECH         LINE#         278
+  C:03F1H         LINE#         279
+  C:03F8H         LINE#         280
+  C:03F8H         LINE#         282
+  C:0413H         LINE#         283
+  C:0427H         LINE#         284
+  C:043CH         LINE#         285
+  C:0457H         LINE#         286
+  C:0473H         LINE#         287
+  C:0504H         LINE#         288
+  C:0504H         LINE#         289
+  C:0506H         LINE#         290
+  C:0508H         LINE#         291
+  C:0508H         LINE#         292
+  C:050AH         LINE#         293
+  C:050AH         LINE#         294
+  C:0540H         LINE#         295
+  C:0549H         LINE#         296
+  C:054CH         LINE#         298
+  C:054CH         LINE#         299
+  C:054FH         LINE#         300
+  C:054FH         LINE#         301
+  C:0551H         LINE#         303
+  C:0556H         LINE#         304
+  C:055DH         LINE#         305
+  C:055DH         LINE#         306
+  C:0578H         LINE#         307
+BL51 BANKED LINKER/LOCATER V6.22                                                      02/18/2022  11:34:52  PAGE 12
+
+
+  C:0578H         LINE#         308
+  C:0578H         LINE#         309
+  C:0578H         LINE#         310
+  C:0584H         LINE#         311
+  C:0595H         LINE#         312
+  C:0597H         LINE#         314
+  C:0597H         LINE#         315
+  C:0597H         LINE#         316
+  C:05A3H         LINE#         317
+  C:05C0H         LINE#         318
+  C:05C3H         LINE#         320
+  C:05C3H         LINE#         321
+  C:05C3H         LINE#         322
+  C:05CFH         LINE#         323
+  C:05ECH         LINE#         324
   -------         ENDPROC       MAIN
   -------         ENDMOD        MAIN
 
@@ -659,40 +690,40 @@ SYMBOL TABLE OF MODULE:  .\Objects\DEMO (?C_STARTUP)
   D:00A8H         PUBLIC        IE
   D:00B8H         PUBLIC        IP
   C:05EFH         PUBLIC        _dht11_value
-BL51 BANKED LINKER/LOCATER V6.22                                                      02/17/2022  17:33:09  PAGE 12
-
-
   D:0098H         PUBLIC        SCON
   D:0088H         PUBLIC        TCON
   C:0C16H         PUBLIC        dht11_read_byte
-  C:0DA3H         PUBLIC        dht11_Delay20ms
+  C:0DC1H         PUBLIC        dht11_Delay20ms
   C:0003H         PUBLIC        dht11_Delay50us
-  C:0DB1H         PUBLIC        dht11_Delay32us
+  C:0DCFH         PUBLIC        dht11_Delay32us
   D:00C8H         PUBLIC        T2CON
   D:00D0H         PUBLIC        PSW
   -------         PROC          DHT11_DELAY32US
   -------         DO            
   D:0007H         SYMBOL        i
   -------         ENDDO         
-  C:0DB1H         LINE#         4
-  C:0DB1H         LINE#         5
-  C:0DB1H         LINE#         8
-  C:0DB3H         LINE#         9
-  C:0DB5H         LINE#         10
+  C:0DCFH         LINE#         4
+  C:0DCFH         LINE#         5
+  C:0DCFH         LINE#         8
+  C:0DD1H         LINE#         9
+  C:0DD3H         LINE#         10
   -------         ENDPROC       DHT11_DELAY32US
   -------         PROC          DHT11_DELAY20MS
   -------         DO            
   D:0007H         SYMBOL        i
   D:0006H         SYMBOL        j
   -------         ENDDO         
-  C:0DA3H         LINE#         11
-  C:0DA3H         LINE#         12
-  C:0DA3H         LINE#         15
-  C:0DA5H         LINE#         16
-  C:0DA7H         LINE#         18
-  C:0DA7H         LINE#         19
-  C:0DA9H         LINE#         20
-  C:0DABH         LINE#         21
+  C:0DC1H         LINE#         11
+  C:0DC1H         LINE#         12
+  C:0DC1H         LINE#         15
+  C:0DC3H         LINE#         16
+  C:0DC5H         LINE#         18
+  C:0DC5H         LINE#         19
+BL51 BANKED LINKER/LOCATER V6.22                                                      02/18/2022  11:34:52  PAGE 13
+
+
+  C:0DC7H         LINE#         20
+  C:0DC9H         LINE#         21
   -------         ENDPROC       DHT11_DELAY20MS
   -------         PROC          DHT11_DELAY50US
   -------         DO            
@@ -719,9 +750,6 @@ SYMBOL TABLE OF MODULE:  .\Objects\DEMO (?C_STARTUP)
   C:0C19H         LINE#         39
   C:0C19H         LINE#         40
   C:0C1BH         LINE#         43
-BL51 BANKED LINKER/LOCATER V6.22                                                      02/17/2022  17:33:09  PAGE 13
-
-
   C:0C1EH         LINE#         44
   C:0C1EH         LINE#         45
   C:0C1FH         LINE#         46
@@ -751,6 +779,9 @@ SYMBOL TABLE OF MODULE:  .\Objects\DEMO (?C_STARTUP)
   C:0C4DH         LINE#         76
   C:0C52H         LINE#         77
   C:0C54H         LINE#         78
+BL51 BANKED LINKER/LOCATER V6.22                                                      02/18/2022  11:34:52  PAGE 14
+
+
   -------         ENDPROC       DHT11_READ_BYTE
   -------         PROC          _DHT11_VALUE
   X:0000H         SYMBOL        temp
@@ -779,9 +810,6 @@ SYMBOL TABLE OF MODULE:  .\Objects\DEMO (?C_STARTUP)
   C:0613H         LINE#         100
   C:0619H         LINE#         101
   C:0619H         LINE#         102
-BL51 BANKED LINKER/LOCATER V6.22                                                      02/17/2022  17:33:09  PAGE 14
-
-
   C:061CH         LINE#         103
   C:061CH         LINE#         104
   C:061DH         LINE#         105
@@ -811,6 +839,9 @@ SYMBOL TABLE OF MODULE:  .\Objects\DEMO (?C_STARTUP)
   C:06A0H         LINE#         134
   C:06BAH         LINE#         135
   C:06D9H         LINE#         136
+BL51 BANKED LINKER/LOCATER V6.22                                                      02/18/2022  11:34:52  PAGE 15
+
+
   C:06F3H         LINE#         137
   C:0712H         LINE#         138
   C:0714H         LINE#         140
@@ -839,9 +870,6 @@ SYMBOL TABLE OF MODULE:  .\Objects\DEMO (?C_STARTUP)
 
   -------         MODULE        ?C?CSTPTR
   C:08CAH         PUBLIC        ?C?CSTPTR
-BL51 BANKED LINKER/LOCATER V6.22                                                      02/17/2022  17:33:09  PAGE 15
-
-
   -------         ENDMOD        ?C?CSTPTR
 
   -------         MODULE        ?C?CSTOPTR
@@ -868,9 +896,12 @@ SYMBOL TABLE OF MODULE:  .\Objects\DEMO (?C_STARTUP)
   -------         ENDMOD        PRINTF
 
   -------         MODULE        STRLEN
-  C:0D5BH         PUBLIC        _STRLEN
+  C:0D79H         PUBLIC        _STRLEN
   -------         ENDMOD        STRLEN
 
+BL51 BANKED LINKER/LOCATER V6.22                                                      02/18/2022  11:34:52  PAGE 16
+
+
   -------         MODULE        VSPRINTF
   X:002DH         PUBLIC        ?_VSPRINTF?BYTE
   C:0B47H         PUBLIC        _VSPRINTF
@@ -899,8 +930,8 @@ SYMBOL TABLE OF MODULE:  .\Objects\DEMO (?C_STARTUP)
 *** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS
     SEGMENT: ?PR?_LCD1602_DISP?DRIVE_1602
 
-BL51 BANKED LINKER/LOCATER V6.22                                                      02/17/2022  17:33:09  PAGE 16
-
+*** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS
+    SEGMENT: ?PR?READ74HC165?MAIN
 
-Program Size: data=63.3 xdata=110 code=3508
-LINK/LOCATE RUN COMPLETE.  1 WARNING(S),  0 ERROR(S)
+Program Size: data=63.3 xdata=110 code=3538
+LINK/LOCATE RUN COMPLETE.  2 WARNING(S),  0 ERROR(S)

+ 4 - 4
TEST_Prj/shuitianwuxian_c51/单片机程序/Listings/dht11.lst

@@ -1,4 +1,4 @@
-C51 COMPILER V9.54   DHT11                                                                 02/17/2022 17:16:18 PAGE 1   
+C51 COMPILER V9.54   DHT11                                                                 02/18/2022 10:21:03 PAGE 1   
 
 
 C51 COMPILER V9.54, COMPILATION OF MODULE DHT11
@@ -62,7 +62,7 @@ line level    source
   52   2              dht11_Delay32us();  //32us
   53   2              
   54   2              //高电平26~28us表示'0',70us表示'1'
-C51 COMPILER V9.54   DHT11                                                                 02/17/2022 17:16:18 PAGE 2   
+C51 COMPILER V9.54   DHT11                                                                 02/18/2022 10:21:03 PAGE 2   
 
   55   2              if( DHT11_PIN == 1 )
   56   2              {      
@@ -126,7 +126,7 @@ line level    source
  114   2                  while( DHT11_PIN ); //等待接收;
  115   2                  {
  116   3                       _nop_();
-C51 COMPILER V9.54   DHT11                                                                 02/17/2022 17:16:18 PAGE 3   
+C51 COMPILER V9.54   DHT11                                                                 02/18/2022 10:21:03 PAGE 3   
 
  117   3                        t_count++;
  118   3                  
@@ -190,7 +190,7 @@ line level    source
  176   2      //            {
  177   2      //                *temp = 0;
  178   2      //                *humi = 0;
-C51 COMPILER V9.54   DHT11                                                                 02/17/2022 17:16:18 PAGE 4   
+C51 COMPILER V9.54   DHT11                                                                 02/18/2022 10:21:03 PAGE 4   
 
  179   2      //            }     
  180   2      

+ 111 - 85
TEST_Prj/shuitianwuxian_c51/单片机程序/Listings/main.lst

@@ -1,4 +1,4 @@
-C51 COMPILER V9.54   MAIN                                                                  02/17/2022 17:32:52 PAGE 1   
+C51 COMPILER V9.54   MAIN                                                                  02/18/2022 11:34:52 PAGE 1   
 
 
 C51 COMPILER V9.54, COMPILATION OF MODULE MAIN
@@ -62,7 +62,7 @@ line level    source
   52          
   53          void KeyRead(void)
   54          {
-C51 COMPILER V9.54   MAIN                                                                  02/17/2022 17:32:52 PAGE 2   
+C51 COMPILER V9.54   MAIN                                                                  02/18/2022 11:34:52 PAGE 2   
 
   55   1          if(!SW1)
   56   1          {
@@ -126,7 +126,7 @@ line level    source
  114   4                
  115   4                 case 3:
  116   4                   if(--SdH<0)SdH=90;
-C51 COMPILER V9.54   MAIN                                                                  02/17/2022 17:32:52 PAGE 3   
+C51 COMPILER V9.54   MAIN                                                                  02/18/2022 11:34:52 PAGE 3   
 
  117   4                 break;
  118   4                 
@@ -190,7 +190,7 @@ line level    source
  176          void UartInit(void)   //9600bps@11.0592MHz
  177          {
  178   1        PCON &= 0x7F;   //波特率不倍速
-C51 COMPILER V9.54   MAIN                                                                  02/17/2022 17:32:52 PAGE 4   
+C51 COMPILER V9.54   MAIN                                                                  02/18/2022 11:34:52 PAGE 4   
 
  179   1        SCON = 0x50;    //8位数据,可变波特率
  180   1        TMOD &= 0x0F;   //清除定时器1模式位
@@ -242,92 +242,118 @@ line level    source
  226          char data showbuff[16]={0};
  227          char data send_buff[16]={0};
  228          
- 229          bit clear_flag=0;
- 230          
- 231          void main()
- 232          {
- 233   1        lcd1602_init();
- 234   1        UartInit();
- 235   1        dht11_value(&temp,&humi,DHT11_UINT8);
- 236   1        buzz=1;
- 237   1        delay_xms(200);
- 238   1        dht11_value(&temp,&humi,DHT11_UINT8);
- 239   1        Timer0Init();
- 240   1        while(1)
-C51 COMPILER V9.54   MAIN                                                                  02/17/2022 17:32:52 PAGE 5   
+ 229          sbit IN_PL = P1^6;  //SHIFT/!LOA引脚
+ 230          sbit IN_Data = P1^7; // QH数据输出引脚
+ 231          sbit SCK = P3^6;  //CLOCK引脚
+ 232          
+ 233          unsigned char Read74HC165(void)
+ 234          {
+ 235   1         unsigned char indata;
+ 236   1         unsigned char i;
+ 237   1         IN_PL = 0;//装载8位并行数据
+ 238   1         _nop_();
+ 239   1         IN_PL = 1;//转换8位并行数据为串行数据
+ 240   1         _nop_();
+C51 COMPILER V9.54   MAIN                                                                  02/18/2022 11:34:52 PAGE 5   
 
- 241   1        {
- 242   2          
- 243   2          if(JCount>50)//500ms采集一次
- 244   2          {
- 245   3          JCount=0;
- 246   3          if(SET==0)
- 247   3          { 
- 248   4               if(clear_flag==1)
- 249   4                {
- 250   5                  clear_flag=0;
- 251   5                      
- 252   5                  Write_1602_com(0x01);//清显示 
- 253   5                  delay_1ms(100);        
- 254   5                }
- 255   4            
- 256   4                dht11_value(&temp,&humi,DHT11_UINT8);
- 257   4                L1602_printf(0,0,"temp:%2d",temp);
- 258   4                L1602_printf(0,1,"humi:%2d",humi);
- 259   4                L1602_printf(12,0,"%s","SW");
- 260   4                L1602_printf(12,1,"%2dcm",sw_val);
- 261   4                if((temp<WdL||temp>WdH)||(humi<SdL||humi>SdH)||(sw_val<SWL||sw_val>SWH))
- 262   4                {
- 263   5                   bj_flag=1;
- 264   5                }else
- 265   4                {
- 266   5                  bj_flag=0;
- 267   5                }
- 268   4                  sprintf(send_buff,"X%dH%dD%dZ\r\n",temp,humi,sw_val);
- 269   4                 sendString(send_buff);
- 270   4          }
- 271   3          else 
- 272   3          {
- 273   4             if(clear_flag==0)
- 274   4             {
- 275   5                clear_flag=1;
- 276   5                      
- 277   5                Write_1602_com(0x01);//清显示 
- 278   5                delay_1ms(100);        
- 279   5             }
- 280   4             switch(SET)
- 281   4             {
- 282   5               case 1:
- 283   5               case 2:
- 284   5                 WriteLcd1602_String(0,0,"Set temp");
- 285   5                 L1602_printf(0,1,"H:%2d  L:%2d",WdH,WdL);
- 286   5               break;
- 287   5               
- 288   5               case 3:
- 289   5               case 4:
- 290   5                 WriteLcd1602_String(0,0,"Set humi");
- 291   5                 L1602_printf(0,1,"H:%2d  L:%2d",SdH,SdL);
- 292   5               break;
- 293   5               
- 294   5               case 5:
- 295   5               case 6:
- 296   5                 WriteLcd1602_String(0,0,"Set SW  ");
- 297   5                 L1602_printf(0,1,"H:%2d  L:%2d",SWH,SWL);
- 298   5               break;
- 299   5             }
- 300   4             
- 301   4          }
- 302   3        }
-C51 COMPILER V9.54   MAIN                                                                  02/17/2022 17:32:52 PAGE 6   
+ 241   1       
+ 242   1         indata = 0;
+ 243   1         for(i = 0; i < 8; i ++) //将8个串行数据存入数组indata中
+ 244   1         {
+ 245   2          indata = indata << 1;//开始时,indata数组先左移一位,以后每个循环左移一次
+ 246   2          SCK = 0;//时钟低电平到来后,并行数据开始转换串行数据
+ 247   2          _nop_();
+ 248   2          
+ 249   2          indata |= IN_Data; //将转换完成的串行数据一位位存入数组
+ 250   2          SCK = 1;  //时钟变为高电平,再次变为低电平时,开始传出下一位串行数据
+ 251   2         }
+ 252   1          return indata;
+ 253   1      }
+ 254          
+ 255          bit clear_flag=0;
+ 256          
+ 257          void main()
+ 258          {
+ 259   1        lcd1602_init();
+ 260   1        UartInit();
+ 261   1        dht11_value(&temp,&humi,DHT11_UINT8);
+ 262   1        buzz=1;
+ 263   1        delay_xms(200);
+ 264   1        dht11_value(&temp,&humi,DHT11_UINT8);
+ 265   1        Timer0Init();
+ 266   1        while(1)
+ 267   1        {
+ 268   2          
+ 269   2          if(JCount>50)//500ms采集一次
+ 270   2          {
+ 271   3          JCount=0;
+ 272   3          if(SET==0)
+ 273   3          { 
+ 274   4               if(clear_flag==1)
+ 275   4                {
+ 276   5                  clear_flag=0;
+ 277   5                      
+ 278   5                  Write_1602_com(0x01);//清显示 
+ 279   5                  delay_1ms(100);        
+ 280   5                }
+ 281   4            
+ 282   4                dht11_value(&temp,&humi,DHT11_UINT8);
+ 283   4                L1602_printf(0,0,"temp:%2d",temp);
+ 284   4                L1602_printf(0,1,"humi:%2d",humi);
+ 285   4                L1602_printf(12,0,"%s","SW");
+ 286   4                L1602_printf(12,1,"%2dcm",sw_val);
+ 287   4                if((temp<WdL||temp>WdH)||(humi<SdL||humi>SdH)||(sw_val<SWL||sw_val>SWH))
+ 288   4                {
+ 289   5                   bj_flag=1;
+ 290   5                }else
+ 291   4                {
+ 292   5                  bj_flag=0;
+ 293   5                }
+ 294   4                  sprintf(send_buff,"X%dH%dD%dZ\r\n",temp,humi,sw_val);
+ 295   4                 sendString(send_buff);
+ 296   4          }
+ 297   3          else 
+ 298   3          {
+ 299   4             if(clear_flag==0)
+ 300   4             {
+ 301   5                clear_flag=1;
+ 302   5                      
+C51 COMPILER V9.54   MAIN                                                                  02/18/2022 11:34:52 PAGE 6   
 
- 303   2        
- 304   2        }
- 305   1      
- 306   1      }
+ 303   5                Write_1602_com(0x01);//清显示 
+ 304   5                delay_1ms(100);        
+ 305   5             }
+ 306   4             switch(SET)
+ 307   4             {
+ 308   5               case 1:
+ 309   5               case 2:
+ 310   5                 WriteLcd1602_String(0,0,"Set temp");
+ 311   5                 L1602_printf(0,1,"H:%2d  L:%2d",WdH,WdL);
+ 312   5               break;
+ 313   5               
+ 314   5               case 3:
+ 315   5               case 4:
+ 316   5                 WriteLcd1602_String(0,0,"Set humi");
+ 317   5                 L1602_printf(0,1,"H:%2d  L:%2d",SdH,SdL);
+ 318   5               break;
+ 319   5               
+ 320   5               case 5:
+ 321   5               case 6:
+ 322   5                 WriteLcd1602_String(0,0,"Set SW  ");
+ 323   5                 L1602_printf(0,1,"H:%2d  L:%2d",SWH,SWL);
+ 324   5               break;
+ 325   5             }
+ 326   4             
+ 327   4          }
+ 328   3        }
+ 329   2        
+ 330   2        }
+ 331   1      
+ 332   1      }
 
 
 MODULE INFORMATION:   STATIC OVERLAYABLE
-   CODE SIZE        =   1200    ----
+   CODE SIZE        =   1230    ----
    CONSTANT SIZE    =     83    ----
    XDATA SIZE       =     14       6
    PDATA SIZE       =   ----    ----

BIN
TEST_Prj/shuitianwuxian_c51/单片机程序/Objects/DEMO


+ 6 - 4
TEST_Prj/shuitianwuxian_c51/单片机程序/Objects/DEMO.build_log.htm

@@ -23,14 +23,16 @@ Project File Date:  02/17/2022
 
 <h2>Output:</h2>
 Build target 'Target 1'
-compiling drive_1602.c...
+compiling main.c...
 linking...
 *** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS
     SEGMENT: ?PR?_LCD1602_DISP?DRIVE_1602
-Program Size: data=63.3 xdata=110 code=3508
+*** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS
+    SEGMENT: ?PR?READ74HC165?MAIN
+Program Size: data=63.3 xdata=110 code=3538
 creating hex file from ".\Objects\DEMO"...
-".\Objects\DEMO" - 0 Error(s), 1 Warning(s).
-Build Time Elapsed:  00:00:00
+".\Objects\DEMO" - 0 Error(s), 2 Warning(s).
+Build Time Elapsed:  00:00:01
 </pre>
 </body>
 </html>

+ 35 - 32
TEST_Prj/shuitianwuxian_c51/单片机程序/Objects/DEMO.hex

@@ -2,14 +2,14 @@
 :0C099D00787FE4F6D8FD7581410209E482
 :100A290010080000000000000000000000000000A5
 :020A39000000BB
-:060D9A008F907F017E0036
-:030DA000020D44FD
-:0D0D8000C2A7120D9AD2A6120D9CC2A62287
-:0D0D8D00D2A7120D9AD2A6120D9CC2A6226A
+:060DB8008F907F017E0018
+:030DBE00020D62C1
+:0D0D9E00C2A7120DB8D2A6120DBAC2A6222D
+:0D0DAB00D2A7120DB8D2A6120DBAC2A62210
 :0E0B9100900030EFF0A3EBF0A3EAF0A3E9F040
 :100B9F00E4A3F0ED9000307005E024808003E024A2
-:100BAF00C0FF120D80900031E0FBA3E0FAA3E0F943
-:100BBF001208B1FF600F120D8D900032E475F00135
+:100BAF00C0FF120D9E900031E0FBA3E0FAA3E0F925
+:100BBF001208B1FF600F120DAB900032E475F00117
 :050BCF001208FE80E0A9
 :010BD40022FE
 :100A9100900000EFF0A3EDF0A3EBF0A3EAF0A3E9DF
@@ -20,12 +20,12 @@
 :100AD200C9F0A3EAF0A3E9F07B007A007908120BCF
 :100AE20047900000E0FFA3E0FD7B007A0079080256
 :020AF2000B9166
-:100CB8007F38120D80120D9C7F0C120D80120D9C36
-:100CC8007F06120D80120D9C7F01120D80120D9C63
-:0C0CD8007F80120D807F017E00020DA0C5
+:100CB8007F38120D9E120DBA7F0C120D9E120DBABE
+:100CC8007F06120D9E120DBA7F01120D9E120DBAEB
+:0C0CD8007F80120D9E7F017E00020DBE89
 :100D0B0090006CEFF0540FF0ED5401FD7003E08098
-:0E0D1B000690006CE024404480FF120D802200
-:100D700090006DEBF0120D0B90006DE0FF020D8DF9
+:0E0D1B000690006CE024404480FF120D9E22E2
+:100D8E0090006DEBF0120D0B90006DE0FF020DABBD
 :100AF40074656D703A2532640068756D693A253203
 :100B04006400257300535700253264636D00582533
 :100B1400644825644425645A0D0A0053657420749E
@@ -38,9 +38,9 @@
 :100A6B003200000000000000000000000000000049
 :100A7B000010220000000000000000000000000039
 :050A8B00000000C1099C
-:100D4400D3EF9400EE64809480400B7D6EDDFEEF63
-:060D54001F70ED1E80EA95
-:010D5A002276
+:100D6200D3EF9400EE64809480400B7D6EDDFEEF45
+:060D72001F70ED1E80EA77
+:010D78002258
 :1007550020B72430B7030208B0900068E0600302B8
 :1007650008B004F0A3E004F0D394064002E4F030AE
 :10077500B7030208B080F830B60302081830B60394
@@ -70,25 +70,28 @@
 :100C650055300A11900064E004F0D3941E4008E466
 :100C7500F0B2A18002D2A1900067E004F0D0D0D0FC
 :060C850082D083D0E032B2
-:100D290053877F75985053890F438920758BFD75BB
-:0B0D39008DFDC2ABD28ED2AFC2AC2247
+:100D470053877F75985053890F438920758BFD759D
+:0B0D57008DFDC2ABD28ED2AFC2AC2229
 :100BD500900003EBF0A3EAF0A3E9F0900003A3E093
 :100BE500FAA3E04A602AC2ACEDD394004022AF05D7
 :100BF5001DEF601C900003E0FBA3E475F0011209F2
 :100C050014A9F0FA1208B1F5993099FDC29980DE60
 :010C150022BC
 :100C8B00900000EBF0A3EAF0A3E9F0900000E0FB8A
-:100C9B00A3E0FAA3E0F94A6013120D5BAD079000D5
+:100C9B00A3E0FAA3E0F94A6013120D79AD079000B7
 :0D0CAB0000E0FBA3E0FAA3E0F9120BD52254
-:03002300020DAC1F
-:050DAC00C298C299325B
-:10038B00120CB8120D299000037401F0A37400F045
+:03002300020DCA01
+:050DCA00C298C299323D
+:100D2900C29600D29600E4FFFEEF25E0FFC2B600AE
+:0D0D3900A297E4334FFFD2B60EEEB408ECE3
+:010D4600228A
+:10038B00120CB8120D479000037401F0A37400F027
 :10039B00A37465F0A37402F07B017A0079661205F1
-:1003AB00EFD2A17FC87E00120D449000037401F0C0
+:1003AB00EFD2A17FC87E00120D629000037401F0A2
 :1003BB00A37400F0A37465F0A37402F07B017A00C0
 :1003CB0079661205EF12000E900067E0D39432406D
 :1003DB00F7E4F0900069E0600302054C30090EC2AF
-:1003EB00097F01120D807F647E00120DA090000327
+:1003EB00097F01120D9E7F647E00120DBE900003EB
 :1003FB007401F0A37400F0A37465F0A37402F07B96
 :10040B00017A0079661205EF7BFF7A0A79F4900086
 :10041B0066E0900005F0E4FDFF120A917BFF7A0A7B
@@ -110,8 +113,8 @@
 :10051B00E090003CF0900065E090003DF0900062B0
 :10052B00E0FFA3E090003ECFF0A3EFF07B007A005A
 :10053B00792212008B7B007A007922120C8B02033A
-:10054B00D320090ED2097F01120D807F647E001229
-:10055B000DA0900069E024FE601314602F14602C32
+:10054B00D320090ED2097F01120D9E7F647E00120B
+:10055B000DBE900069E024FE601314602F14602C14
 :10056B00146055146052240560030203D37BFF7A99
 :10057B000B791FE4FDFF120B917BFF7A0B7928900F
 :10058B000060E0900005F0900061801D7BFF7A0B0E
@@ -121,20 +124,20 @@
 :1005CB00FF120B917BFF7A0B792890006AE0900069
 :1005DB0005F090006BE0900006F07D01E4FF120A3D
 :0405EB00910203D3A3
-:040DB1007F0CDFFED6
-:010DB500221B
-:080DA3007F247ED9DEFEDFFC97
-:010DAB002225
+:040DCF007F0CDFFEB8
+:010DD30022FD
+:080DC1007F247ED9DEFEDFFC79
+:010DC9002207
 :05000300007F14DFFE88
 :0100080022D5
 :100C1600E4FEFCE4FD20A00B000DEDD394FA40F5B4
-:100C26007F6422E4FD120DB130A008EE25E04401F8
+:100C26007F6422E4FD120DCF30A008EE25E04401DA
 :100C3600FE8006EE25E0FE800E30A00B000DEDD303
 :0E0C460094FA40F57F64220CECB408C7AF06A8
 :010C5400227D
 :0B05EF00900000EBF0A3EAF0A3E9F09D
 :1005FA00E4FD900007F0F9A3F0FBFC00C2A0001292
-:10060A000DA3D2A000120DB10030A00302074F20A3
+:10060A000DC1D2A000120DCF0030A00302074F2067
 :10061A00A00B000DEDD394FA40F57FFF22E4FD1202
 :10062A00000320A0FD000DEDD394FA40037FFF22C2
 :10063A00C2AF120C16900007EFF0120C16A907129F
@@ -231,8 +234,8 @@
 :10035E001930D50108F60200D52D50434958120028
 :10036E00262403B405004001E49003679312005A5B
 :0D037E00743A12005AD2037519040201BA34
-:100D5B00E4FFFE1208B1600C0FEF70010E09E97091
-:050D6B00F20A80EF22F6
+:100D7900E4FFFE1208B1600C0FEF70010E09E97073
+:050D8900F20A80EF22D8
 :100B4700900030E0FFA3E0FEA3E0CF900039F0A3D0
 :100B5700EEF0A3EFF0900033E0CBF0A3E0CAF0A3F0
 :100B6700E0C9F07F2290003CAD82AC831208B18DC2

+ 26 - 0
TEST_Prj/shuitianwuxian_c51/单片机程序/main.c

@@ -226,6 +226,32 @@ void usart() interrupt 4
 char data showbuff[16]={0};
 char data send_buff[16]={0};
 
+sbit IN_PL = P1^6;  //SHIFT/!LOA引脚
+sbit IN_Data = P1^7; // QH数据输出引脚
+sbit SCK = P3^6;  //CLOCK引脚
+
+unsigned char Read74HC165(void)
+{
+   unsigned char indata;
+   unsigned char i;
+   IN_PL = 0;//装载8位并行数据
+   _nop_();
+   IN_PL = 1;//转换8位并行数据为串行数据
+   _nop_();
+ 
+   indata = 0;
+   for(i = 0; i < 8; i ++) //将8个串行数据存入数组indata中
+   {
+    indata = indata << 1;//开始时,indata数组先左移一位,以后每个循环左移一次
+		SCK = 0;//时钟低电平到来后,并行数据开始转换串行数据
+		_nop_();
+    
+		indata |= IN_Data; //将转换完成的串行数据一位位存入数组
+		SCK = 1;  //时钟变为高电平,再次变为低电平时,开始传出下一位串行数据
+   }
+		return indata;
+}
+
 bit clear_flag=0;
 
 void main()

Some files were not shown because too many files changed in this diff