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

📄 main.lst

📁 自制的51单片机学习板
💻 LST
字号:
C51 COMPILER V7.02a   MAIN                                                                 08/28/2007 08:43:01 PAGE 1   


C51 COMPILER V7.02a, COMPILATION OF MODULE MAIN
OBJECT MODULE PLACED IN main.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE main.c DEBUG OBJECTEXTEND

stmt level    source

   1          #include <at89x52.h>
   2          #include <stdio.h>
   3          #include "da1302.h"
   4          #include "lcd1602.h"
   5          #include "18B20.H"
*** WARNING C280 IN LINE 86 OF 18B20.H: 'n': unreferenced local variable
   6          #include "voice.h"
   7          
   8          
   9          
  10          unsigned char keytemp;
  11          unsigned char hourf,minutef;
  12          
  13          
  14          void Delay1ms(unsigned int count)
  15          {
  16   1              unsigned int i,j;
  17   1              for(i=0;i<count;i++)
  18   1              for(j=0;j<120;j++);
  19   1      }
  20          
  21          void Init_Com(void)
  22          {
  23   1           TMOD = 0x20;
  24   1           PCON = 0x00;
  25   1           SCON = 0x50;                       
  26   1           TH1 = 0xFd;
  27   1           TL1 = 0xFd;
  28   1           TR1 = 1;                           
  29   1      }
  30          SYSTEMTIME CurrentTime;
  31          void main(void)
  32          { 
  33   1      unsigned int i,a;
  34   1      uchar time[8]={0x00,0x46,0x20,0x22,0x08,0x03,0x07,0x00};  //1302的时间预设值
  35   1      LCD_initial(); 
  36   1      Initial_DS1302();
  37   1              set_time(time); /*                                                                         //设置1302的初始值
  38   1      DS1302_SetTime(DS1302_SECOND, 10);
  39   1      DS1302_SetTime(DS1302_MINUTE, 52);
  40   1      DS1302_SetTime(DS1302_HOUR, 10);
  41   1      DS1302_SetTime(DS1302_WEEK, 2);
  42   1      DS1302_SetTime(DS1302_DAY, 24);
  43   1      DS1302_SetTime(DS1302_MONTH, 8);
  44   1      DS1302_SetTime(DS1302_YEAR, 7); */
  45   1      LCD_set_position(0x00);
  46   1      LCD_prints("D: ");
  47   1      LCD_set_position(0x40);;
  48   1      LCD_prints("T: ");
  49   1      i=ReadTemperature(3); //读温度
  50   1      a=i;                  //  继续当前温度
  51   1      IntToStr(i,&TempBuffer[0],3);
  52   1      LCD_set_position(0x0B);
  53   1      LCD_printc(TempBuffer[0]); 
  54   1      LCD_printc(TempBuffer[1]);
C51 COMPILER V7.02a   MAIN                                                                 08/28/2007 08:43:01 PAGE 2   

  55   1      LCD_printc('.');
  56   1      LCD_printc(TempBuffer[2]);
  57   1      //LCD_printc(' ');
  58   1      LCD_printc(0xDF);
  59   1      LCD_printc('C');
  60   1      
  61   1      
  62   1      while(1)                                                                                                   
  63   1              {unsigned char week;
  64   2              i=ReadTemperature(3); 
  65   2          if (i!=a )    //如果有变化
  66   2               {       a=i;
  67   3              IntToStr(i,&TempBuffer[0],3);
  68   3          LCD_set_position(0x0B);
  69   3          LCD_printc(TempBuffer[0]); 
  70   3              LCD_printc(TempBuffer[1]);
  71   3              LCD_printc('.');
  72   3              LCD_printc(TempBuffer[2]);
  73   3              //LCD_printc(' ');
  74   3              LCD_printc(0xDF);
  75   3              LCD_printc('C');
  76   3              } 
  77   2             /* DS1302_GetTime(&CurrentTime);
  78   2                      DateToStr(&CurrentTime);
  79   2                      TimeToStr(&CurrentTime);
  80   2                      LCD_set_position(0x06);
  81   2                      LCD_prints(CurrentTime.DateString);
  82   2                      LCD_set_position(0x46);
  83   2                      LCD_prints(CurrentTime.TimeString);
  84   2      */
  85   2                      Initial_DS1302();
  86   2                      DS1302_GetTime(&CurrentTime);
  87   2              if((CurrentTime.Hour==7)&&(CurrentTime.Minute==15)&&(CurrentTime.Second==0))
  88   2                  { 
  89   3                       LCD_initial();
  90   3                       LCD_set_position(0x00);
  91   3               LCD_prints("time to get up");
  92   3                       Time0_Init();
  93   3                       Play_Song(0);          //播放
  94   3                      }
  95   2              week=CurrentTime.Week+'0'; 
  96   2              Delay1ms(1);
  97   2                      DateToStr(&CurrentTime);
  98   2                      TimeToStr(&CurrentTime);
  99   2                      LCD_set_position(0x02);
 100   2                      LCD_prints(CurrentTime.DateString);
 101   2                      LCD_set_position(0x42);
 102   2                      LCD_prints(CurrentTime.TimeString);
 103   2              LCD_set_position(0x4c);
 104   2              LCD_printc(week);
 105   2              Delay1ms(100);
 106   2      }
 107   1              
 108   1      }


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =   1969    ----
   CONSTANT SIZE    =    438    ----
   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =     58      61
C51 COMPILER V7.02a   MAIN                                                                 08/28/2007 08:43:01 PAGE 3   

   IDATA SIZE       =   ----    ----
   BIT SIZE         =   ----       2
END OF MODULE INFORMATION.


C51 COMPILATION COMPLETE.  1 WARNING(S),  0 ERROR(S)

⌨️ 快捷键说明

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