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

📄 lcd.lst

📁 基于51单片机开发的数字时钟
💻 LST
字号:
C51 COMPILER V8.08   LCD                                                                   04/21/1993 08:46:34 PAGE 1   


C51 COMPILER V8.08, COMPILATION OF MODULE LCD
OBJECT MODULE PLACED IN ..\lcd.obj
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE lcd.c BROWSE DEBUG OBJECTEXTEND OBJECT(..\lcd.obj)

line level    source

   1          #include <REGX51.H>
   2          #include <lcd.h>
   3          
   4          char code int2charLCD[]="0123456789";
   5          
   6          void delay100us(unsigned);
   7                  
   8          void write_LCD_command(unsigned command)
   9          {
  10   1              rw=WRITE;
  11   1              rs=COMMAND;
  12   1              enable=ENABLE;
  13   1              P1=command;
  14   1              delay100us(20);
  15   1              enable=DISABLE;
  16   1              rw=1;
  17   1      }
  18          void write_LCD_data(unsigned LCDdata)
  19          {
  20   1              rw=WRITE;
  21   1              rs=DATA;
  22   1              enable=ENABLE;
  23   1              P1=LCDdata;
  24   1              delay100us(20);
  25   1              enable=DISABLE;
  26   1              rw=1;
  27   1      }
  28          void init_LCD(void)
  29          {
  30   1              write_LCD_command(TwoLine_8bit);// 0x38         
  31   1              write_LCD_command(CURSOR_OFF);  // 0x0C
  32   1              write_LCD_command(CURSOR_RIGHT);// 0x06
  33   1      }
  34          void clear_LCD()
  35          {
  36   1              write_LCD_command(CLEAR);       
  37   1              write_LCD_command(CURSOR_HOME); 
  38   1      }
  39          void cursor_blink(void)
  40          {
  41   1              write_LCD_command(CURSOR_BLINK);        
  42   1              
  43   1      }
  44          void cursor_off(void)
  45          {
  46   1              write_LCD_command(CURSOR_OFF);  
  47   1              
  48   1      }
  49          void display_LCD_string(char *p)
  50          {
  51   1              while(*p)
  52   1              {
  53   2                      write_LCD_data(*p);
  54   2                      p++;
  55   2              }
C51 COMPILER V8.08   LCD                                                                   04/21/1993 08:46:34 PAGE 2   

  56   1      }
  57          void display_LCD_number(char number)
  58          {
  59   1              unsigned char x,y;
  60   1              x=number/10;
  61   1              y=number-10*x;
  62   1              write_LCD_data(int2charLCD[x]);
  63   1              write_LCD_data(int2charLCD[y]);
  64   1      }
  65          void gotoxy(unsigned x,unsigned y)
  66          {
  67   1              if(x==1)  
  68   1                      write_LCD_command(GOTO_LINE_1+y);
  69   1              else
  70   1              write_LCD_command(GOTO_LINE_2+y);
  71   1      }


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    202    ----
   CONSTANT SIZE    =     11    ----
   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =   ----       6
   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 + -