📄 display.lst
字号:
C51 COMPILER V7.07 DISPLAY 06/13/2008 13:33:19 PAGE 1
C51 COMPILER V7.07, COMPILATION OF MODULE DISPLAY
OBJECT MODULE PLACED IN display.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE display.c BROWSE DEBUG OBJECTEXTEND
stmt level source
1 #include <reg52.h>
2
3 #define comm 0
4 #define dat 1
5
6 sbit RS = P3^3; //H=data; L=command;
7 sbit RW = P3^4; //H=read; L=write;
8 sbit E = P3^5; //input enable;
9 sbit busy=P1^7; //lcd busy bit
10
11 void chk_busy (void)
12 {
13 1 P1=0xff;
14 1 RS=0;
15 1 RW=1;
16 1 E =1;
17 1 while(busy==1);
18 1 E =0;
19 1 }
20
21 /*---------------------------------------*/
22 void write_lcd (unsigned char dat_comm,unsigned char content)
23 {
24 1 chk_busy ();
25 1 if(dat_comm)
26 1 {
27 2 RS=1; RW=0; //write data
28 2 }
29 1 else
30 1 {
31 2 RS=0; RW=0; //write command
32 2 }
33 1 P1=content; //output data or comm
34 1 E=1;
35 1 E=0;
36 1 }
37
38
39 void clrram (void)
40 {
41 1 write_lcd (comm,0x30);
42 1 write_lcd (comm,0x01);
43 1 }
44
45
46 void init_lcd (void)
47 {
48 1 write_lcd (comm,0x30); /*30---基本指令动作*/
49 1 write_lcd (comm,0x01); /*清屏,地址指针指向00H*/
50 1 write_lcd (comm,0x06); /*光标的移动方向*/
51 1 write_lcd (comm,0x0c); /*开显示,关游标*/
52 1 }
53
54
55 void line_disp (unsigned char lines , unsigned char *chn)
C51 COMPILER V7.07 DISPLAY 06/13/2008 13:33:19 PAGE 2
56 {
57 1 unsigned char i;
58 1 write_lcd (comm,0x30);
59 1 switch (lines)
60 1 {
61 2 case 0: write_lcd (comm,0x80);for (i=0;i<16;i++)write_lcd (dat,chn[i]);break;
62 2 case 1: write_lcd (comm,0x90);for (i=0;i<16;i++)write_lcd (dat,chn[i]);break;
63 2 case 2: write_lcd (comm,0x88);for (i=0;i<16;i++)write_lcd (dat,chn[i]);break;
64 2 case 3: write_lcd (comm,0x98);for (i=0;i<16;i++)write_lcd (dat,chn[i]);break;
65 2 }
66 1 }
67
68
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 186 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = ---- 3
IDATA SIZE = ---- ----
BIT SIZE = ---- ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -