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

📄 test.lst

📁 此程序用于恒温箱控制
💻 LST
📖 第 1 页 / 共 2 页
字号:
C51 COMPILER V7.07   TEST                                                                  04/18/2005 16:58:05 PAGE 1   


C51 COMPILER V7.07, COMPILATION OF MODULE TEST
OBJECT MODULE PLACED IN test.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE test.c BROWSE DEBUG OBJECTEXTEND

stmt level    source

   1           
   2          #include <stdarg.h>///add,03-8-22,自定义printf
   3          #include "main.h"
   4          #include "x5045.h"   
   5          #include "i2c.h"      
   6                    
   7          void                    UART();
   8          void                    T0_int();
   9          void                    init_CPU(); 
  10          void                    Clear_rcv_buff(); 
  11          uchar               printat(uchar *COMMAND,uchar *RESULT); 
  12          void                  putunchar (char c);
  13          void x9318(bit ud, uchar dat);
  14          unsigned int cal_crc(unsigned char *ptr, unsigned char len);
  15          uchar rcv_serch(uchar *serch);
  16          void  rcv_data();
  17          void reset_5045();
  18          
  19          uchar  idata pr[10];
  20          uchar  t50ms;
  21          uchar rcv_point ; 
  22          uchar idata rcv_buff[15];
  23          uchar t1s1,t1s2,t1m1, heat_vale;
  24          uint idata tem_value1, tem_value2;
  25          uchar heating;
  26          uint idata crc_value;
  27          bit data_bit;
  28          bit tem1_bit,tem2_bit,heat_bit;
  29          bit  ctrcool_bit,ctrheat_bit;
  30          uchar heat_value;    
  31          void main()
  32           {   
  33   1            uchar    i;
  34   1            char  temp1;
  35   1            uint j;      
  36   1              P34=P35=P36=P37=P23=P24=P25=P22=0;  
*** ERROR C202 IN LINE 36 OF TEST.C: 'P23': undefined identifier
  37   1              data_bit=0;         
  38   1              ctrcool_bit=ctrheat_bit=0;
  39   1              init_CPU();
  40   1              WRSR_25045();
  41   1              write_7416C(0x00);
  42   1              write_7416C(0x02);
  43   1              WDT=1;
  44   1              REST_DOG();
  45   1              i=Byte_Read(0,10);
  46   1              if(i!=10) reset_5045();       
  47   1              Clear_rcv_buff(); 
  48   1              tem_value1=Byte_Read(0,1);         
  49   1                tem_value2=Byte_Read(0,3);          
  50   1                write_7416T( 0,0x02,tem_value1 );
  51   1                write_7416T( 0,0x03,tem_value1+6);
  52   1                write_7416T( 0x02,0x02,tem_value2);
  53   1                write_7416T( 0x02,0x03,tem_value2+6);          
  54   1                 heat_value=0;              
C51 COMPILER V7.07   TEST                                                                  04/18/2005 16:58:05 PAGE 2   

  55   1                 x9318(0,100);
  56   1                 heat_value=0;          
  57   1                 j=read_7416(0x00);
  58   1                 if(j>tem_value1)
  59   1                 {ctrcool_bit=1;P22=1;}
*** ERROR C202 IN LINE 59 OF TEST.C: 'P22': undefined identifier
  60   1                 else 
  61   1                 ctrheat_bit=1;
  62   1             while(1)
  63   1               {
  64   2                 WDT=1;
  65   2                 REST_DOG();  
  66   2                 if(t1s2>6)
  67   2                 {        
  68   3                 t1s2=0;
  69   3                  }
  70   2             
  71   2             
  72   2               if(data_bit)
  73   2                {
  74   3                
  75   3                  ES=1; 
  76   3                   rcv_data();          
  77   3                 } 
  78   2               if(ctrcool_bit&&(t1s1>4))
  79   2                  {
  80   3                   P32=1;
  81   3                   if(P32)                
  82   3                   { 
  83   4                      ctrcool_bit=0; P22=0;EX0 =1;
*** ERROR C202 IN LINE 83 OF TEST.C: 'P22': undefined identifier
  84   4                      }
  85   3                   t1s1=0;
  86   3                 
  87   3                      
  88   3                       
  89   3                 }
  90   2               if(ctrheat_bit&& (t1s1>6))
  91   2                 { 
  92   3                 t1s1=0; 
  93   3                 j=read_7416(0x00);
  94   3                 putunchar(j);        
  95   3                 temp1=tem_value1-j;
  96   3                 putunchar(temp1);
  97   3                 if(temp1>=0)
  98   3                 {
  99   4                      if(temp1>20)
 100   4                       {
 101   5                        if(65<heat_value)
 102   5                         {
 103   6                          x9318(0, heat_value-65); 
 104   6                        //heat_value=65;
 105   6                       // putunchar (temvalue);           
 106   6                         }              //test
 107   5                         else
 108   5                          {
 109   6                           x9318(1, 65-heat_value); 
 110   6                          //heat_value=65;                    
 111   6                         } 
 112   5                         heat_value=65;  
 113   5                         putunchar (heat_value);                          
 114   5                       }
C51 COMPILER V7.07   TEST                                                                  04/18/2005 16:58:05 PAGE 3   

 115   4                     else if((temp1<=20)&&(temp1>15))
 116   4                      {
 117   5                      if(20<heat_value)
 118   5                         {
 119   6                          x9318(0, heat_value-20);                        
 120   6                         }              //test
 121   5                         else
 122   5                          {
 123   6                           x9318(1, 20-heat_value);                                   
 124   6                         } 
 125   5                         heat_value=20; 
 126   5                         putunchar (heat_value);                     
 127   5                       }  
 128   4                     else if((temp1<=15)&&(temp1>10))
 129   4                      {
 130   5                      if(15<heat_value)
 131   5                         {
 132   6                          x9318(0, heat_value-15);                        
 133   6                         }              //test
 134   5                         else
 135   5                          {
 136   6                           x9318(1, 15-heat_value);                                   
 137   6                         } 
 138   5                         heat_value=15; 
 139   5                         putunchar (heat_value);                     
 140   5                       }
 141   4                      else if((temp1<=10)&&(temp1>5))
 142   4                      {
 143   5                      if(10<heat_value)
 144   5                         {
 145   6                          x9318(0, heat_value-10);                        
 146   6                         }              //test
 147   5                         else
 148   5                          {
 149   6                           x9318(1, 10-heat_value);                           
 150   6                         } 
 151   5                         heat_value=10;  
 152   5                         putunchar (heat_value);                        
 153   5                       }
 154   4                      else 
 155   4                      {
 156   5                      if(5<heat_value)
 157   5                         {
 158   6                          x9318(0, heat_value-5);                         
 159   6                         }              //test
 160   5                         else
 161   5                          {
 162   6                           x9318(1, 5-heat_value); 
 163   6                                                      
 164   6                           }  
 165   5                          heat_value=5;  
 166   5                           putunchar (heat_value);                
 167   5                       }
 168   4                    }   
 169   3                 else 
 170   3                 {
 171   4                 
 172   4                          x9318(0, heat_value-0); 
 173   4                        
 174   4                         
 175   4                          heat_value=0;  
 176   4                           putunchar (heat_value);            
C51 COMPILER V7.07   TEST                                                                  04/18/2005 16:58:05 PAGE 4   

 177   4                 }          
 178   3                  }   
 179   2             
 180   2                   
 181   2                      
 182   2               }      
 183   1                
 184   1                
 185   1       }
 186           
 187          void init_CPU()
 188          {
 189   1      
 190   1              WDTD=100;
 191   1              WDTC=0x0f;
 192   1               
 193   1              SCON=0x50;
 194   1              TMOD=0x21; // T1:baut,T0:Time 16bit
 195   1              TCON=0x50; // TR0,TR1=1.低电平触发,IT0=IT1=0; 
 196   1              TH1=0xfd;TL1=0xfd;PCON=0; // Uart Baut=9600
 197   1              TH0=0x4c;TL0=0x00;  // T0=50ms  
 198   1              IE=0x92; //开全局中断,定时器0。串口中断。/关两个外部中断EX0=EX1=0;
 199   1              IP=0x10; // UART高
 200   1              //AUXR=0x00;//内部XRAM,ALE为1/6FOSC,AUXR=0x10外部XRAM

⌨️ 快捷键说明

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