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

📄 main.lst

📁 通过实例实践LCD 驱动显示(以128DI0 为例)
💻 LST
📖 第 1 页 / 共 2 页
字号:
C51 COMPILER V7.50   MAIN                                                                  03/10/2005 08:04:12 PAGE 1   


C51 COMPILER V7.50, COMPILATION OF MODULE MAIN
OBJECT MODULE PLACED IN main.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE main.c OPTIMIZE(0,SPEED) BROWSE DEBUG OBJECTEXTEND

line level    source

   1          #include "reg51.h"
   2          /*****************************************************************************
   3          * 文件说明
   4          ******************************************************************************
   5          创 建 人:杨宏伟
   6          修 改 人:杨宏伟 
   7          创建日期:2003-10-19
   8          最后更新:2004-01-01
   9          描    述:FOR 128DI0,EM65565,8080,并行
  10          *****************************************************************************/
  11          #define  DELAY_TIME  1000   // 定义每幅显示画面切换的时间常数,可根据需要更改
  12          
  13          
  14          /*****************************************************************************
  15          * 接口定义
  16          ******************************************************************************/
  17          sbit  CS1 = P3^5;         // SELECT CHIP
  18          sbit  RES = P3^4;
  19          sbit  DC1 = P3^3;
  20          sbit  WR1 = P3^1;         // 8080:/WR;  6800:R/W 
  21          sbit  RD1 = P3^0;         // 8080:/RD;  6800:E
  22          sbit  MI =  P3^7;         // SELECT 8080 OR 6800
  23          
  24          
  25          /******************************************************************************
  26          * 显示数据
  27          *******************************************************************************/
  28          //8*8 图案
  29          unsigned char code test_graphic0[]={0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00}; //清屏
  30          unsigned char code test_graphic1[]={0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF}; //全显
  31          unsigned char code test_graphic2[]={0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa}; //隔行
  32          unsigned char code test_graphic3[]={0XFF,0X00,0XFF,0X00,0XFF,0X00,0XFF,0X00}; //隔列
  33          unsigned char code test_graphic4[]={0XFF,0XFE,0XFC,0XF8,0XF0,0XE0,0XC0,0X80}; //斜角图案
  34          unsigned char code test_graphic5[]={0X00,0X00,0X00,0X5E,0X21,0X51,0X41,0X3E}; //"Q"
  35          unsigned char code test_graphic6[]={0X00,0X00,0X00,0X46,0X49,0X51,0X61,0X42}; //"2"
  36          unsigned char code test_graphic7[]={0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55}; //DOT
  37          unsigned char code test_graphic8[]={0x11,0x22,0x44,0x88,0x11,0x22,0x44,0x88}; //"/"
  38          unsigned char code test_graphic9[]={0x00,0x18,0x18,0x7E,0x7E,0x18,0x18,0x00}; //"+"
  39          unsigned char code test_graphic10[]={0X0F,0X0F,0X0F,0X0F,0XF0,0XF0,0XF0,0XF0};//方格
  40          unsigned char code test_graphic11[]={0x00,0x42,0x24,0x18,0x18,0x24,0x42,0x00};//"*"
  41          
  42          //128*64图片
  43          unsigned char code test_pic1[]=
  44          {
  45          0x06,0x09,0x09,0x17,0x6F,0xFF,0xFF,0x79,0x1E,0x0F,0x0F,0x06,0x00,0x00,0x00,0x00,
  46          0x00,0x01,0x01,0x0E,0x10,0xE1,0xE1,0x00,0x8F,0x70,0x70,0x17,0x0F,0x06,0x06,0x06,
  47          0x06,0x86,0x86,0x66,0x91,0x90,0x90,0x09,0x09,0x10,0x10,0x68,0x89,0x89,0x89,0x10,
  48          0x68,0x09,0x09,0x09,0x10,0x10,0x10,0xE1,0x11,0x10,0x10,0xE0,0xF1,0xF9,0xF9,0xF8,
  49          0xE8,0x11,0x11,0xE1,0x10,0x10,0x10,0xE1,0x11,0x10,0x10,0x08,0x09,0x69,0x69,0x10,
  50          0x88,0x89,0x89,0x69,0x10,0x08,0x08,0x09,0x91,0x90,0x90,0x61,0x86,0x06,0x06,0x06,
  51          0x06,0x06,0x06,0x0F,0x17,0x70,0x70,0x8F,0x00,0xE1,0xE1,0x10,0x0E,0x01,0x01,0x00,
  52          0x00,0x00,0x00,0x00,0x01,0x07,0x07,0x0F,0x1E,0xFF,0xFF,0x17,0x09,0x06,0x06,0x01,
  53          0x96,0xEF,0xEF,0x9E,0x79,0xFF,0xFF,0xEF,0xF7,0x79,0x79,0x10,0x00,0x00,0x00,0x00,
  54          0x00,0xF8,0xF8,0x07,0x70,0x9E,0x9E,0x77,0x1E,0x96,0x96,0x91,0x10,0x60,0x60,0x80,
  55          0x80,0x80,0x80,0x80,0x08,0x0E,0x0E,0x0E,0x00,0x80,0x80,0x89,0x1E,0x19,0x19,0x99,
C51 COMPILER V7.50   MAIN                                                                  03/10/2005 08:04:12 PAGE 2   

  56          0x89,0x00,0x00,0x00,0x80,0x80,0x80,0x01,0x0F,0x87,0x87,0x87,0x06,0x06,0x06,0x80,
  57          0x8F,0x1E,0x1E,0x06,0x8E,0x8E,0x8E,0x06,0x00,0x80,0x80,0x80,0x07,0x0F,0x0F,0x86,
  58          0x8E,0x0F,0x0F,0x00,0x87,0x8F,0x8F,0x0E,0x0E,0x0F,0x0F,0x0F,0x80,0x80,0x80,0x80,
  59          0x80,0x60,0x60,0x10,0x91,0x96,0x96,0x1E,0x77,0x9E,0x9E,0x70,0x07,0xF8,0xF8,0x00,
  60          0x00,0x00,0x00,0x00,0x08,0x9E,0x9E,0x79,0xF7,0xFF,0xFF,0x9E,0xEF,0xF7,0xF7,0x69,
  61          0x86,0x79,0x79,0xF7,0xEF,0xFF,0xFF,0x79,0x9E,0xEF,0xEF,0x86,0x00,0x00,0x00,0x00,
  62          0x00,0x07,0x07,0x18,0xE7,0x0E,0x0E,0x96,0xF7,0x96,0x96,0x96,0x78,0x00,0x00,0x00,
  63          0x00,0x10,0x10,0x1F,0x7E,0xFF,0xFF,0xEE,0x01,0xF9,0xF9,0xFF,0xE9,0x9F,0x9F,0xF7,
  64          0xE6,0x07,0x07,0x07,0x00,0x00,0x00,0xFF,0xFF,0x77,0x77,0xE7,0x7E,0x01,0x01,0x81,
  65          0xF9,0xE9,0xE9,0xE9,0xF9,0xE1,0xE1,0x01,0x01,0x00,0x00,0x00,0xFF,0xE0,0xE0,0xEE,
  66          0xF8,0xF0,0xF0,0x00,0xF8,0xF8,0xF8,0xE8,0x88,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,
  67          0x00,0x00,0x00,0x78,0x96,0x96,0x96,0xF7,0x96,0x0E,0x0E,0xE7,0x18,0x07,0x07,0x00,
  68          0x00,0x00,0x00,0x00,0x60,0xF0,0xF0,0xE0,0x81,0xFF,0xFF,0xE7,0x70,0x98,0x98,0x60,
  69          0x96,0xEF,0xEF,0x9E,0x79,0xFF,0xFF,0xEF,0xF7,0x79,0x79,0x10,0x00,0x00,0x00,0x00,
  70          0x00,0xE0,0xE0,0x1E,0x01,0xF8,0xF8,0x86,0x01,0x01,0x01,0x01,0x0E,0x10,0x10,0x0F,
  71          0x00,0xE0,0xE0,0x80,0x00,0xF8,0xF8,0x00,0xF0,0x98,0x98,0x68,0xF8,0xF8,0xF8,0x6E,
  72          0x78,0xF8,0xF8,0xE0,0x00,0x00,0x00,0x98,0xF0,0x60,0x60,0xE0,0xE0,0xF8,0xF8,0x10,
  73          0xF0,0x10,0x10,0xF0,0x98,0x18,0x18,0xF8,0x80,0x00,0x00,0x00,0xFE,0xF8,0xF8,0x00,
  74          0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x0E,0xFE,0xFE,0xF8,0x00,0x00,0x00,0x00,
  75          0x0F,0x10,0x10,0x0E,0x01,0x01,0x01,0x01,0x86,0xF8,0xF8,0x01,0x1E,0xE0,0xE0,0x00,
  76          0x00,0x00,0x00,0x00,0x10,0x79,0x79,0xF7,0xEF,0xFF,0xFF,0x79,0x9E,0x6F,0x6F,0x16,
  77          0x83,0x74,0x74,0xEB,0x97,0xFF,0xFF,0x1C,0x8F,0xE7,0xE7,0x83,0x00,0x00,0x00,0x00,
  78          0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x88,0x64,0x60,0x60,0x60,0x6C,0x80,0x80,0x00,
  79          0x04,0x68,0x68,0x60,0x80,0x80,0x80,0x60,0x60,0x80,0x80,0x80,0x60,0x60,0x60,0x80,
  80          0x80,0x60,0x60,0x60,0x80,0x80,0x80,0x6F,0x60,0x8F,0x8F,0x8C,0x6C,0x6C,0x6C,0x8C,
  81          0x8C,0x6C,0x6C,0x6C,0x8F,0x80,0x80,0x6F,0x60,0x80,0x80,0x80,0x60,0x60,0x60,0x80,
  82          0x80,0x60,0x60,0x60,0x80,0x80,0x80,0x60,0x60,0x80,0x80,0x80,0x60,0x60,0x60,0x00,
  83          0x08,0x84,0x84,0x60,0x60,0x6C,0x6C,0x60,0x80,0x84,0x84,0x08,0x00,0x00,0x00,0x00,
  84          0x00,0x00,0x00,0x00,0x84,0xEF,0xEF,0x9C,0x78,0xFF,0xFF,0xEC,0xF7,0x7B,0x7B,0x94,
  85          0x4B,0xF7,0xF7,0xCF,0xBC,0xFF,0xFF,0xF7,0x7B,0xBC,0xBC,0x08,0x00,0x00,0x00,0x00,
  86          0x00,0x7C,0x7C,0x83,0x80,0x80,0x80,0x40,0x70,0x88,0x88,0xB8,0xB8,0xB8,0xB8,0x70,
  87          0x40,0x83,0x83,0x83,0x8F,0x7C,0x7C,0x03,0x03,0x07,0x07,0x07,0x0F,0x0F,0x0F,0x0F,
  88          0x0F,0x0F,0x0F,0x0C,0x0C,0x7F,0x7F,0x84,0x3B,0x7F,0x7F,0xFB,0xCB,0x8B,0x8B,0xC0,
  89          0x8B,0xCB,0xCB,0xFB,0x7F,0x3B,0x3B,0x87,0x7F,0x0C,0x0C,0x0C,0x0F,0x0F,0x0F,0x0F,
  90          0x0F,0x07,0x07,0x07,0x03,0x03,0x03,0x00,0x00,0x00,0x00,0x7C,0x83,0x80,0x80,0x80,
  91          0x40,0x70,0x70,0x88,0xB8,0xB8,0xB8,0xB8,0x70,0x40,0x40,0x83,0x83,0x8F,0x8F,0x7C,
  92          0x00,0x00,0x00,0x00,0x03,0x07,0x07,0x0F,0x3C,0xFF,0xFF,0x77,0x0B,0x84,0x84,0x03,
  93          0x40,0xBB,0xBB,0x74,0xCB,0xFF,0xFF,0x8F,0xC7,0xF3,0xF3,0x40,0x00,0x00,0x00,0x00,
  94          0x00,0x40,0x40,0xB8,0x43,0xB4,0xB4,0x74,0x3B,0x7B,0x7B,0xBC,0x7C,0xFB,0xFB,0x78,
  95          0xF0,0xF4,0xF4,0xCB,0x84,0xC0,0xC0,0xC0,0xC0,0xC7,0xC7,0xC0,0x80,0x80,0x80,0x00,
  96          0x00,0x00,0x00,0x0C,0x33,0xFF,0xFF,0xB0,0x38,0xBC,0xBC,0xBC,0xB4,0xB8,0xB8,0xB0,
  97          0xB8,0xBC,0xBC,0xBC,0xB4,0x38,0x38,0xB0,0xFF,0x33,0x33,0x0C,0x00,0x00,0x00,0x00,
  98          0x80,0x80,0x80,0xC0,0xC0,0xC7,0xC7,0xC0,0xC0,0x00,0x00,0x00,0x88,0x74,0x74,0xB8,
  99          0x70,0x3B,0x3B,0x7C,0xBC,0x7B,0x7B,0xFB,0x7C,0xF4,0xF4,0xF3,0xF8,0xC0,0xC0,0x00,
 100          0x00,0x00,0x00,0x00,0x08,0xBC,0xBC,0x7B,0xF7,0xFF,0xFF,0xBC,0xCF,0xF7,0xF7,0x4B,
 101          0xB4,0x7B,0x7B,0xF7,0xCF,0xFF,0xFF,0x7B,0xBC,0xCF,0xCF,0x84,0x00,0x00,0x00,0x00,
 102          0x00,0x00,0x00,0x00,0x80,0x40,0x40,0x33,0x74,0x74,0x74,0x7B,0xCB,0x84,0x84,0x04,
 103          0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x83,0x73,0x73,0x87,0x07,0x04,0x04,0x0F,
 104          0x0B,0x3F,0x3F,0x37,0x3F,0xFF,0xFF,0xBF,0x4F,0x34,0x34,0x34,0x8B,0x4B,0x4B,0x4F,
 105          0x4B,0x8B,0x8B,0x34,0x34,0x4F,0x4F,0xBF,0xFF,0x3F,0x3F,0x37,0x3F,0x0B,0x0B,0x0F,
 106          0x04,0x07,0x07,0x07,0x87,0x73,0x73,0x83,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x03,
 107          0x04,0x84,0x84,0x4B,0x3B,0x74,0x74,0x74,0x73,0xC0,0xC0,0x80,0x00,0x00,0x00,0x00,
 108          0x00,0x00,0x00,0x00,0x44,0xFF,0xFF,0xFC,0xFB,0xFF,0xFF,0xCF,0x77,0xBB,0xBB,0x44,
 109          0xB0,0xCC,0xCC,0xB8,0x70,0xFC,0xFC,0xC0,0xF0,0x78,0x78,0x30,0x00,0x30,0x30,0x08,
 110          0x04,0x00,0x00,0x00,0x3C,0x34,0x34,0x88,0x44,0x38,0x38,0x78,0x74,0x74,0x74,0xF3,
 111          0xF3,0x83,0x83,0x83,0x73,0x3F,0x3F,0xF0,0x0F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
 112          0xFF,0xFF,0xFF,0xFF,0xFF,0xF0,0xF0,0x8F,0x7F,0xFF,0xFF,0xFF,0xF8,0xF7,0xF7,0xF7,
 113          0xF7,0xF8,0xF8,0xFF,0xFF,0x7F,0x7F,0x8F,0xF0,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
 114          0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x0F,0xF0,0x3F,0x3F,0x73,0x83,0x83,0x83,0xF3,
 115          0x73,0x34,0x34,0x74,0x78,0x74,0x74,0xC3,0x80,0x30,0x30,0x4F,0x30,0x00,0x00,0x03,
 116          0x04,0x08,0x08,0x00,0x30,0x7B,0x7B,0xF7,0xCF,0xFF,0xFF,0x7B,0xBC,0xCF,0xCF,0xB4,
 117          0x00,0x03,0x03,0x04,0x04,0x0B,0x0B,0x0B,0x04,0x7C,0x7C,0x83,0x80,0x80,0x80,0x40,
C51 COMPILER V7.50   MAIN                                                                  03/10/2005 08:04:12 PAGE 3   

 118          0x70,0x88,0x88,0xB8,0xB8,0xB8,0xB8,0x70,0x40,0x83,0x83,0x83,0x8F,0x7C,0x7C,0x03,
 119          0x03,0x04,0x04,0x04,0x83,0x83,0x83,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
 120          0x7F,0x40,0x40,0xCF,0xFF,0xFF,0xFF,0x7F,0x80,0xFF,0xFF,0xFF,0x7F,0xCF,0xCF,0xCF,
 121          0xCF,0x7F,0x7F,0xFF,0xFF,0x80,0x80,0x7C,0xFF,0xFF,0xFF,0xF0,0xFF,0x7F,0x7F,0x40,
 122          0xC0,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x00,
 123          0x3F,0x40,0x40,0x40,0x40,0x30,0x30,0x38,0x44,0x4C,0x4C,0x4C,0x4C,0x38,0x38,0x30,
 124          0x40,0x40,0x40,0x47,0xBF,0xC0,0xC0,0x80,0x03,0xF3,0xF3,0x8C,0xC4,0x73,0x73,0x83,
 125          0x07,0x87,0x87,0x47,0x37,0x77,0x77,0x77,0x77,0xC7,0xC7,0x87,0x47,0xB7,0xB7,0x77,
 126          0x3F,0x7F,0x7F,0xBF,0x7F,0xFF,0xFF,0x7F,0xF7,0xF7,0xF7,0xC7,0x87,0xC7,0xC7,0x37,
 127          0x0F,0xBF,0xBF,0xBF,0x3F,0x77,0x77,0xC7,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x7F,
 128          0x87,0x3F,0x3F,0xFF,0xFF,0xFF,0xFF,0xFF,0x07,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
 129          0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x3F,0x8F,0xFF,0xFF,0xFF,0x3F,0x87,0x87,0x77,
 130          0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x0F,0x37,0x37,0x37,0x4F,0x4F,0x37,0x37,0x37,
 131          0x0F,0xC7,0xC7,0x37,0x4F,0x3F,0x3F,0x0F,0x3F,0x4F,0x4F,0x3F,0x7F,0x3F,0x3F,0x7F,
 132          0xFF,0xF7,0xF7,0xC7,0x07,0x07,0x07,0xC7,0x37,0x0F,0x0F,0xBF,0xBF,0x3F,0x3F,0x77,
 133          
 134          };
 135          
 136          
 137          
 138          /*******************************************************************************
 139          * 函数声明及实现
 140          *******************************************************************************/
 141          void delay(unsigned int n)             
 142          {
 143   1        unsigned int i,j;
 144   1      
 145   1        for (i=0;i<n;i++)
 146   1          for (j=0;j<350;j++)
 147   1      
 148   1          {;}
 149   1      }
 150          
 151          void data_out(unsigned char i)
 152          {
 153   1          //8080 interface
 154   1      
 155   1          CS1  = 0;
 156   1          WR1 = 0;
 157   1              DC1   = 1;
 158   1              P1  = i;
 159   1              WR1 = 1;
 160   1              CS1 = 1;
 161   1      
 162   1      }
 163          void comm_out(unsigned char i)
 164          {
 165   1      
 166   1          //8080 interface
 167   1      
 168   1          CS1  = 0;
 169   1              DC1 =0;
 170   1          WR1 = 0;
 171   1              P1  = i;
 172   1              WR1 = 1;
 173   1              CS1 = 1;
 174   1      
 175   1      }
 176          
 177          
 178          
 179          
C51 COMPILER V7.50   MAIN                                                                  03/10/2005 08:04:12 PAGE 4   

 180          
 181          
 182          void selectSeries(unsigned char i)
 183          {
 184   1      
 185   1         //SELECT SERIES
 186   1         switch(i)
 187   1         {
 188   2            case 0:
 189   2                  MI   = 0;//SELECT  8080
 190   2                  RD1  = 1;
 191   2                  WR1  = 1;
 192   2                  break;
 193   2            case 1:
 194   2                  MI   = 1;  //SELECT  6800
 195   2                  RD1  = 0;
 196   2                  WR1  = 0;
 197   2                  break;
 198   2            default:
 199   2                  ;

⌨️ 快捷键说明

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