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

📄 clpl.lst

📁 单片机遥控
💻 LST
字号:
C51 COMPILER V8.06   CLPL                                                                  06/18/2007 11:44:37 PAGE 1   


C51 COMPILER V8.06, COMPILATION OF MODULE CLPL
OBJECT MODULE PLACED IN clpl.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE clpl.c BROWSE DEBUG OBJECTEXTEND

line level    source

   1          #include <REGX51.H>
   2          #define uchar unsigned char
   3          #define uint unsigned int
   4          uchar t0cout,t1cout;
   5          unsigned long fx,res;
   6          
   7          sbit rst=P1^0;
   8          sbit sda=P1^1;
   9          sbit scl=P1^2;
  10          
  11          delay(uint k)
  12          {
  13   1        while(--k);
  14   1      }
  15          
  16          stari2c()
  17          {
  18   1        sda=1;
  19   1        scl=1;
  20   1        delay(1);
  21   1        sda=0;
  22   1        delay(1);
  23   1        scl=0; 
  24   1      }
  25          
  26          endi2c()
  27          {
  28   1        sda=0;
  29   1        scl=1;
  30   1        delay(1);
  31   1        sda=1;
  32   1        delay(1);
  33   1      
  34   1      }
  35          
  36          sendi2c(uchar c)
  37          {
  38   1        uchar i;
  39   1        for(i=0;i<8;i++)
  40   1        {
  41   2          sda=c&0x80;
  42   2              c=c<<1;
  43   2              scl=1;
  44   2              delay(1);
  45   2              scl=0;
  46   2              sda=0;
  47   2              delay(1);
  48   2        }
  49   1        scl=1;
  50   1        delay(1);
  51   1        scl=0;
  52   1        delay(1);
  53   1      }
  54          
  55          uchar readi2c()
C51 COMPILER V8.06   CLPL                                                                  06/18/2007 11:44:37 PAGE 2   

  56          {
  57   1        uchar i,c;
  58   1        sda=1;
  59   1        for(i=0;i<8;i++)
  60   1        {
  61   2              scl=1;
  62   2              c=c<<1;
  63   2              if(sda==1)c=c+1;
  64   2              delay(1);
  65   2              scl=0;
  66   2        }
  67   1        scl=1;
  68   1        delay(1);
  69   1        scl=0;
  70   1        delay(1);
  71   1        return(c);
  72   1      }
  73          
  74          sendic(uchar ma,uchar sa,uchar c)
  75          {
  76   1        stari2c();
  77   1        sendi2c(ma);
  78   1        sendi2c(sa);
  79   1        sendi2c(c);
  80   1        endi2c();
  81   1      
  82   1      }
  83          
  84          uchar readic(uchar ma,uchar sa)
  85          {
  86   1        uchar c;
  87   1        stari2c();
  88   1        sendi2c(ma);
  89   1        sendi2c(sa);
  90   1        stari2c();
  91   1        sendi2c(ma+1);
  92   1        c=readi2c();
  93   1        endi2c();
  94   1        return(c);
  95   1      
  96   1      }
  97          
  98          main()
  99          {
 100   1      //  uchar c;
 101   1        rst=0;
 102   1        delay(10);
 103   1        rst=1;
 104   1        EA=1;
 105   1        TMOD=0x51;
 106   1        ET0=1;ET1=0;
 107   1        TR0=1;TR1=1;
 108   1        TL0=(65536-50000)%256;
 109   1        TH0=(65536-50000)/256;  
 110   1      
 111   1        while(1)
 112   1        {
 113   2         // c=readic(0xa2,0x02);       delay(100);
 114   2              //c=c&0x7f;
 115   2              res=((14430000/fx)-1000)/2;
 116   2              sendic(0x70,0x08,res%10);        delay(100);
 117   2              sendic(0x70,0x07,0x60);  delay(100);
C51 COMPILER V8.06   CLPL                                                                  06/18/2007 11:44:37 PAGE 3   

 118   2              sendic(0x70,0x08,res%100/10);    delay(100);
 119   2              sendic(0x70,0x07,0x61);  delay(100);
 120   2      
 121   2              sendic(0x70,0x08,res%1000/100);  delay(100);
 122   2              sendic(0x70,0x07,0x62);  delay(100);
 123   2              sendic(0x70,0x08,res%10000/1000);        delay(100);
 124   2              sendic(0x70,0x07,0x63);  delay(100);
 125   2      
 126   2              sendic(0x70,0x08,res%100000/10000);      delay(100);
 127   2              sendic(0x70,0x07,0x64);  delay(100);
 128   2              sendic(0x70,0x08,res%1000000/100000);    delay(100);
 129   2              sendic(0x70,0x07,0x65);  delay(100);
 130   2      
 131   2              sendic(0x70,0x08,res%10000000/1000000);  delay(100);
 132   2              sendic(0x70,0x07,0x66);  delay(100);
 133   2              sendic(0x70,0x08,res%10000000/10000000);         delay(100);
 134   2              sendic(0x70,0x07,0x67);  delay(100);
 135   2        }  
 136   1      }
 137          intt0() interrupt 1 using 2
 138          {
 139   1        TL0=(65536-50000)%256;
 140   1        TH0=(65536-50000)/256;
 141   1        t0cout++;     
 142   1        if(t0cout>=20)
 143   1        {
 144   2          fx=t1cout*65536+TH1*256+TL1;
 145   2                TL0=(65536-50000)%256;
 146   2        TH0=(65536-50000)/256;
 147   2        TL1=0;TH1=0;
 148   2              
 149   2              
 150   2              t0cout=0;
 151   2              t1cout=0;
 152   2              
 153   2        }
 154   1      
 155   1      }
 156          intt1() interrupt 3 using 3
 157          {
 158   1        t1cout++;
 159   1      }


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