From ac49d03d34551cb9c52c3de6800f0600ba87f8bb Mon Sep 17 00:00:00 2001 From: iridiumR Date: Thu, 5 May 2022 20:25:59 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AD=89=E7=9D=80=E4=BF=AEbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MCU/MCU_7 _LCD12864/Listings/MCU_1.m51 | 612 ++++++++++---------- MCU/MCU_7 _LCD12864/display.c | 230 +++++--- MCU/MCU_7 _LCD12864/display.h | 8 +- MCU/MCU_7 _LCD12864/main.c | 47 +- MCU/MCU_7 _LCD12864/main.h | 22 - MCU/MCU_8 _LCD12864_Sine/Listings/MCU_1.m51 | 410 +++++++++++++ MCU/MCU_8 _LCD12864_Sine/MCU_1.uvopt | 265 +++++++++ MCU/MCU_8 _LCD12864_Sine/MCU_1.uvproj | 415 +++++++++++++ MCU/MCU_8 _LCD12864_Sine/delay.c | 29 + MCU/MCU_8 _LCD12864_Sine/delay.h | 7 + MCU/MCU_8 _LCD12864_Sine/display.c | 200 +++++++ MCU/MCU_8 _LCD12864_Sine/display.h | 17 + MCU/MCU_8 _LCD12864_Sine/main.c | 24 + MCU/MCU_8 _LCD12864_Sine/main.h | 11 + 14 files changed, 1847 insertions(+), 450 deletions(-) create mode 100644 MCU/MCU_8 _LCD12864_Sine/Listings/MCU_1.m51 create mode 100644 MCU/MCU_8 _LCD12864_Sine/MCU_1.uvopt create mode 100644 MCU/MCU_8 _LCD12864_Sine/MCU_1.uvproj create mode 100644 MCU/MCU_8 _LCD12864_Sine/delay.c create mode 100644 MCU/MCU_8 _LCD12864_Sine/delay.h create mode 100644 MCU/MCU_8 _LCD12864_Sine/display.c create mode 100644 MCU/MCU_8 _LCD12864_Sine/display.h create mode 100644 MCU/MCU_8 _LCD12864_Sine/main.c create mode 100644 MCU/MCU_8 _LCD12864_Sine/main.h diff --git a/MCU/MCU_7 _LCD12864/Listings/MCU_1.m51 b/MCU/MCU_7 _LCD12864/Listings/MCU_1.m51 index 5f08898..0f72377 100644 --- a/MCU/MCU_7 _LCD12864/Listings/MCU_1.m51 +++ b/MCU/MCU_7 _LCD12864/Listings/MCU_1.m51 @@ -1,4 +1,4 @@ -BL51 BANKED LINKER/LOCATER V6.22.2.0 04/27/2022 21:57:02 PAGE 1 +BL51 BANKED LINKER/LOCATER V6.22.2.0 05/05/2022 19:57:48 PAGE 1 BL51 BANKED LINKER/LOCATER V6.22.2.0, INVOKED BY: @@ -14,7 +14,7 @@ INPUT MODULES INCLUDED: .\Objects\delay.obj (DELAY) .\Objects\display.obj (DISPLAY) C:\KEIL_V5\C51\LIB\C51L.LIB (?C_STARTUP) - C:\KEIL_V5\C51\LIB\C51L.LIB (?C?ILDIX) + C:\KEIL_V5\C51\LIB\C51L.LIB (?C?UIDIV) C:\KEIL_V5\C51\LIB\C51L.LIB (?C_INIT) @@ -30,59 +30,60 @@ LINK MAP OF MODULE: .\Objects\MCU_1 (MAIN) * * * * * * * X D A T A M E M O R Y * * * * * * * XDATA 0000H 0060H UNIT ?XD?DISPLAY - XDATA 0060H 000CH UNIT ?XD?MAIN - XDATA 006CH 0008H UNIT _XDATA_GROUP_ - XDATA 0074H 0004H UNIT ?XD?_NAME?DISPLAY + XDATA 0060H 0006H UNIT _XDATA_GROUP_ + XDATA 0066H 0004H UNIT ?XD?MAIN + XDATA 006AH 0004H UNIT ?XD?TEST?DISPLAY * * * * * * * C O D E M E M O R Y * * * * * * * CODE 0000H 0003H ABSOLUTE - CODE 0003H 00DFH UNIT ?PR?MAIN?MAIN - CODE 00E2H 00C5H UNIT ?PR?CLEAR?DISPLAY - CODE 01A7H 008CH UNIT ?C_C51STARTUP - CODE 0233H 0070H UNIT ?C_INITSEG - CODE 02A3H 005FH UNIT ?PR?_NAME?DISPLAY - CODE 0302H 0020H UNIT ?PR?_DELAY?DELAY - CODE 0322H 001CH UNIT ?PR?INIT?DISPLAY - CODE 033EH 001AH UNIT ?PR?SETCONFIG?MAIN - CODE 0358H 0019H UNIT ?PR?WRITE?DISPLAY - CODE 0371H 0016H UNIT ?C?LIB_CODE - CODE 0387H 0014H UNIT ?PR?_WRITEDATA?DISPLAY - CODE 039BH 0014H UNIT ?PR?_WRITECOMMAND?DISPLAY - CODE 03AFH 0013H UNIT ?PR?LCDINIT?DISPLAY - CODE 03C2H 000DH UNIT ?PR?_SETY?DISPLAY - CODE 03CFH 000BH UNIT ?PR?DELAY100US?DELAY - CODE 03DAH 0007H UNIT ?PR?_SETPAGE?DISPLAY - CODE 03E1H 0007H UNIT ?PR?_SETLINE?DISPLAY - CODE 03E8H 0005H UNIT ?PR?SELA?DISPLAY - CODE 03EDH 0005H UNIT ?PR?SELB?DISPLAY + CODE 0003H 0123H UNIT ?PR?_NAME?DISPLAY + CODE 0126H 00D7H UNIT ?PR?CLEAR?DISPLAY + CODE 01FDH 00D7H UNIT ?PR?TEST?DISPLAY + CODE 02D4H 008CH UNIT ?C_C51STARTUP + CODE 0360H 0069H UNIT ?C_INITSEG + CODE 03C9H 0055H UNIT ?C?LIB_CODE + CODE 041EH 003BH UNIT ?PR?MAIN?MAIN + CODE 0459H 0028H UNIT ?PR?WRITE?DISPLAY + CODE 0481H 0020H UNIT ?PR?_DELAY?DELAY + CODE 04A1H 001CH UNIT ?PR?INIT?DISPLAY + CODE 04BDH 000BH UNIT ?PR?DELAY100US?DELAY + CODE 04C8H 0007H UNIT ?PR?_WRITEDATA?DISPLAY + CODE 04CFH 0007H UNIT ?PR?_SETCOMMAND?DISPLAY + CODE 04D6H 0007H UNIT ?PR?_SETPAGE?DISPLAY + CODE 04DDH 0007H UNIT ?PR?_SETLINE?DISPLAY + CODE 04E4H 0007H UNIT ?PR?_SETY?DISPLAY OVERLAY MAP OF MODULE: .\Objects\MCU_1 (MAIN) - BL51 BANKED LINKER/LOCATER V6.22.2.0 04/27/2022 21:57:02 PAGE 2 +SEGMENT XDATA_GROUP + BL51 BANKED LINKER/LOCATER V6.22.2.0 05/05/2022 19:57:48 PAGE 2 -SEGMENT XDATA_GROUP - +--> CALLED SEGMENT START LENGTH -------------------------------------------------- -?C_C51STARTUP ----- ----- + +--> CALLED SEGMENT START LENGTH +----------------------------------------------- +?C_C51STARTUP ----- ----- +--> ?PR?MAIN?MAIN +--> ?C_INITSEG -?PR?MAIN?MAIN 006CH 0004H +?PR?MAIN?MAIN 0060H 0002H +--> ?PR?INIT?DISPLAY +--> ?PR?CLEAR?DISPLAY - +--> ?PR?WRITE?DISPLAY - -?PR?INIT?DISPLAY ----- ----- - +--> ?PR?WRITE?DISPLAY - -?PR?WRITE?DISPLAY ----- ----- + +--> ?PR?_NAME?DISPLAY +--> ?PR?_DELAY?DELAY -?PR?CLEAR?DISPLAY 0070H 0004H +?PR?INIT?DISPLAY ----- ----- + +--> ?PR?WRITE?DISPLAY + +?PR?WRITE?DISPLAY ----- ----- + +--> ?PR?_DELAY?DELAY + +?PR?CLEAR?DISPLAY 0062H 0004H + +--> ?PR?WRITE?DISPLAY + +?PR?_NAME?DISPLAY 0062H 0004H +--> ?PR?WRITE?DISPLAY @@ -98,114 +99,55 @@ SYMBOL TABLE OF MODULE: .\Objects\MCU_1 (MAIN) D:00B0H PUBLIC P3 D:00A8H PUBLIC IE D:00B8H PUBLIC IP - X:0060H PUBLIC TH - X:0062H PUBLIC TL - B:00B0H.0 PUBLIC RS - C:0003H PUBLIC main - C:033EH PUBLIC setConfig - B:00B0H.1 PUBLIC RW - X:0064H PUBLIC count - D:0087H PUBLIC PCON + C:041EH PUBLIC main D:0098H PUBLIC SCON - D:0089H PUBLIC TMOD D:0088H PUBLIC TCON - D:008DH PUBLIC TH1 - D:008BH PUBLIC TL1 - B:00B0H.4 PUBLIC CSA - B:0088H.6 PUBLIC TR1 - B:00B0H.5 PUBLIC CSB D:00C8H PUBLIC T2CON - X:0068H PUBLIC i - X:006AH PUBLIC j + X:0066H PUBLIC i + X:0068H PUBLIC j D:00D0H PUBLIC PSW - ------- PROC SETCONFIG - BL51 BANKED LINKER/LOCATER V6.22.2.0 04/27/2022 21:57:02 PAGE 3 - - - C:033EH LINE# 16 - C:033EH LINE# 17 - C:033EH LINE# 19 - C:0341H LINE# 20 - C:0344H LINE# 21 - C:0347H LINE# 22 - C:034AH LINE# 23 - C:034DH LINE# 24 - C:034FH LINE# 25 - C:0352H LINE# 27 - C:0357H LINE# 29 - ------- ENDPROC SETCONFIG ------- PROC MAIN ------- DO - X:006CH SYMBOL i - X:006EH SYMBOL j + X:0060H SYMBOL line ------- ENDDO - C:0003H LINE# 15 - C:0003H LINE# 16 - C:0003H LINE# 17 - C:0006H LINE# 18 - C:0009H LINE# 20 - C:0009H LINE# 21 - C:0009H LINE# 23 - C:000BH LINE# 24 - C:000DH LINE# 25 - C:0024H LINE# 26 - C:0024H LINE# 27 - C:0026H LINE# 28 - C:0028H LINE# 29 - C:002DH LINE# 30 - C:0030H LINE# 31 - C:0033H LINE# 32 - C:0036H LINE# 34 - C:003DH LINE# 35 - C:003DH LINE# 36 - C:003FH LINE# 37 - C:0041H LINE# 38 - C:0044H LINE# 39 - C:0047H LINE# 40 - C:0064H LINE# 41 - C:0074H LINE# 42 - C:0076H LINE# 43 - C:0078H LINE# 44 - C:0092H LINE# 45 - C:0092H LINE# 46 - C:0094H LINE# 47 - C:0096H LINE# 48 - C:009BH LINE# 49 - C:009EH LINE# 50 - C:00A1H LINE# 51 - C:00A4H LINE# 53 - C:00ABH LINE# 54 - C:00ABH LINE# 55 - C:00ADH LINE# 56 - C:00AFH LINE# 57 - C:00B2H LINE# 58 - BL51 BANKED LINKER/LOCATER V6.22.2.0 04/27/2022 21:57:02 PAGE 4 + C:041EH LINE# 14 + C:041EH LINE# 15 + C:041EH LINE# 16 + C:0421H LINE# 17 + C:0424H LINE# 19 + C:0424H LINE# 20 + C:0424H LINE# 21 + C:042BH LINE# 22 + C:0430H LINE# 23 + BL51 BANKED LINKER/LOCATER V6.22.2.0 05/05/2022 19:57:48 PAGE 3 - C:00B5H LINE# 59 - C:00D2H LINE# 60 + C:043EH LINE# 24 + C:044AH LINE# 25 + C:0450H LINE# 26 + C:0457H LINE# 28 ------- ENDPROC MAIN ------- ENDMOD MAIN ------- MODULE DELAY C:0000H SYMBOL _ICE_DUMMY_ - C:03CFH PUBLIC delay100us - C:0302H PUBLIC _delay + C:04BDH PUBLIC delay100us + C:0481H PUBLIC _delay ------- PROC DELAY100US ------- DO D:0007H SYMBOL i D:0006H SYMBOL j ------- ENDDO - C:03CFH LINE# 3 - C:03CFH LINE# 4 - C:03CFH LINE# 7 - C:03D0H LINE# 8 - C:03D1H LINE# 9 - C:03D3H LINE# 10 - C:03D5H LINE# 12 - C:03D5H LINE# 13 - C:03D7H LINE# 14 - C:03D9H LINE# 15 + C:04BDH LINE# 3 + C:04BDH LINE# 4 + C:04BDH LINE# 7 + C:04BEH LINE# 8 + C:04BFH LINE# 9 + C:04C1H LINE# 10 + C:04C3H LINE# 12 + C:04C3H LINE# 13 + C:04C5H LINE# 14 + C:04C7H LINE# 15 ------- ENDPROC DELAY100US ------- PROC _DELAY D:0006H SYMBOL n @@ -213,11 +155,11 @@ SYMBOL TABLE OF MODULE: .\Objects\MCU_1 (MAIN) D:0006H SYMBOL i D:0004H SYMBOL j ------- ENDDO - C:0302H LINE# 24 - C:0302H LINE# 26 - C:0302H LINE# 27 - C:030DH LINE# 28 - C:0321H LINE# 29 + C:0481H LINE# 24 + C:0481H LINE# 26 + C:0481H LINE# 27 + C:048CH LINE# 28 + C:04A0H LINE# 29 ------- ENDPROC _DELAY ------- ENDMOD DELAY @@ -225,224 +167,288 @@ SYMBOL TABLE OF MODULE: .\Objects\MCU_1 (MAIN) C:0000H SYMBOL _ICE_DUMMY_ D:0090H PUBLIC P1 D:00B0H PUBLIC P3 - C:03E8H PUBLIC selA - C:03EDH PUBLIC selB - C:00E2H PUBLIC clear + C:0126H PUBLIC clear X:0000H PUBLIC Z2 D:00A8H PUBLIC IE + C:04CFH PUBLIC _setCommand D:00B8H PUBLIC IP - C:02A3H PUBLIC _name + C:0003H PUBLIC _name B:00B0H.0 PUBLIC RS - C:03C8H PUBLIC _setY + C:04E4H PUBLIC _setY B:00B0H.1 PUBLIC RW - C:0387H PUBLIC _writeData - C:0361H PUBLIC write + C:04C8H PUBLIC _writeData + C:0471H PUBLIC write D:0098H PUBLIC SCON + BL51 BANKED LINKER/LOCATER V6.22.2.0 05/05/2022 19:57:48 PAGE 4 + + D:0088H PUBLIC TCON - BL51 BANKED LINKER/LOCATER V6.22.2.0 04/27/2022 21:57:02 PAGE 5 - - - C:0322H PUBLIC init + C:04A1H PUBLIC init + C:01FDH PUBLIC test B:00B0H.2 PUBLIC E - C:03AFH PUBLIC lcdInit - C:03DAH PUBLIC _setPage + C:04D6H PUBLIC _setPage B:00B0H.4 PUBLIC CSA B:00B0H.5 PUBLIC CSB - C:03E1H PUBLIC _setLine + C:04DDH PUBLIC _setLine X:0030H PUBLIC Z D:00C8H PUBLIC T2CON - C:039BH PUBLIC _writeCommand D:00D0H PUBLIC PSW - ------- PROC SELA - C:03E8H LINE# 38 - C:03E8H LINE# 39 - C:03E8H LINE# 40 - C:03EAH LINE# 41 - C:03ECH LINE# 42 - ------- ENDPROC SELA - ------- PROC SELB - C:03EDH LINE# 43 - C:03EDH LINE# 44 - C:03EDH LINE# 45 - C:03EFH LINE# 46 - C:03F1H LINE# 47 - ------- ENDPROC SELB + C:046BH SYMBOL L?0060 + ------- PROC L?0059 + ------- ENDPROC L?0059 + C:046BH SYMBOL L?0060 + ------- PROC WRITE + C:0471H LINE# 30 + C:0471H LINE# 31 + C:0471H LINE# 32 + C:0473H LINE# 33 + C:0475H LINE# 34 + C:0477H LINE# 35 + C:047EH LINE# 36 + C:0480H LINE# 37 + ------- ENDPROC WRITE ------- PROC _WRITEDATA D:0007H SYMBOL d - C:0387H LINE# 48 - C:0387H LINE# 49 - C:0387H LINE# 50 - C:0389H LINE# 51 - C:038BH LINE# 52 - C:038DH LINE# 53 - C:038FH LINE# 54 - C:0391H LINE# 55 - C:0398H LINE# 56 - C:039AH LINE# 57 + C:04C8H LINE# 39 + C:04C8H LINE# 40 + C:04C8H LINE# 41 + C:04CAH LINE# 42 + C:04CCH LINE# 43 + C:04CEH LINE# 44 ------- ENDPROC _WRITEDATA - ------- PROC _WRITECOMMAND + ------- PROC _SETCOMMAND D:0007H SYMBOL d - C:039BH LINE# 59 - C:039BH LINE# 60 - C:039BH LINE# 61 - C:039DH LINE# 62 - C:039FH LINE# 63 - C:03A1H LINE# 64 - C:03A3H LINE# 65 - C:03A5H LINE# 66 - C:03ACH LINE# 67 - C:03AEH LINE# 68 - ------- ENDPROC _WRITECOMMAND - ------- PROC LCDINIT - C:03AFH LINE# 70 - C:03AFH LINE# 71 - C:03AFH LINE# 72 - C:03B2H LINE# 73 - C:03B7H LINE# 74 - BL51 BANKED LINKER/LOCATER V6.22.2.0 04/27/2022 21:57:02 PAGE 6 - - - C:03BAH LINE# 75 - C:03BFH LINE# 76 - ------- ENDPROC LCDINIT + C:04CFH LINE# 46 + C:04CFH LINE# 47 + C:04CFH LINE# 48 + C:04D1H LINE# 49 + C:04D3H LINE# 50 + C:04D5H LINE# 51 + ------- ENDPROC _SETCOMMAND ------- PROC _SETPAGE D:0007H SYMBOL p - C:03DAH LINE# 79 - C:03DAH LINE# 80 - C:03DAH LINE# 81 + C:04D6H LINE# 54 + C:04D6H LINE# 55 + C:04D6H LINE# 56 ------- ENDPROC _SETPAGE ------- PROC _SETLINE D:0007H SYMBOL p - C:03E1H LINE# 84 - C:03E1H LINE# 85 - C:03E1H LINE# 86 + C:04DDH LINE# 59 + C:04DDH LINE# 60 + C:04DDH LINE# 61 ------- ENDPROC _SETLINE - ------- PROC L?0032 - ------- ENDPROC L?0032 ------- PROC _SETY D:0007H SYMBOL p - C:03C8H LINE# 89 - C:03C8H LINE# 90 - C:03C8H LINE# 91 + BL51 BANKED LINKER/LOCATER V6.22.2.0 05/05/2022 19:57:48 PAGE 5 + + + C:04E4H LINE# 64 + C:04E4H LINE# 65 + C:04E4H LINE# 66 ------- ENDPROC _SETY ------- PROC _NAME - X:0074H SYMBOL i + X:0062H SYMBOL line ------- DO - X:0076H SYMBOL line + X:0064H SYMBOL j ------- ENDDO - C:02A3H LINE# 94 - C:02ABH LINE# 95 - C:02ABH LINE# 96 - C:02B0H LINE# 97 - C:02BFH LINE# 98 - C:02BFH LINE# 99 - C:02C4H LINE# 100 - C:02C7H LINE# 101 - C:02DCH LINE# 102 - C:02E1H LINE# 103 - C:02E4H LINE# 104 - C:02FFH LINE# 105 - C:0301H LINE# 106 + C:0003H LINE# 69 + C:000BH LINE# 70 + C:000BH LINE# 72 + C:000DH LINE# 73 + C:000FH LINE# 75 + C:0011H LINE# 76 + C:0013H LINE# 77 + C:0016H LINE# 78 + C:0019H LINE# 79 + C:001CH LINE# 80 + C:001FH LINE# 82 + C:0036H LINE# 83 + C:0036H LINE# 84 + C:0036H LINE# 85 + C:0036H LINE# 86 + C:0036H LINE# 87 + C:0039H LINE# 88 + C:0049H LINE# 90 + C:004BH LINE# 91 + C:004DH LINE# 92 + C:0050H LINE# 93 + C:0053H LINE# 94 + C:0056H LINE# 95 + C:0059H LINE# 97 + C:0070H LINE# 98 + C:0070H LINE# 99 + C:0072H LINE# 100 + C:0074H LINE# 101 + C:0082H LINE# 102 + C:0085H LINE# 103 + C:0095H LINE# 105 + C:0097H LINE# 106 + C:0099H LINE# 108 + C:009BH LINE# 109 + C:009DH LINE# 110 + C:00A6H LINE# 111 + C:00A9H LINE# 112 + C:00ACH LINE# 113 + C:00AFH LINE# 115 + C:00C6H LINE# 116 + C:00C6H LINE# 117 + C:00C6H LINE# 118 + C:00C6H LINE# 119 + C:00C6H LINE# 120 + C:00C9H LINE# 121 + C:00D9H LINE# 123 + C:00DBH LINE# 124 + C:00DDH LINE# 125 + BL51 BANKED LINKER/LOCATER V6.22.2.0 05/05/2022 19:57:48 PAGE 6 + + + C:00E0H LINE# 126 + C:00E3H LINE# 127 + C:00E6H LINE# 128 + C:00E9H LINE# 130 + C:0100H LINE# 131 + C:0100H LINE# 132 + C:0102H LINE# 133 + C:0104H LINE# 134 + C:0112H LINE# 135 + C:0115H LINE# 136 + C:0125H LINE# 138 ------- ENDPROC _NAME - ------- PROC L?0031 - ------- ENDPROC L?0031 - ------- PROC WRITE - C:0361H LINE# 109 - C:0361H LINE# 110 - C:0361H LINE# 111 - C:0363H LINE# 112 - C:0365H LINE# 113 - C:0367H LINE# 114 - C:036EH LINE# 115 - C:0370H LINE# 116 - ------- ENDPROC WRITE ------- PROC CLEAR ------- DO - X:0070H SYMBOL i - BL51 BANKED LINKER/LOCATER V6.22.2.0 04/27/2022 21:57:02 PAGE 7 - - - X:0072H SYMBOL j + X:0062H SYMBOL i + X:0064H SYMBOL j ------- ENDDO - C:00E2H LINE# 118 - C:00E2H LINE# 119 - C:00E2H LINE# 121 - C:00E4H LINE# 122 - C:00E6H LINE# 123 - C:00FDH LINE# 124 - C:00FDH LINE# 125 - C:00FDH LINE# 126 - C:00FDH LINE# 127 - C:00FDH LINE# 128 - C:0100H LINE# 129 - C:0103H LINE# 130 - C:0106H LINE# 132 - C:010DH LINE# 133 - C:010DH LINE# 134 - C:010FH LINE# 135 - C:0111H LINE# 136 - C:0114H LINE# 137 - C:0117H LINE# 138 - C:0134H LINE# 139 - C:0144H LINE# 140 - C:0146H LINE# 141 - C:0148H LINE# 142 - C:015FH LINE# 143 - C:015FH LINE# 144 - C:015FH LINE# 145 - C:015FH LINE# 146 - C:015FH LINE# 147 - C:0162H LINE# 148 - C:0165H LINE# 149 - C:0168H LINE# 151 - C:016FH LINE# 152 - C:016FH LINE# 153 - C:0171H LINE# 154 - C:0173H LINE# 155 - C:0176H LINE# 156 - C:0179H LINE# 157 - C:0196H LINE# 158 - C:01A6H LINE# 159 + C:0126H LINE# 141 + C:0126H LINE# 142 + C:0126H LINE# 144 + C:0128H LINE# 145 + C:012AH LINE# 146 + C:0141H LINE# 147 + C:0141H LINE# 148 + C:0143H LINE# 149 + C:0145H LINE# 150 + C:014AH LINE# 151 + C:014DH LINE# 152 + C:0150H LINE# 153 + C:0153H LINE# 155 + C:015AH LINE# 156 + C:015AH LINE# 157 + C:015CH LINE# 158 + C:015EH LINE# 159 + C:0161H LINE# 160 + C:0164H LINE# 161 + C:0181H LINE# 162 + C:0191H LINE# 163 + C:0193H LINE# 164 + C:0195H LINE# 165 + C:01ACH LINE# 166 + C:01ACH LINE# 167 + C:01AEH LINE# 168 + C:01B0H LINE# 169 + C:01B5H LINE# 170 + C:01B8H LINE# 171 + C:01BBH LINE# 172 + C:01BEH LINE# 174 + C:01C5H LINE# 175 + C:01C5H LINE# 176 + C:01C7H LINE# 177 + C:01C9H LINE# 178 + C:01CCH LINE# 179 + C:01CFH LINE# 180 + C:01ECH LINE# 181 + C:01FCH LINE# 182 ------- ENDPROC CLEAR + BL51 BANKED LINKER/LOCATER V6.22.2.0 05/05/2022 19:57:48 PAGE 7 + + ------- PROC INIT - C:0322H LINE# 160 - C:0322H LINE# 161 - C:0322H LINE# 162 - C:0324H LINE# 163 - C:0326H LINE# 164 - C:0328H LINE# 165 - C:032AH LINE# 166 - C:032CH LINE# 167 - C:032FH LINE# 168 - C:0332H LINE# 170 - C:0334H LINE# 171 - C:0336H LINE# 172 - C:0338H LINE# 173 - C:033BH LINE# 174 - BL51 BANKED LINKER/LOCATER V6.22.2.0 04/27/2022 21:57:02 PAGE 8 - - + C:04A1H LINE# 183 + C:04A1H LINE# 184 + C:04A1H LINE# 185 + C:04A3H LINE# 186 + C:04A5H LINE# 187 + C:04A7H LINE# 188 + C:04A9H LINE# 189 + C:04ABH LINE# 190 + C:04AEH LINE# 191 + C:04B1H LINE# 193 + C:04B3H LINE# 194 + C:04B5H LINE# 195 + C:04B7H LINE# 196 + C:04BAH LINE# 197 ------- ENDPROC INIT + ------- PROC TEST + ------- DO + X:006AH SYMBOL i + X:006CH SYMBOL j + ------- ENDDO + C:01FDH LINE# 200 + C:01FDH LINE# 201 + C:01FDH LINE# 203 + C:01FFH LINE# 204 + C:0201H LINE# 205 + C:0218H LINE# 206 + C:0218H LINE# 207 + C:021AH LINE# 208 + C:021CH LINE# 209 + C:0221H LINE# 210 + C:0224H LINE# 211 + C:0227H LINE# 212 + C:022AH LINE# 214 + C:0231H LINE# 215 + C:0231H LINE# 216 + C:0233H LINE# 217 + C:0235H LINE# 218 + C:0238H LINE# 219 + C:023BH LINE# 220 + C:0258H LINE# 221 + C:0268H LINE# 222 + C:026AH LINE# 223 + C:026CH LINE# 224 + C:0283H LINE# 225 + C:0283H LINE# 226 + C:0285H LINE# 227 + C:0287H LINE# 228 + C:028CH LINE# 229 + C:028FH LINE# 230 + C:0292H LINE# 231 + C:0295H LINE# 233 + C:029CH LINE# 234 + C:029CH LINE# 235 + C:029EH LINE# 236 + C:02A0H LINE# 237 + C:02A3H LINE# 238 + BL51 BANKED LINKER/LOCATER V6.22.2.0 05/05/2022 19:57:48 PAGE 8 + + + C:02A6H LINE# 239 + C:02C3H LINE# 240 + C:02D3H LINE# 241 + ------- ENDPROC TEST ------- ENDMOD DISPLAY - ------- MODULE ?C?ILDIX - C:0371H PUBLIC ?C?ILDIX - ------- ENDMOD ?C?ILDIX - -*** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS - SEGMENT: ?PR?SETCONFIG?MAIN + ------- MODULE ?C?UIDIV + C:03C9H PUBLIC ?C?UIDIV + ------- ENDMOD ?C?UIDIV *** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS SEGMENT: ?PR?DELAY100US?DELAY *** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS - SEGMENT: ?PR?LCDINIT?DISPLAY + SEGMENT: ?PR?_WRITEDATA?DISPLAY + +*** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS + SEGMENT: ?PR?_SETPAGE?DISPLAY *** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS SEGMENT: ?PR?_SETLINE?DISPLAY *** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS - SEGMENT: ?PR?_NAME?DISPLAY + SEGMENT: ?PR?_SETY?DISPLAY -Program Size: data=9.0 xdata=120 code=1010 -LINK/LOCATE RUN COMPLETE. 5 WARNING(S), 0 ERROR(S) +*** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS + SEGMENT: ?PR?TEST?DISPLAY + +Program Size: data=9.0 xdata=110 code=1259 +LINK/LOCATE RUN COMPLETE. 6 WARNING(S), 0 ERROR(S) diff --git a/MCU/MCU_7 _LCD12864/display.c b/MCU/MCU_7 _LCD12864/display.c index a624be1..58df999 100644 --- a/MCU/MCU_7 _LCD12864/display.c +++ b/MCU/MCU_7 _LCD12864/display.c @@ -15,16 +15,8 @@ sbit CSB = P3 ^ 5; const unsigned char Z[] = { - /*-- ÎÄ×Ö: ½­ --*/ - /*-- ËÎÌå12; ´Ë×ÖÌå϶ÔÓ¦µÄµãÕóΪ£º¿íx¸ß=16x16 --*/ 0x10, 0x60, 0x02, 0x0C, 0xC0, 0x04, 0x04, 0x04, 0x04, 0xFC, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00, - - /*-- ÎÄ×Ö: Ò» --*/ - /*-- ËÎÌå12; ´Ë×ÖÌå϶ÔÓ¦µÄµãÕóΪ£º¿íx¸ß=16x16 --*/ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, - - /*-- ÎÄ×Ö: ºÍ --*/ - /*-- ËÎÌå12; ´Ë×ÖÌå϶ÔÓ¦µÄµãÕóΪ£º¿íx¸ß=16x16 --*/ 0x20, 0x24, 0x24, 0xA4, 0xFE, 0x23, 0x22, 0x20, 0x00, 0xF8, 0x08, 0x08, 0x08, 0xF8, 0x00, 0x00, }; @@ -35,86 +27,117 @@ const unsigned char Z2[] = 0x10, 0x08, 0x06, 0x01, 0xFF, 0x01, 0x06, 0x00, 0x00, 0x3F, 0x10, 0x10, 0x10, 0x3F, 0x00, 0x00 }; -void selA() -{ - CSA = 1; - CSB = 0; -} -void selB() -{ - CSA = 0; - CSB = 1; -} -void writeData(unsigned char d) -{ - RS = 1; - RW = 0; - P1 = d; - E = 0; - E = 1; - delay(3); - E = 0; -} - -void writeCommand(unsigned char d) -{ - RS = 0; - RW = 0; - P1 = d; - E = 0; - E = 1; - delay(3); - E = 0; -} - -void lcdInit() -{ - selA(); - writeCommand(0x3f); - selB(); - writeCommand(0x3f); - selA(); -} - -void setPage(unsigned char p) -{ - writeCommand(0xb8 + p); -} - -void setLine(unsigned char p) -{ - writeCommand(0xc0 + p); -} - -void setY(unsigned char p) -{ - writeCommand(0x40 + p); -} - -void name(unsigned int i) -{ - unsigned int line = 0; - while(line < 48) - { - setPage(0); - setY(i); - writeData(Z[line]); - setPage(1); - setY(i); - writeData(Z2[line++]); - } -} - - void write() { - RW = 0; + RW=0; E = 0; E = 1; delay(2); E = 0; } +void writeData(unsigned char d) +{ + RS = 1; + RW = 0; + P1 = d; +} + +void setCommand(unsigned char d) +{ + RS = 0; + RW = 0; + P1 = d; +} + + +void setPage(unsigned char p) +{ + setCommand(0xb8 + p); +} + +void setLine(unsigned char p) +{ + setCommand(0xc0 + p); +} + +void setY(unsigned char p) +{ + setCommand(0x40 + p); +} + +void name(unsigned int line) +{ + unsigned int j; + CSA = 1; + CSB = 0; + + RS = 0; + RW = 0; + P1 = 0xb8 + 0; + write(); + P1 = 0X40; + write(); + + for(j=0; j < 48; j++) + { + RS = 1; + RW = 0; + P1 = Z[j%48]; + write(); + } + + RS = 0; + RW = 0; + P1 = 0xb8 + 1; + write(); + P1 = 0X40; + write(); + + for(j=0; j < 48; j++) + { + RS = 1; + RW = 0; + P1 = Z2[j%48]; + write(); + } + + CSA = 0; + CSB = 1; + + RS = 0; + RW = 0; + P1 = 0xb8 + line; + write(); + P1 = 0X40; + write(); + + for(j=0; j < 48; j++) + { + RS = 1; + RW = 0; + P1 = Z[j%48]; + write(); + } + + RS = 0; + RW = 0; + P1 = 0xb8 + 1; + write(); + P1 = 0X40; + write(); + + for(j=0; j < 48; j++) + { + RS = 1; + RW = 0; + P1 = Z2[j%48]; + write(); + } + +} + + void clear() { unsigned int i, j; @@ -152,7 +175,7 @@ void clear() { RS = 1; RW = 0; - P1 = 0x00;; + P1 = 0x00; write(); } } @@ -160,7 +183,7 @@ void clear() void init() { E = 0; - RS = 1; + RS=1; CSA = 1; CSB = 0; RS = 0; @@ -172,4 +195,47 @@ void init() RS = 0; P1 = 0XFF; write(); +} + +void test() +{ + unsigned int i, j; + CSA = 1; + CSB = 0; + for(i = 0; i < 8; i++) + { + RS = 0; + RW = 0; + P1 = 0xb8 + i; + write(); + P1 = 0X40; + write(); + + for(j = 0; j < 64; j++) + { + RS = 1; + RW = 0; + P1 = 0x55; + write(); + } + } + CSA = 0; + CSB = 1; + for(i = 0; i < 8; i++) + { + RS = 0; + RW = 0; + P1 = 0xb8 + i; + write(); + P1 = 0X40; + write(); + + for(j = 0; j < 64; j++) + { + RS = 1; + RW = 0; + P1 = 0x55;; + write(); + } + } } \ No newline at end of file diff --git a/MCU/MCU_7 _LCD12864/display.h b/MCU/MCU_7 _LCD12864/display.h index 78dcd95..b8ef580 100644 --- a/MCU/MCU_7 _LCD12864/display.h +++ b/MCU/MCU_7 _LCD12864/display.h @@ -1,16 +1,16 @@ #ifndef _DISPLAY_H_ #define _DISPLAY_H_ -void writeData(unsigned char d); -void writeCommand(unsigned char d); +void setData(unsigned char d); +void setCommand(unsigned char d); void lcdInit(); void setPage(unsigned char p); void setPage(unsigned char p); void setLine(unsigned char p); void setY(unsigned char p); -void selA(); -void selB(); +void test(); void init(); void clear(); void name(unsigned int i); +void write(); #endif \ No newline at end of file diff --git a/MCU/MCU_7 _LCD12864/main.c b/MCU/MCU_7 _LCD12864/main.c index a2d40d0..6c9c35c 100644 --- a/MCU/MCU_7 _LCD12864/main.c +++ b/MCU/MCU_7 _LCD12864/main.c @@ -7,6 +7,7 @@ sbit RW = P3 ^ 1; sbit E = P3 ^ 2; sbit CSA = P3 ^ 4; sbit CSB = P3 ^ 5; + unsigned int i; unsigned int j; @@ -17,44 +18,12 @@ int main() while(1) { - unsigned int i, j; - CSA = 1; - CSB = 0; - for(i = 0; i < 8; i++) - { - RS = 0; - RW = 0; - P1 = 0xb8 + i; - write(); - P1 = 0X40; - write(); - - for(j = 0; j < 64; j++) - { - RS = 1; - RW = 0; - P1 = 0x55; - write(); - } - } - CSA = 0; - CSB = 1; - for(i = 0; i < 8; i++) - { - RS = 0; - RW = 0; - P1 = 0xb8 + i; - write(); - P1 = 0X40; - write(); - - for(j = 0; j < 64; j++) - { - RS = 1; - RW = 0; - P1 = 0x55;; - write(); - } - } + unsigned int line=0; + name(line); + line++; + if(line==64) + line=0; + delay(500); + } } \ No newline at end of file diff --git a/MCU/MCU_7 _LCD12864/main.h b/MCU/MCU_7 _LCD12864/main.h index f378913..2656732 100644 --- a/MCU/MCU_7 _LCD12864/main.h +++ b/MCU/MCU_7 _LCD12864/main.h @@ -6,28 +6,6 @@ #include #include "display.h" -#define RELOAD (5000) - -unsigned int TH, TL; - - -unsigned long int count = 0; - -void setConfig() -{ - - SCON=0X50; - TMOD=0X20; - PCON=0X80; - TH1 = 0XFA; - TL1 = 0XFA; - TR1=1; - SCON=0X50; - - XBYTE[0x8000]=0x00; - -} - #endif \ No newline at end of file diff --git a/MCU/MCU_8 _LCD12864_Sine/Listings/MCU_1.m51 b/MCU/MCU_8 _LCD12864_Sine/Listings/MCU_1.m51 new file mode 100644 index 0000000..b4eefb7 --- /dev/null +++ b/MCU/MCU_8 _LCD12864_Sine/Listings/MCU_1.m51 @@ -0,0 +1,410 @@ +BL51 BANKED LINKER/LOCATER V6.22.2.0 05/05/2022 20:23:01 PAGE 1 + + +BL51 BANKED LINKER/LOCATER V6.22.2.0, INVOKED BY: +C:\KEIL_V5\C51\BIN\BL51.EXE .\Objects\main.obj, .\Objects\delay.obj, .\Objects\display.obj TO .\Objects\MCU_1 PRINT (.\L +>> istings\MCU_1.m51) + + +MEMORY MODEL: LARGE + + +INPUT MODULES INCLUDED: + .\Objects\main.obj (MAIN) + .\Objects\delay.obj (DELAY) + .\Objects\display.obj (DISPLAY) + C:\KEIL_V5\C51\LIB\C51L.LIB (?C_STARTUP) + C:\KEIL_V5\C51\LIB\C51L.LIB (?C_INIT) + + +LINK MAP OF MODULE: .\Objects\MCU_1 (MAIN) + + + TYPE BASE LENGTH RELOCATION SEGMENT NAME + ----------------------------------------------------- + + * * * * * * * D A T A M E M O R Y * * * * * * * + REG 0000H 0008H ABSOLUTE "REG BANK 0" + IDATA 0008H 0001H UNIT ?STACK + + * * * * * * * X D A T A M E M O R Y * * * * * * * + XDATA 0000H 0080H UNIT ?XD?DISPLAY + XDATA 0080H 0004H UNIT ?XD?MAIN + XDATA 0084H 0004H UNIT ?XD?TEST?DISPLAY + XDATA 0088H 0004H UNIT _XDATA_GROUP_ + + * * * * * * * C O D E M E M O R Y * * * * * * * + CODE 0000H 0003H ABSOLUTE + CODE 0003H 00EDH UNIT ?PR?DRAW?DISPLAY + CODE 00F0H 00C5H UNIT ?PR?CLEAR?DISPLAY + CODE 01B5H 00C5H UNIT ?PR?TEST?DISPLAY + CODE 027AH 008CH UNIT ?C_C51STARTUP + CODE 0306H 0085H UNIT ?C_INITSEG + CODE 038BH 0020H UNIT ?PR?_DELAY?DELAY + CODE 03ABH 001CH UNIT ?PR?INIT?DISPLAY + CODE 03C7H 0019H UNIT ?PR?WRITE?DISPLAY + CODE 03E0H 000BH UNIT ?PR?MAIN?MAIN + CODE 03EBH 000BH UNIT ?PR?DELAY100US?DELAY + CODE 03F6H 0007H UNIT ?PR?_WRITEDATA?DISPLAY + CODE 03FDH 0007H UNIT ?PR?_SETCOMMAND?DISPLAY + CODE 0404H 0007H UNIT ?PR?_SETPAGE?DISPLAY + CODE 040BH 0007H UNIT ?PR?_SETLINE?DISPLAY + CODE 0412H 0007H UNIT ?PR?_SETY?DISPLAY + + + +OVERLAY MAP OF MODULE: .\Objects\MCU_1 (MAIN) + + +SEGMENT XDATA_GROUP + +--> CALLED SEGMENT START LENGTH +----------------------------------------------- + BL51 BANKED LINKER/LOCATER V6.22.2.0 05/05/2022 20:23:01 PAGE 2 + + +?C_C51STARTUP ----- ----- + +--> ?PR?MAIN?MAIN + +--> ?C_INITSEG + +?PR?MAIN?MAIN ----- ----- + +--> ?PR?INIT?DISPLAY + +--> ?PR?CLEAR?DISPLAY + +--> ?PR?DRAW?DISPLAY + +?PR?INIT?DISPLAY ----- ----- + +--> ?PR?WRITE?DISPLAY + +?PR?WRITE?DISPLAY ----- ----- + +--> ?PR?_DELAY?DELAY + +?PR?CLEAR?DISPLAY 0088H 0004H + +--> ?PR?WRITE?DISPLAY + +?PR?DRAW?DISPLAY 0088H 0002H + +--> ?PR?WRITE?DISPLAY + + + +SYMBOL TABLE OF MODULE: .\Objects\MCU_1 (MAIN) + + VALUE TYPE NAME + ---------------------------------- + + ------- MODULE MAIN + C:0000H SYMBOL _ICE_DUMMY_ + D:0090H PUBLIC P1 + D:00B0H PUBLIC P3 + D:00A8H PUBLIC IE + D:00B8H PUBLIC IP + C:03E0H PUBLIC main + D:0098H PUBLIC SCON + D:0088H PUBLIC TCON + D:00C8H PUBLIC T2CON + X:0080H PUBLIC i + X:0082H PUBLIC j + D:00D0H PUBLIC PSW + ------- PROC MAIN + C:03E0H LINE# 14 + C:03E0H LINE# 15 + C:03E0H LINE# 16 + C:03E3H LINE# 17 + C:03E6H LINE# 19 + C:03E6H LINE# 20 + C:03E6H LINE# 21 + C:03E9H LINE# 23 + ------- ENDPROC MAIN + ------- ENDMOD MAIN + + ------- MODULE DELAY + C:0000H SYMBOL _ICE_DUMMY_ + C:03EBH PUBLIC delay100us + C:038BH PUBLIC _delay + BL51 BANKED LINKER/LOCATER V6.22.2.0 05/05/2022 20:23:01 PAGE 3 + + + ------- PROC DELAY100US + ------- DO + D:0007H SYMBOL i + D:0006H SYMBOL j + ------- ENDDO + C:03EBH LINE# 3 + C:03EBH LINE# 4 + C:03EBH LINE# 7 + C:03ECH LINE# 8 + C:03EDH LINE# 9 + C:03EFH LINE# 10 + C:03F1H LINE# 12 + C:03F1H LINE# 13 + C:03F3H LINE# 14 + C:03F5H LINE# 15 + ------- ENDPROC DELAY100US + ------- PROC _DELAY + D:0006H SYMBOL n + ------- DO + D:0006H SYMBOL i + D:0004H SYMBOL j + ------- ENDDO + C:038BH LINE# 24 + C:038BH LINE# 26 + C:038BH LINE# 27 + C:0396H LINE# 28 + C:03AAH LINE# 29 + ------- ENDPROC _DELAY + ------- ENDMOD DELAY + + ------- MODULE DISPLAY + C:0000H SYMBOL _ICE_DUMMY_ + D:0090H PUBLIC P1 + D:00B0H PUBLIC P3 + C:00F0H PUBLIC clear + D:00A8H PUBLIC IE + C:03FDH PUBLIC _setCommand + D:00B8H PUBLIC IP + B:00B0H.0 PUBLIC RS + C:0412H PUBLIC _setY + B:00B0H.1 PUBLIC RW + C:03F6H PUBLIC _writeData + C:03D0H PUBLIC write + C:0003H PUBLIC draw + X:0000H PUBLIC sine + D:0098H PUBLIC SCON + D:0088H PUBLIC TCON + C:03ABH PUBLIC init + C:01B5H PUBLIC test + B:00B0H.2 PUBLIC E + C:0404H PUBLIC _setPage + B:00B0H.4 PUBLIC CSA + B:00B0H.5 PUBLIC CSB + C:040BH PUBLIC _setLine + D:00C8H PUBLIC T2CON + D:00D0H PUBLIC PSW + C:03C7H SYMBOL L?0056 + BL51 BANKED LINKER/LOCATER V6.22.2.0 05/05/2022 20:23:01 PAGE 4 + + + C:03CCH SYMBOL L?0057 + ------- PROC L?0055 + ------- ENDPROC L?0055 + C:03C7H SYMBOL L?0056 + C:03CCH SYMBOL L?0057 + ------- PROC WRITE + C:03D0H LINE# 18 + C:03D0H LINE# 19 + C:03D0H LINE# 20 + C:03D2H LINE# 21 + C:03D4H LINE# 22 + C:03D6H LINE# 23 + C:03DDH LINE# 24 + C:03DFH LINE# 25 + ------- ENDPROC WRITE + ------- PROC DRAW + ------- DO + X:0088H SYMBOL j + ------- ENDDO + C:0003H LINE# 27 + C:0003H LINE# 28 + C:0003H LINE# 30 + C:0005H LINE# 31 + C:0007H LINE# 33 + C:001EH LINE# 34 + C:001EH LINE# 36 + C:0020H LINE# 37 + C:0022H LINE# 38 + C:0033H LINE# 39 + C:0036H LINE# 40 + C:003FH LINE# 41 + C:0042H LINE# 42 + C:0044H LINE# 43 + C:0046H LINE# 44 + C:0066H LINE# 45 + C:0069H LINE# 46 + C:0079H LINE# 48 + C:007BH LINE# 49 + C:007DH LINE# 50 + C:0094H LINE# 51 + C:0094H LINE# 53 + C:0096H LINE# 54 + C:0098H LINE# 55 + C:00A9H LINE# 56 + C:00ACH LINE# 57 + C:00B5H LINE# 58 + C:00B8H LINE# 61 + C:00BAH LINE# 62 + C:00BCH LINE# 63 + C:00DCH LINE# 64 + C:00DFH LINE# 65 + C:00EFH LINE# 66 + ------- ENDPROC DRAW + ------- PROC CLEAR + ------- DO + X:0088H SYMBOL i + X:008AH SYMBOL j + BL51 BANKED LINKER/LOCATER V6.22.2.0 05/05/2022 20:23:01 PAGE 5 + + + ------- ENDDO + C:00F0H LINE# 69 + C:00F0H LINE# 70 + C:00F0H LINE# 72 + C:00F2H LINE# 73 + C:00F4H LINE# 74 + C:010BH LINE# 75 + C:010BH LINE# 76 + C:010BH LINE# 77 + C:010BH LINE# 78 + C:010BH LINE# 79 + C:010EH LINE# 80 + C:0111H LINE# 81 + C:0114H LINE# 83 + C:011BH LINE# 84 + C:011BH LINE# 85 + C:011DH LINE# 86 + C:011FH LINE# 87 + C:0122H LINE# 88 + C:0125H LINE# 89 + C:0142H LINE# 90 + C:0152H LINE# 91 + C:0154H LINE# 92 + C:0156H LINE# 93 + C:016DH LINE# 94 + C:016DH LINE# 95 + C:016DH LINE# 96 + C:016DH LINE# 97 + C:016DH LINE# 98 + C:0170H LINE# 99 + C:0173H LINE# 100 + C:0176H LINE# 102 + C:017DH LINE# 103 + C:017DH LINE# 104 + C:017FH LINE# 105 + C:0181H LINE# 106 + C:0184H LINE# 107 + C:0187H LINE# 108 + C:01A4H LINE# 109 + C:01B4H LINE# 110 + ------- ENDPROC CLEAR + ------- PROC INIT + C:03ABH LINE# 111 + C:03ABH LINE# 112 + C:03ABH LINE# 113 + C:03ADH LINE# 114 + C:03AFH LINE# 115 + C:03B1H LINE# 116 + C:03B3H LINE# 117 + C:03B5H LINE# 118 + C:03B8H LINE# 119 + C:03BBH LINE# 121 + C:03BDH LINE# 122 + C:03BFH LINE# 123 + C:03C1H LINE# 124 + C:03C4H LINE# 125 + ------- ENDPROC INIT + BL51 BANKED LINKER/LOCATER V6.22.2.0 05/05/2022 20:23:01 PAGE 6 + + + ------- PROC TEST + ------- DO + X:0084H SYMBOL i + X:0086H SYMBOL j + ------- ENDDO + C:01B5H LINE# 128 + C:01B5H LINE# 129 + C:01B5H LINE# 131 + C:01B7H LINE# 132 + C:01B9H LINE# 133 + C:01D0H LINE# 134 + C:01D0H LINE# 135 + C:01D0H LINE# 136 + C:01D0H LINE# 137 + C:01D0H LINE# 138 + C:01D3H LINE# 139 + C:01D6H LINE# 140 + C:01D9H LINE# 142 + C:01E0H LINE# 143 + C:01E0H LINE# 144 + C:01E2H LINE# 145 + C:01E4H LINE# 146 + C:01E7H LINE# 147 + C:01EAH LINE# 148 + C:0207H LINE# 149 + C:0217H LINE# 150 + C:0219H LINE# 151 + C:021BH LINE# 152 + C:0232H LINE# 153 + C:0232H LINE# 154 + C:0232H LINE# 155 + C:0232H LINE# 156 + C:0232H LINE# 157 + C:0235H LINE# 158 + C:0238H LINE# 159 + C:023BH LINE# 161 + C:0242H LINE# 162 + C:0242H LINE# 163 + C:0244H LINE# 164 + C:0246H LINE# 165 + C:0249H LINE# 166 + C:024CH LINE# 167 + C:0269H LINE# 168 + C:0279H LINE# 169 + ------- ENDPROC TEST + ------- PROC _WRITEDATA + D:0007H SYMBOL d + C:03F6H LINE# 172 + C:03F6H LINE# 173 + C:03F6H LINE# 174 + C:03F8H LINE# 175 + C:03FAH LINE# 176 + C:03FCH LINE# 177 + ------- ENDPROC _WRITEDATA + ------- PROC _SETCOMMAND + D:0007H SYMBOL d + C:03FDH LINE# 179 + BL51 BANKED LINKER/LOCATER V6.22.2.0 05/05/2022 20:23:01 PAGE 7 + + + C:03FDH LINE# 180 + C:03FDH LINE# 181 + C:03FFH LINE# 182 + C:0401H LINE# 183 + C:0403H LINE# 184 + ------- ENDPROC _SETCOMMAND + ------- PROC _SETPAGE + D:0007H SYMBOL p + C:0404H LINE# 187 + C:0404H LINE# 188 + C:0404H LINE# 189 + ------- ENDPROC _SETPAGE + ------- PROC _SETLINE + D:0007H SYMBOL p + C:040BH LINE# 192 + C:040BH LINE# 193 + C:040BH LINE# 194 + ------- ENDPROC _SETLINE + ------- PROC _SETY + D:0007H SYMBOL p + C:0412H LINE# 197 + C:0412H LINE# 198 + C:0412H LINE# 199 + ------- ENDPROC _SETY + ------- ENDMOD DISPLAY + +*** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS + SEGMENT: ?PR?DELAY100US?DELAY + +*** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS + SEGMENT: ?PR?TEST?DISPLAY + +*** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS + SEGMENT: ?PR?_WRITEDATA?DISPLAY + +*** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS + SEGMENT: ?PR?_SETPAGE?DISPLAY + +*** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS + SEGMENT: ?PR?_SETLINE?DISPLAY + +*** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS + SEGMENT: ?PR?_SETY?DISPLAY + +Program Size: data=9.0 xdata=140 code=1049 +LINK/LOCATE RUN COMPLETE. 6 WARNING(S), 0 ERROR(S) diff --git a/MCU/MCU_8 _LCD12864_Sine/MCU_1.uvopt b/MCU/MCU_8 _LCD12864_Sine/MCU_1.uvopt new file mode 100644 index 0000000..9324ee6 --- /dev/null +++ b/MCU/MCU_8 _LCD12864_Sine/MCU_1.uvopt @@ -0,0 +1,265 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj; *.o + *.lib + *.txt; *.h; *.inc; *.md + *.plm + *.cpp + 0 + + + + 0 + 0 + + + + MCU_1 + 0x0 + MCS-51 + + 24000000 + + 1 + 1 + 1 + 0 + 0 + + + 0 + 65535 + 0 + 0 + 0 + + + 120 + 65 + 8 + .\Listings\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 255 + + + 0 + Data Sheet + DATASHTS\ATMEL\AT89C51_DS.PDF + + + 1 + Instruction Set Manual + DATASHTS\ATMEL\AT_C51ISM.PDF + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + + + + + + + + + + + BIN\MON51.DLL + + + + 0 + DLGTP51 + (98=-1,-1,-1,-1,0)(82=-1,-1,-1,-1,0)(83=-1,-1,-1,-1,0)(84=-1,-1,-1,-1,0)(85=-1,-1,-1,-1,0)(80=-1,-1,-1,-1,0)(91=-1,-1,-1,-1,0)(92=-1,-1,-1,-1,0) + + + 0 + MON51 + -S2 -B115200 -O15 + + + + + 0 + + + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + 0 + 0 + 0 + + + + + + + + + + + + + SRC + 1 + 0 + 0 + 0 + + 1 + 1 + 1 + 1 + 0 + 0 + .\main.c + main.c + 0 + 0 + + + + + INC + 1 + 0 + 0 + 0 + + 2 + 2 + 1 + 0 + 0 + 0 + .\delay.c + delay.c + 0 + 0 + + + 2 + 3 + 5 + 0 + 0 + 0 + .\main.h + main.h + 0 + 0 + + + 2 + 4 + 1 + 0 + 0 + 0 + .\display.c + display.c + 0 + 0 + + + 2 + 5 + 5 + 0 + 0 + 0 + .\display.h + display.h + 0 + 0 + + + +
diff --git a/MCU/MCU_8 _LCD12864_Sine/MCU_1.uvproj b/MCU/MCU_8 _LCD12864_Sine/MCU_1.uvproj new file mode 100644 index 0000000..8119447 --- /dev/null +++ b/MCU/MCU_8 _LCD12864_Sine/MCU_1.uvproj @@ -0,0 +1,415 @@ + + + + 1.1 + +
### uVision Project, (C) Keil Software
+ + + + MCU_1 + 0x0 + MCS-51 + 0 + + + AT89C51 + Microchip + IRAM(0-0x7F) IROM(0-0xFFF) CLOCK(24000000) + + "LIB\STARTUP.A51" ("Standard 8051 Startup Code") + + 2976 + REGX51.H + + + + + + + + + + + 0 + 0 + + + + Atmel\ + Atmel\ + + 0 + 0 + 0 + 0 + 1 + + .\Objects\ + MCU_1 + 1 + 0 + 1 + 1 + 1 + .\Listings\ + 0 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + 65535 + + + S8051.DLL + + DP51.DLL + -p51 + S8051.DLL + + TP51.DLL + -p51 + + + + 0 + 0 + 0 + 0 + 16 + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + + + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 1 + + 0 + 0 + + + + + + + + + + + + + + BIN\MON51.DLL + + + + + 0 + 0 + 0 + 0 + 0 + -1 + + 0 + + "" () + + + + + 0 + + + + 2 + 0 + 2 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + 0 + 0x0 + 0xffff + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x1000 + + + 0 + 0x0 + 0x80 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + + + 0 + 0 + 1 + 0 + 1 + 3 + 8 + 2 + 1 + 1 + 0 + 0 + + + + + ..\MCU + + + + 0 + 1 + 0 + 0 + + + + + + + + + 0 + 0 + 1 + 0 + 2 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + SRC + + + main.c + 1 + .\main.c + + + + + INC + + + delay.c + 1 + .\delay.c + + + main.h + 5 + .\main.h + + + display.c + 1 + .\display.c + + + display.h + 5 + .\display.h + + + + + + + +
diff --git a/MCU/MCU_8 _LCD12864_Sine/delay.c b/MCU/MCU_8 _LCD12864_Sine/delay.c new file mode 100644 index 0000000..e0c3247 --- /dev/null +++ b/MCU/MCU_8 _LCD12864_Sine/delay.c @@ -0,0 +1,29 @@ +#include "delay.h" +#include +void delay100us() +{ + unsigned char i, j; + + _nop_(); + _nop_(); + i = 2; + j = 15; + do + { + while (--j); + } while (--i); +} + +//void delay(int i) +//{ +// int j = i; +// for(;j>0;j--) +// delay100us(); +//} + +void delay(int n) + +{int i, j; + for(i=n;i>0;i--) + for(j = 28; j > 0; j--); +} \ No newline at end of file diff --git a/MCU/MCU_8 _LCD12864_Sine/delay.h b/MCU/MCU_8 _LCD12864_Sine/delay.h new file mode 100644 index 0000000..da40b5c --- /dev/null +++ b/MCU/MCU_8 _LCD12864_Sine/delay.h @@ -0,0 +1,7 @@ +#ifndef _DELAY_H_ +#define _DELAY_H_ + + +void delay(int i); +void delay100us(); +#endif \ No newline at end of file diff --git a/MCU/MCU_8 _LCD12864_Sine/display.c b/MCU/MCU_8 _LCD12864_Sine/display.c new file mode 100644 index 0000000..5a9cb8f --- /dev/null +++ b/MCU/MCU_8 _LCD12864_Sine/display.c @@ -0,0 +1,200 @@ +#include +#include "display.h" +#include "delay.h" + + +// DB P1 +// CTL P3 + +sbit RS = P3 ^ 0; +sbit RW = P3 ^ 1; +sbit E = P3 ^ 2; +sbit CSA = P3 ^ 4; +sbit CSB = P3 ^ 5; + + +unsigned char sine[] = {32,33,34,36,37,39,40,42,43,44,46,47,48,49,51,52,53,54,55,56,56,57,58,59,59,60,60,61,61,61,61,61,61,61,61,61,61,61,60,60,59,59,58,57,56,56,55,54,53,52,51,49,48,47,46,44,43,42,40,39,37,36,34,33,32,30,29,27,26,24,23,21,20,19,17,16,15,14,12,11,10,9,8,7,7,6,5,4,4,3,3,2,2,2,2,2,2,2,2,2,2,2,3,3,4,4,5,6,7,7,8,9,10,11,12,14,15,16,17,19,20,21,23,24,26,27,29,30}; + +void write() +{ + RW = 0; + E = 0; + E = 1; + delay(2); + E = 0; +} + +void draw() +{ + unsigned int j; + CSA = 1; + CSB = 0; + + for(j = 0; j < 64; j++) + { + + RS = 0; + RW = 0; + P1 = 0xb8 + (sine[j] / 8); //页 + write(); + P1 = 0X40 + j; //Y + write(); + RS = 1; + RW = 0; + P1 = 1<<(sine[j] % 8); + write(); + } + + CSA = 0; + CSB = 1; + for(j = 0; j < 64; j++) + { + + RS = 0; + RW = 0; + P1 = 0xb8 + sine[63 + j] / 8; //页 + write(); + P1 = 0X40 + j; //Y + write(); + + + RS = 1; + RW = 0; + P1 = 1<<(sine[j] % 8); + write(); + } +} + + +void clear() +{ + unsigned int i, j; + CSA = 1; + CSB = 0; + for(i = 0; i < 8; i++) + { + RS = 0; + RW = 0; + P1 = 0xb8 + i; + write(); + P1 = 0X40; + write(); + + for(j = 0; j < 64; j++) + { + RS = 1; + RW = 0; + P1 = 0x00;; + write(); + } + } + CSA = 0; + CSB = 1; + for(i = 0; i < 8; i++) + { + RS = 0; + RW = 0; + P1 = 0xb8 + i; + write(); + P1 = 0X40; + write(); + + for(j = 0; j < 64; j++) + { + RS = 1; + RW = 0; + P1 = 0x00; + write(); + } + } +} +void init() +{ + E = 0; + RS = 1; + CSA = 1; + CSB = 0; + RS = 0; + P1 = 0X3F; + write(); + + CSA = 0; + CSB = 1; + RS = 0; + P1 = 0XFF; + write(); +} + +void test() +{ + unsigned int i, j; + CSA = 1; + CSB = 0; + for(i = 0; i < 8; i++) + { + RS = 0; + RW = 0; + P1 = 0xb8 + i; + write(); + P1 = 0X40; + write(); + + for(j = 0; j < 64; j++) + { + RS = 1; + RW = 0; + P1 = 0x55; + write(); + } + } + CSA = 0; + CSB = 1; + for(i = 0; i < 8; i++) + { + RS = 0; + RW = 0; + P1 = 0xb8 + i; + write(); + P1 = 0X40; + write(); + + for(j = 0; j < 64; j++) + { + RS = 1; + RW = 0; + P1 = 0x55;; + write(); + } + } +} + + +void writeData(unsigned char d) +{ + RS = 1; + RW = 0; + P1 = d; +} + +void setCommand(unsigned char d) +{ + RS = 0; + RW = 0; + P1 = d; +} + + +void setPage(unsigned char p) +{ + setCommand(0xb8 + p); +} + +void setLine(unsigned char p) +{ + setCommand(0xc0 + p); +} + +void setY(unsigned char p) +{ + setCommand(0x40 + p); +} \ No newline at end of file diff --git a/MCU/MCU_8 _LCD12864_Sine/display.h b/MCU/MCU_8 _LCD12864_Sine/display.h new file mode 100644 index 0000000..1532e04 --- /dev/null +++ b/MCU/MCU_8 _LCD12864_Sine/display.h @@ -0,0 +1,17 @@ +#ifndef _DISPLAY_H_ +#define _DISPLAY_H_ + +void setData(unsigned char d); +void setCommand(unsigned char d); +void lcdInit(); +void setPage(unsigned char p); +void setPage(unsigned char p); +void setLine(unsigned char p); +void setY(unsigned char p); +void test(); +void init(); +void clear(); +void name(unsigned int i); +void write(); +void draw(); +#endif \ No newline at end of file diff --git a/MCU/MCU_8 _LCD12864_Sine/main.c b/MCU/MCU_8 _LCD12864_Sine/main.c new file mode 100644 index 0000000..cade45d --- /dev/null +++ b/MCU/MCU_8 _LCD12864_Sine/main.c @@ -0,0 +1,24 @@ +#include "delay.h" +#include "main.h" +#include "display.h" + +sbit RS = P3 ^ 0; +sbit RW = P3 ^ 1; +sbit E = P3 ^ 2; +sbit CSA = P3 ^ 4; +sbit CSB = P3 ^ 5; + +unsigned int i; +unsigned int j; + +int main() +{ + init(); + clear(); + + while(1) + { + draw(); + + } +} \ No newline at end of file diff --git a/MCU/MCU_8 _LCD12864_Sine/main.h b/MCU/MCU_8 _LCD12864_Sine/main.h new file mode 100644 index 0000000..2656732 --- /dev/null +++ b/MCU/MCU_8 _LCD12864_Sine/main.h @@ -0,0 +1,11 @@ +#ifndef _MAIN_H_ +#define _MAIN_H_ + +#include +#include +#include +#include "display.h" + + + +#endif \ No newline at end of file