⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lcd_6963.lst

📁 6963控制其的液晶测试程序
💻 LST
📖 第 1 页 / 共 2 页
字号:
C51 COMPILER V6.20c  LCD_6963                                                              09/20/2005 12:21:28 PAGE 1   


C51 COMPILER V6.20c, COMPILATION OF MODULE LCD_6963
OBJECT MODULE PLACED IN lcd_6963.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE lcd_6963.c DEBUG OBJECTEXTEND

stmt level    source

   1          #include<stdio.h>
   2          #include<intrins.h>
   3               
   4          #include <reg51.h>
   5          #include <math.h>
   6          #include <absacc.h>
   7          #include <string.h>
   8          /*   地址定义   */
   9          #define  d_add XBYTE[0xFC00]
  10          #define  c_add XBYTE[0xFD00]
  11          /*   常数定义   */
  12          #define  para1 0x20;
  13          #define  uchar unsigned char
  14          #define  uint unsigned  int
  15          
  16          #define  dat1 DBYTE[0x30]
  17          #define  dat2 DBYTE[0x31]
  18          #define  com  DBYTE[0x32]
  19          #define  code_1 DBYTE[0x33]
  20          #define  attr DBYTE[0x34]
  21          #define  O_Y DBYTE[0x35]
  22          #define  O_X DBYTE[0x36]
  23          /*  定义标志位  */
  24           sbit Acc_0=ACC^0;
  25           sbit Acc_1=ACC^1;
  26           sbit Acc_2=ACC^2;
  27           sbit Acc_3=ACC^3;
  28          uchar num=0;
  29          bit   s=0;
  30           uchar x=0;
  31           uchar y=0;
  32          /******************************/
  33          code uchar linehead[]={0x00,0x01,0x03,0x04,0x05,0x06,0x07};
  34           
  35          code unsigned char CGTAB[320]={ 
  36          
  37          
  38          /*80=0    */
  39          0x00,0x00,0x00,0x1C,0x36,0x63,0x63,0x63,
  40          0x63,0x63,0x63,0x63,0x36,0x1C,0x00,0x00,
  41          
  42          /*82=1    */
  43          0x00,0x00,0x00,0x18,0x78,0x18,0x18,0x18,
  44          0x18,0x18,0x18,0x18,0x18,0x7E,0x00,0x00,
  45          
  46          /*84=2    */
  47          0x00,0x00,0x00,0x3E,0x63,0x63,0x63,0x06,
  48          0x06,0x0C,0x18,0x30,0x63,0x7F,0x00,0x00,
  49          
  50          /*86=3    */
  51          0x00,0x00,0x00,0x3E,0x63,0x63,0x06,0x1C,
  52          0x06,0x03,0x03,0x63,0x66,0x3C,0x00,0x00,
  53          
  54          /*88=4    */
  55          0x00,0x00,0x00,0x06,0x0E,0x1E,0x36,0x36,
C51 COMPILER V6.20c  LCD_6963                                                              09/20/2005 12:21:28 PAGE 2   

  56          0x66,0x66,0x7F,0x06,0x06,0x1F,0x00,0x00,
  57          
  58          /*8a=5    */
  59          0x00,0x00,0x00,0x7F,0x60,0x60,0x60,0x7C,
  60          0x76,0x03,0x03,0x63,0x66,0x3C,0x00,0x00,
  61          
  62          /*8c=6    */
  63          0x00,0x00,0x00,0x1E,0x36,0x60,0x60,0x7C,
  64          0x76,0x63,0x63,0x63,0x36,0x1C,0x00,0x00,
  65          
  66          /*8e=7    */
  67          0x00,0x00,0x00,0x7F,0x66,0x66,0x0C,0x0C,
  68          0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,
  69          
  70          /*90=8    */
  71          0x00,0x00,0x00,0x3E,0x63,0x63,0x63,0x36,
  72          0x1C,0x36,0x63,0x63,0x63,0x3E,0x00,0x00,
  73          
  74          /*92=9    */
  75          0x00,0x00,0x00,0x1C,0x36,0x63,0x63,0x63,
  76          0x37,0x1F,0x03,0x03,0x36,0x3C,0x00,0x00,
  77          /*94=:*/
  78          0x00,0x00,0x00,0x00,0x1C,0x1C,0x1C,0x1C,
  79          0x00,0x00,0x1C,0x1C,0x1C,0x1C,0x00,0x00,
  80          /*96=o    */
  81          0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3E,
  82          0x63,0x63,0x63,0x63,0x63,0x3E,0x00,0x00,
  83          
  84          /*98=k    */
  85          0x00,0x00,0x00,0xE0,0x60,0x60,0x60,0x6F,
  86          0x6C,0x78,0x7C,0x6C,0x66,0xFF,0x00,0x00,
  87          
  88          /*9a=z    */
  89          0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,
  90          0x66,0x0C,0x18,0x18,0x33,0x7F,0x00,0x00,
  91          
  92          /*9c=-    */
  93          0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  94          0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  95          
  96          /*9e="    */
  97          0x00,0x1B,0x3F,0x36,0x6C,0x00,0x00,0x00,
  98          0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  99          /*A0=G    */
 100          0x00,0x00,0x00,0x3E,0x66,0x66,0xC0,0xC0,
 101          0xC0,0xCF,0xC6,0x66,0x66,0x3C,0x00,0x00,
 102          
 103          /*A2=P    */
 104          0x00,0x00,0x00,0xFE,0x63,0x63,0x63,0x63,
 105          0x7E,0x60,0x60,0x60,0x60,0xF0,0x00,0x00,
 106          
 107          /*A4=Y    */
 108          0x00,0x00,0x00,0xFF,0x66,0x66,0x3C,0x3C,
 109          0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,
 110          
 111          /*A6=R    */
 112          0x00,0x00,0x00,0xFE,0x63,0x63,0x63,0x7E,
 113          0x6C,0x6C,0x66,0x66,0x63,0xF3,0x00,0x00
 114          
 115          };
 116           
 117           
