📄 7290test.lst
字号:
C51 COMPILER V7.00 7290TEST 08/26/2008 15:15:11 PAGE 1
C51 COMPILER V7.00, COMPILATION OF MODULE 7290TEST
OBJECT MODULE PLACED IN 7290test.OBJ
COMPILER INVOKED BY: D:\Keil\C51\BIN\C51.EXE 7290test.c BROWSE DEBUG OBJECTEXTEND
stmt level source
1 #include "REG52.h"
2 #include <intrins.h>
3 #include <absacc.h>
4 #include "VIIC_C51.h"
5 #include "ZLG7290.h"
6 #include "lcd.h"
7 #define uchar unsigned char;
8 #define uint unsigned int
9
10 sbit KEY_INT=P3^2;
11 sbit P1_0=P1^0;
12 sbit P1_1=P1^1;
13 sbit P1_2=P1^2;
14 sbit P1_3=P1^3;
15 sbit P1_4=P1^4;
16 sbit P1_5=P1^5;
17 sbit P1_6=P1^6;
18 sbit P1_7=P1^7;
19 //lcd引脚
20 sbit RS = P2^0;
21 sbit RW = P2^1;
22 sbit E = P2^2;
23 sbit PSB = P2^3; //串并口选择
24 sbit RES = P2^4;
25 //
26
27 unsigned char disp_buf[8]={0,0,0,0,0,0,0,0};
28 unsigned char buf[8]={0,0,0,0};
29 unsigned char code number_n[10] ={0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39};
30 unsigned char code dizhi_n[4]={0x80,0x90,0x88,0x98}; //DDRAM地址
31
32 unsigned char t,flash,shan;
33 unsigned char display(unsigned char *sd)
34 {
35 1 disp_buf[0] = (disp_buf[0]&0xe0)|(sd[0]); // 装载" dp-932"
36 1 disp_buf[1] = (disp_buf[1]&0xe0)|(sd[1]);
37 1 disp_buf[2] = (disp_buf[2]&0xe0)|(sd[2]);
38 1 disp_buf[3] = (disp_buf[3]&0xe0)|(sd[3]);
39 1 disp_buf[4] = (disp_buf[4]&0xe0)|(sd[4]);
40 1 disp_buf[5] = (disp_buf[5]&0xe0)|(sd[5]);
41 1 disp_buf[6] = (disp_buf[6]&0xe0)|(sd[6]);
42 1 disp_buf[7] = (disp_buf[7]&0xe0)|(sd[7]);
43 1 ZLG7290_SendBuf(disp_buf,8);
44 1 return 0;
45 1 }
46
47
48
49 void fla()
50 {
51 1 unsigned char bufx[8]={0,0,0,0,0,0,0,0};
52 1 if(shan==0x00)
53 1 shan=0xff;
54 1 else shan=0x00;
55 1 bufx[0] = (disp_buf[0]&shan)|(buf[0]); // 装载" dp-932"
C51 COMPILER V7.00 7290TEST 08/26/2008 15:15:11 PAGE 2
56 1 bufx[1] = (disp_buf[1]&shan)|(buf[1]);
57 1 bufx[2] = (disp_buf[2]&shan)|(buf[2]);
58 1 bufx[3] = (disp_buf[3]&shan)|(buf[3]);
59 1 bufx[4] = (disp_buf[4]&shan)|(buf[4]);
60 1 bufx[5] = (disp_buf[5]&shan)|(buf[5]);
61 1 bufx[6] = (disp_buf[6]&shan)|(buf[6]);
62 1 bufx[7] = (disp_buf[7]&shan)|(buf[7]);
63 1 shuzi(1,5,bufx[1],bufx[0]);
64 1 shuzi(1,3,bufx[3],bufx[2]);
65 1 shuzi(1,1,bufx[5],bufx[4]);
66 1 }
67
68
69 timer0() interrupt 1 //T0中断服务程序
70 {
71 1 t++; //时间加1
72 1 //秒
73 1 if(t%10==0) fla();
74 1 if(t==20)
75 1 { t=0;buf[0]++;}
76 1 if(buf[0]==10)
77 1 { buf[0]=0;buf[1]++;
78 2 }
79 1 //分
80 1 if(buf[1]==6)
81 1 { buf[1]=0;buf[2]++;}
82 1 if(buf[2]==10)
83 1 { buf[2]=0;buf[3]++;}
84 1 //小时
85 1 if(buf[3]==6)
86 1 { buf[3]=0;buf[4]++;}
87 1 if(buf[4]==10)
88 1 { buf[4]=0;buf[5]++;}
89 1
90 1
91 1
92 1 TH0=-50000/256;//重载计数初值
93 1 TL0=-50000%256;
94 1 }
95
96
97
98 void main()
99 {
100 1 extern void motor(bit x1,bit x2,bit x3,bit x4,uint motor_A,uint motor_B); /*电机驱动控制程序模块*/
101 1 // unsigned char buf[8]={8,8,8,8,8,8,8,8};//显示缓冲区
102 1
103 1 extern unsigned char adc0832(unsigned char chx0);
104 1
105 1 unsigned char key,i;
106 1 RES=0;
107 1 _nop_();
108 1 RES=1; //复位
109 1 PSB=1;
110 1 RW=0;
111 1 lcdreset(); //初始化LCD屏
112 1 zifu(0,2,"北京时间");
113 1 TMOD=0x01;
114 1 EA=1;
115 1 ET0=1;
116 1 TH0=-50000/256;//重载计数初值
117 1 TL0=-50000%256;
C51 COMPILER V7.00 7290TEST 08/26/2008 15:15:11 PAGE 3
118 1 TR0=1;
119 1
120 1 shuzi(1,5,buf[1],buf[0]);
121 1 shuzi(1,3,buf[3],buf[2]);
122 1 shuzi(1,1,buf[5],buf[4]);
123 1
124 1
125 1 for(;;)
126 1 {
127 2
128 2 if(KEY_INT==0) //读键值
129 2 {
130 3 key=ZLG7290_GetKey();
131 3 switch(key)
132 3 {
133 4 case 11: lcdwc(0x14);break;
134 4 case 12: disp_buf[flash]=0;flash++;disp_buf[flash]=0xff; break;
135 4 case 13: disp_buf[flash]=0;flash--;disp_buf[flash]=0xff; break;
136 4 case 14: lcdwc(0x0c);break;
137 4 case 15: lcdwc(0x0e);break;
138 4 case 16: for(i=0;i<=7;i++)
139 4 disp_buf[flash]=0;flash=0;break;
140 4 default: buf[flash]=key; break;
141 4
142 4 }
143 3 }
144 2 }
145 1 }
146
147
148
149
150
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 566 ----
CONSTANT SIZE = 31 ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = 19 9
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 + -