📄 sed1335_8080.lst
字号:
C51 COMPILER V7.50 SED1335_8080 10/02/2007 11:20:50 PAGE 1
C51 COMPILER V7.50, COMPILATION OF MODULE SED1335_8080
OBJECT MODULE PLACED IN .\sed1335_8080.obj
COMPILER INVOKED BY: D:\Program Files\Keil\C51\BIN\C51.EXE D:\LCD PROG\sed1335_8080.c BROWSE DEBUG OBJECTEXTEND PRINT(.\
-sed1335_8080.lst) OBJECT(.\sed1335_8080.obj)
line level source
1 /*******************Describtion************************
2 LCD:RT320240A
3 Controller: SED1335
4 Timing mode: 8080
5 Compiler: keil c51
6 Designer: SUN
7 ********************IO Configure************************
8 SED1335 MCU
9 1. VSS
10 2. VDD
11 3. V0
12 4. WR------------P36(WR)
13 5. RD------------P37(RD)
14 6. CS------------P27
15 7. A0------------P25
16 8. RES-----------P26
17 9. D0------------P10
18 | |
19 16.D7------------P17
20 17.NC
21 18.VOUT
22 19.LEDK
23 20.LEDA
24 ********************************************************/
25
26 /*******************Include Files***********************/
27 #include<reg51.h>
28
29 /***********************Command List*********************/
30 #define SystemSet 0x40
31 #define SleepIn 0x53
32 #define DispOn 0x59
33 #define DispOff 0x58
34 #define Scroll 0x44
35 #define ScrForm 0x5d
36 #define CgramAdr 0x5c
37 #define CsrdirRight 0x4c
38 #define CsrdirLeft 0x4d
39 #define CsrdirUp 0x4e
40 #define CsrdirDown 0x4f
41 #define HdotScr 0x5a
42 #define Ovlay 0x5b
43 #define Csrw 0x46
44 #define Csrr 0x47
45 #define Mwrite 0x42
46 #define Mread 0x43
47 /***************Pin Defination*****************/
48 #define databus P1
49
50 sbit a0=P2^5;
51 sbit read=P3^7;
52 sbit write=P3^6;
53 sbit cs=P2^7;
54 sbit rst=P2^6;
C51 COMPILER V7.50 SED1335_8080 10/02/2007 11:20:50 PAGE 2
55
56 /********************Parameter List*****************/
57 unsigned char code system_set_ini[8]={0x34,0x87,0x07,0x27,0x4a,0xf0,0x28,0x00};
58 unsigned char code scroll_ini1[6]={0x00,0x00,0xef,0x60,0x09,0xf0};
59 unsigned char code scroll_ini2[6]={0xb0,0x04,0x1e,0x60,0x09,0xf0};
60 unsigned char code scrform_ini[2]={0x07,0x86};
61 unsigned char code hdot_scr_ini[2]={0x00,0x0b};
62 unsigned char code ovlay_ini[1]={0x01};
63 unsigned char code disp_on_ini[1]={0x16};
64 unsigned char code disp_off_ini[1]={0x00};
65 unsigned char code cur_set_ini[2]={0x28,0x00};
66 unsigned char code cur_set_ini1[2]={0x00,0x00};
67 unsigned char code cur_set_ini2[2]={0xb8,0x04};
68 unsigned char code cur_set_ini3[2]={0x60,0x09};
69
70
71 unsigned char code word1[]={0x41,0x4e,0x44,0x4f,0x52,0x49,0x4e,0x20,0x4f,0x50,0x54,0x4f,0x45,0x4c,0x45,0x4
-3,0x20,
72 0x54,0x45,0x43,0x48,0x4e,0x4f,0x4c,0x4f,0x47,0x59,0x20,0x4c,0x54,0x44,0xa5,0x4
-3,0x4f};
73 unsigned char code word2[8]={0x20,0x41,0x4e,0x44,0x4f,0x52,0x49,0x4e};
74 unsigned char code word3[]={0x00};
75 unsigned char code send[32]={0x21,0x31, 0x41,0x51,0x61,0x71,0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0
-x39};
76 unsigned char code null[1]={0x00};
77 unsigned char code block_cur_set[2]={0x60,0x09};
78 unsigned char code an1[32]={0x02,0x01,0x3F,0x20,0x44,0x06,0x04,0xFF,0x08,0x08,0x08,0x06,0x01,0x06,0x18,0xE
-0,
79 0x00,0x00,0xFE,0x04,0x08,0x00,0x00,0xFE,0x20,0x20,0x40,0x80,0x00,0xC0,0x38,0x10
-};
80
81
82 unsigned char code hex1[1]={0xaa};
83 unsigned char code hex2[1]={0x55};
84 unsigned char code fill[1]={0XFF};
85 unsigned char code kright[1]={0X01};
86 unsigned char code kleft[1]={0x80};
87 unsigned char code hex3[1]={0x20};
88
89
90 unsigned char code an[];
91 unsigned char code de[];
92 unsigned char code li[];
93 unsigned char code guang[];
94 unsigned char code dian[];
95 unsigned char code ke[];
96 unsigned char code ji[];
97 unsigned char code ando[];
98 unsigned char code tu1[];
99 unsigned char code tu2[];
100 unsigned char code box[];
101
102
103 void delay(int t)
104 {
105 1 int i=0;
106 1 for(i=0;i<t;i++);
107 1 }
108
109 void long_delay(int t)
110 {
111 1 int i=0;
C51 COMPILER V7.50 SED1335_8080 10/02/2007 11:20:50 PAGE 3
112 1 int n;
113 1 for(i=0;i<t;i++)
114 1 {for(n=0;n<1000;n++);}
115 1 }
116
117 void sed1335_write(char commandcode, unsigned char code *parameter,int n)
118 {
119 1 int i=0;
120 1
121 1 a0=1;
122 1 read=1;
123 1 databus=commandcode;
124 1 write=0;
125 1 write=1;
126 1
127 1 for(i=0;i<n;i++)
128 1 {
129 2 a0=0;
130 2 read=1;
131 2 databus=parameter[i];
132 2 write=0;
133 2 write=1;
134 2
135 2 }
136 1 }
137
138 //在图形层写一个汉字//
139 void sed1335_write1(char commandcode,char low,int high)
140 {
141 1 a0=1;
142 1 read=1;
143 1 databus=commandcode;
144 1 write=0;
145 1 write=1;
146 1
147 1 a0=0;
148 1 read=1;
149 1 databus=low;
150 1 write=0;
151 1 write=1;
152 1
153 1 a0=0;
154 1 read=1;
155 1 databus=high;
156 1 write=0;
157 1 write=1;
158 1
159 1 }
160
161
162
163 /*写任何大小的一块, i为高度,j*8为宽度*/
164 wr_any(int low,int high, char word[],int i,int j)
165 {
166 1 int k=0;
167 1 for( k=0;k<j;k++)
168 1 {
169 2
170 2 sed1335_write1(Csrw,low,high);
171 2 sed1335_write(CsrdirDown,null,1);
172 2 sed1335_write(Mwrite,word+i*k,i);
173 2 low=low+1;
C51 COMPILER V7.50 SED1335_8080 10/02/2007 11:20:50 PAGE 4
174 2 if(low==0xff+1)
175 2 {low=0;high=high+1;}
176 2
177 2 }
178 1 }
179
180
181
182
183 void clr_scr()
184 {
185 1 int i=0;
186 1
187 1
188 1 sed1335_write(CsrdirRight,null,1);
189 1 sed1335_write(Csrw,cur_set_ini1,2);
190 1 a0=1;
191 1 read=1;
192 1 databus=Mwrite;
193 1 write=0;
194 1 write=1;
195 1
196 1 for(i=0;i<28800;i++)
197 1 {
198 2 a0=0;
199 2 read=1;
200 2 databus=0x00;
201 2 write=0;
202 2 write=1;
203 2 }
204 1 sed1335_write(Csrw,cur_set_ini1,2);
205 1 }
206
207 /*清除图形层*/
208 clrgrp_scr()
209 {
210 1 int j=0;
211 1 sed1335_write(Csrw,cur_set_ini3,2);
212 1 for(j=0;j<9600;j++)
213 1 {
214 2 sed1335_write(Mwrite,word3,1);
215 2 }
216 1 }
217
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -