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

📄 xq_ap66c.lst

📁 16输入8输出单片机程序
💻 LST
📖 第 1 页 / 共 2 页
字号:
C51 COMPILER V7.06   AP66C                                                                03/06/2004 21:02:00 PAGE 1   


C51 COMPILER V7.06, COMPILATION OF MODULE AP66C
OBJECT MODULE PLACED IN xq_ap66c.obj
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE AP66C.C BROWSE DEBUG OBJECTEXTEND

stmt level    source

   1                  //-------------------------------------------------------------------------
   2          //      Filename :  ap066c.c
   3          //      Language :  C for AT89c52
   4          //      Revision :
   5          //  Initial Date :  10/02
   6          //   Last Modify :  Tom
   7          //  System clock :  24.00MHZ
   8          //   Description :  for 3p slot liner machine
   9          //-------------------------------------------------------------------------
  10          //--------------------test dn-----------------------------------------------------
  11          #pragma  pr(xq_ap66c.lst)  pl(24)  pw(119)  //lc  //sb   
  12          
  13          #pragma  object(xq_ap66c.obj)
  14                         
  15          #pragma  mod517(noau,nodp8)  
C51 COMPILER V7.06   AP66C                                                                03/06/2004 21:02:00 PAGE 2   

  16          
  17          
  18          
  19          
  20          
  21          //--------------------test up-----------------------------------------------------
  22          #include <reg52.h>
  23          #include <absacc.h>                                 
  24          #include "PC16BIOS.h"
  25          // define constant for input of the main control board
  26          #define p_pusher_fd     1
  27          #define p_pusher_bd     2
  28          #define index_up        3
  29          #define index_dn        4
  30          #define detect          5
  31          #define alarm           6
  32          #define start1          7
  33          #define start2          8
  34          #define workhd_up       9
  35          #define workhd_dn       10
  36          #define ck_pap          11
  37          
C51 COMPILER V7.06   AP66C                                                                03/06/2004 21:02:00 PAGE 3   

  38          //#define               12
  39          //#define               13
  40          //#define               14
  41          #define manual          15
  42          #define reset           16
  43          //-------------------------------------------------------------------------
  44          // define constant for output of the main control board
  45          #define p_pusher_1      1
  46          #define p_pusher_2      2
  47          #define index           3
  48          #define workhd_1        4
  49          #define workhd_2        5
  50          #define reset_lp        6
  51          //#define                 7
  52          #define buzzer          8
  53                                                                                          
  54          
  55          
  56                        
  57          
  58          
  59          //-------------------------------------------------------------------------
C51 COMPILER V7.06   AP66C                                                                03/06/2004 21:02:00 PAGE 4   

  60                  // function prototype
  61                  //void ck_home (void);
  62                  void manual_pro (void);
  63                  void auto_pro (void);
  64                  //void sin_mo_wa (void);  //in single step mode wait
  65                  //void sin_mo_pro (void);  //in single step mode wait
  66                  void on_p_pusher (void);
  67                  void off_p_pusher (void);
  68                  void on_workhd (void);
  69                  void off_workhd (void);
  70                  
  71                  //-------------------------------------------------------------------------
  72                          char p_pushermem;
  73                          char indexmem;
  74                          char workhdmem;
  75          //-------------------------------------------------------------------------
  76          main ()
  77          {
  78   1              init_system ();
  79   1              delay (900);           //delay 1 sec
  80   1              p_pushermem = 0;
  81   1              indexmem = 0;
C51 COMPILER V7.06   AP66C                                                                03/06/2004 21:02:00 PAGE 5   

  82   1              workhdmem = 0;
  83   1      //      ck_home ();
  84   1              while (1)
  85   1              {
  86   2              if ( input_port ( manual ) )
  87   2                      manual_pro ();
  88   2                      else
  89   2                        {
  90   3                        if ( (input_port (start1) + input_port (start2)) == 2 )
  91   3                          auto_pro ();
  92   3              
  93   3                        if ( input_port (reset) )
  94   3                              {
  95   4                              output_port (buzzer,ON);
  96   4                      
  97   4                              off_workhd ();
  98   4                              while ( !input_port (workhd_dn) );
  99   4              
 100   4                              off_p_pusher ();
 101   4                              while ( !input_port (p_pusher_bd) );
 102   4              
 103   4                      output_port (buzzer,OFF);
C51 COMPILER V7.06   AP66C                                                                03/06/2004 21:02:00 PAGE 6   

 104   4                      }
 105   3                }
 106   2              }
 107   1      }
 108          //-------------------------------------------------------------------------
 109          void manual_pro ()
 110          {
 111   1              char a;
 112   1      
 113   1              while (input_port (manual) )
 114   1              {
 115   2              switch ( scan_manual() )
 116   2                      {
 117   3                      case 1 :
 118   3                              if ( input_port (p_pusher_bd) == 1 )
 119   3                              output_port (reset_lp,OFF);
 120   3                              else
 121   3                              output_port (reset_lp,ON);
 122   3      
 123   3              if ( input_port (reset) )
 124   3              {
 125   4                      while ( input_port (reset) );
C51 COMPILER V7.06   AP66C                                                                03/06/2004 21:02:00 PAGE 7   

 126   4                              if ( input_port (p_pusher_bd) == 0 )
 127   4                              {
 128   5                              off_p_pusher ();
 129   5                              p_pushermem = 0;
 130   5                              }
 131   4                              else
 132   4                              {
 133   5                              on_p_pusher ();
 134   5                              p_pushermem = 1;
 135   5                              }
 136   4              }
 137   3                              break;
 138   3      
 139   3                      case 2 :
 140   3                              if ( input_port (index_up) == 1 )
 141   3                              output_port (reset_lp,OFF);
 142   3                              else
 143   3                              output_port (reset_lp,ON);
 144   3      
 145   3              if ( input_port (reset) )
 146   3              {
 147   4                      while ( input_port (reset) );
C51 COMPILER V7.06   AP66C                                                                03/06/2004 21:02:00 PAGE 8   

 148   4                              if ( input_port (index_up) == 0 )
 149   4                              {
 150   5                              output_port (index,OFF );
 151   5                              indexmem = 0;
 152   5                              }
 153   4                              else
 154   4                              {
 155   5                              output_port (index,ON );
 156   5                              indexmem = 1;
 157   5                              }
 158   4              }
 159   3                              break;
 160   3      
 161   3                      case 3 :
 162   3                              if ( input_port (workhd_dn) == 1 )
 163   3                              output_port (reset_lp,OFF);
 164   3                              else
 165   3                              output_port (reset_lp,ON);
 166   3      
 167   3              if ( input_port (reset) )
 168   3              {
 169   4                      while ( input_port (reset) );
C51 COMPILER V7.06   AP66C                                                                03/06/2004 21:02:00 PAGE 9   

 170   4                              if ( input_port (workhd_dn) == 0 )
 171   4                              {
 172   5                              off_workhd ();
 173   5                              workhdmem = 0;
 174   5                              }
 175   4                              else
 176   4                              {
 177   5                              on_workhd ();
 178   5                              workhdmem = 1;
 179   5                              }
 180   4              }
 181   3                              break;
 182   3                      }
 183   2                              delay (300);        }
 184   1              a = p_pushermem+indexmem+workhdmem;
 185   1              if ( a != 0 )
 186   1              {
 187   2              output_port (buzzer,ON);
 188   2              while ( !input_port (manual) );
 189   2              delay (100);
 190   2              output_port (buzzer,OFF);
 191   2              }
C51 COMPILER V7.06   AP66C                                                                03/06/2004 21:02:00 PAGE 10  

 192   1      }
 193          //-------------------------------------------------------------------------
 194          void auto_pro ()
 195          {
 196   1              char a;
 197   1              char b;
 198   1              char c;
 199   1      //      char d;
 200   1              unsigned int job_time;
 201   1              unsigned int job_time_temp;
 202   1              delay (398);
 203   1              a = input_port(start1);
 204   1              a += input_port(start2);
 205   1              if ( a == 2 )
 206   1                {
 207   2                delay (383);
 208   2      
 209   2                while ( input_port (start1) );
 210   2                while ( input_port (start2) );
 211   2      
 212   2                if ( input_port (ck_pap ) == 1 )
 213   2                {
C51 COMPILER V7.06   AP66C                                                                03/06/2004 21:02:00 PAGE 11  

 214   3                  output_port (buzzer,ON);
 215   3                  delay (883);

⌨️ 快捷键说明

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