C51 COMPILER V6.20c  LCD_6963                                                              09/20/2005 12:21:28 PAGE 3   

 118           code unsigned char CCTAB[49][32]={
 119            /* 0=红*/
 120          0x10,0x10,0x23,0x20,0x44,0xF8,0x10,0x20,      
 121          0x40,0xFC,0x40,0x00,0x1C,0xE0,0x47,0x00,
 122          0x00,0x08,0xFC,0x20,0x20,0x20,0x20,0x20,
 123          0x20,0x20,0x20,0x20,0x20,0x24,0xFE,0x00,
 124          
 125          /*1=绿*/
 126          0x10,0x13,0x20,0x21,0x44,0xFF,0x10,0x22,  
 127          0x41,0xF9,0x00,0x01,0x1A,0xE4,0x41,0x00,
 128          0x08,0xFC,0x08,0xF8,0x08,0xFE,0x40,0x44,
 129          0x4C,0x50,0xE0,0x50,0x48,0x4E,0x44,0x80,
 130          /*2=黄*/
 131          
 132           };
 133          
 134           
 135           unsigned char code  DTAB[11]={ 0x37,0x45,0x4c,0x43,0x4f,0x4d,0x45,0x00,0x39,0x4f,0x55};
 136           unsigned char code  ASC[10]={ 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19};
 137          INIT_1();
 138          CLEAR();
 139          CGRAM();
 140          CCWR1_PR();
 141          CCW2_PR();
 142          CW2_PR();
 143          W_DOT();
 144          PR1();
 145          PR11();
 146          PR12();
 147          ST01();
 148          ST2();
 149          ST3();
 150          DISHAZIT(uchar x,uchar y,uchar d);
 151          DISHAZIW(uchar x,uchar y,uchar d);
 152          DISDASC(uchar x,uchar y,uchar d);
 153          DISASC(uchar x,uchar y,uchar d);
 154          
 155          FCCW2_PR();
 156          ShowLine(uchar x,uchar y,uchar *puts,uchar le,uchar kk);
 157          FDISHAZIT(uchar x,uchar y,uchar d);
 158           GUANGBIAO(uchar x,uchar y);
 159           void delay(int t);
 160           uchar keyscan();
 161           
 162           /**************************/
 163           /*      初始化函数        */
 164           /**************************/
 165          INT_1()
 166              {
 167   1             dat1=0x00;      /*设文本显示区域首地址*/
 168   1             dat2=0x00;
 169   1             com=0x40;
 170   1             PR1();
 171   1            
 172   1             dat1=para1;    /*设文本显示区域宽度*/
 173   1             dat2=0x00;
 174   1             com=0x41;
 175   1             PR1();
 176   1            
 177   1             dat1=0x00;    /*设图形显示区域首地址*/
 178   1             dat2=0x08;
 179   1             com=0x42;
C51 COMPILER V6.20c  LCD_6963                                                              09/20/2005 12:21:28 PAGE 4   

 180   1             PR1();
 181   1      
 182   1             dat1=para1;    /*设图形显示区域宽度*/
 183   1             dat2=0x00;
 184   1             com=0x43;
 185   1             PR1();
 186   1         
 187   1             com=0xa0;      /*光标形状设置*/
 188   1             PR12();
 189   1            
 190   1             com=0x80;      /*显示方式设置逻辑"或"合成*/
 191   1             PR12();
 192   1           
 193   1             com=0x98;      /*显示开关设置 开文本和图形显示*/
 194   1             PR12();
 195   1          }
 196                
 197               
 198             
 199           /***************************/
 200          /*      清显示子程序       */
 201          /***************************/
 202          CLEAR()
 203              {
 204   1          unsigned char i,j;
 205   1              dat1=0x00;
 206   1              dat2=0x00;
 207   1              com=0x24;
 208   1              PR1();
 209   1              com=0xb0;
 210   1              PR12();
 211   1          for(i=0;i<205;i++)
 212   1             {
 213   2               for(j=0;j<=40;j++)
 214   2                  {
 215   3                      ST3();
 216   3                      d_add=0x00;
 217   3                  }
 218   2              }
 219   1             com=0xb2;
 220   1             PR12();
 221   1          }
 222          /**************************/
 223           /*       CGRAM函数        */
 224           /**************************/
 225          CGRAM()
 226              {
 227   1              unsigned int i;
 228   1                 dat1=0x03;
 229   1                 dat2=0x00;
 230   1                 com=0x22;   /* 设置CGRAM偏置地址 */
 231   1                 PR1();
 232   1                 dat1=0x00;
 233   1                 dat2=0x1c;
 234   1                 com=0x24;   /* 设置存储器地址指针 */
 235   1                 PR1();
 236   1                 com=0xb0;   /* 设置自动写方式 */
 237   1                 PR12();
 238   1              for(i=0;i<320;i++)
 239   1                 {
 240   2                   ST3();
 241   2                   d_add=CGTAB[i];
C51 COMPILER V6.20c  LCD_6963                                                              09/20/2005 12:21:28 PAGE 5   

 242   2                 }
 243   1              com=0xb2;     /* 设置自动写结束方式 */
 244   1              PR12();
 245   1           }
 246          
 247          /********************************/
 248          /*    汉字写入(文本方式)函数    */
 249          /********************************/
 250          CCW1_PR()
 251               {
 252   1              unsigned int i,j;
 253   1              i=para1;
 254   1              j=i*O_Y+O_X;
 255   1              dat1=j%256;
 256   1              dat2=j/256;
 257   1              com=0x24;  /* 设置显示地址 */
 258   1              PR1();
 259   1              dat2=code_1;  /* 写入左上半部汉字代码 */
 260   1              com=0xc0;
 261   1              PR11();
 262   1              dat2=code_1+0x02;  /* 写入右上半部汉字代码 */
 263   1              PR11();
 264   1              j=j+i;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -