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

📄 cpu.lst

📁 STC51系列的源码
💻 LST
📖 第 1 页 / 共 2 页
字号:
 137   1      }
 138          
 139          
 140          /********************************************************************************/
 141          /* fun_name : CPU_timer_2_initialize()                                          */
 142          /* version  : v1.00                                                             */
 143          /* created  : xillinx                                                           */
 144          /* descript : 定时器2初始化,用作红外部分接收                                    */
 145          /* T=12/OSC=12/44236800=0.01736
 146          /********************************************************************************/
 147          void CPU_timer_2_initialize(void)
 148          {   C_T2   =0x00;       //* 内部定时器
 149   1          T2MOD &=0xFE;       //* DCEN=0x0,递增计数器,递增计数到0xFFFF后,溢出,然后在把RCAP2L和RCAP2H加载到TL2和T
             -H2
 150   1          RCAP2L =0x00;       //* 如果溢出了,就重新从0开始递增计数
 151   1          RCAP2H =0x00;
 152   1          TL2    =0x00;
 153   1          TH2    =0x00;
 154   1          TR2    =0x00;
 155   1      }
 156          
 157          
 158          /********************************************************************************/
 159          /* fun_name : CPU_extern_0_interrupt()                                          */
 160          /* version  : v1.00                                                             */
 161          /* created  : xillinx                                                           */
 162          /********************************************************************************/
 163          void CPU_extern_0_interrupt(void) interrupt 0                        
 164          {   CPU_extern_0_process();
 165   1      }
 166          
 167          /********************************************************************************/
 168          /* fun_name : CPU_extern_1_interrupt()                                          */
 169          /* descript : For USB                                                           */
 170          /* version  : v1.00                                                             */
 171          /* created  : xillinx                                                           */
 172          /********************************************************************************/
 173          void CPU_extern_1_interrupt(void) interrupt 2 
 174          {   CPU_extern_1_process();
 175   1      }
 176          
 177          /********************************************************************************/
C51 COMPILER V8.02   CPU                                                                   09/30/2008 23:49:30 PAGE 4   

 178          /* fun_name : CPU_serial_1_interrupt()                                          */
 179          /* version  : v1.00                                                             */
 180          /* created  : xillinx                                                           */
 181          /* descript : For uart                                                          */
 182          /********************************************************************************/
 183          void CPU_serial_1_interrupt(void) interrupt 4 
 184          {   if( RI==1)
 185   1          {   RI=0;
 186   2              UART_recv_isr_process();
 187   2          }
 188   1          else if(TI==1)
 189   1          {   TI=0;
 190   2              UART_xmit_isr_process();
 191   2          }
 192   1      }
 193          
 194          /********************************************************************************/
 195          /* fun_name : CPU_source_initialize()                                           */
 196          /* version  : v1.00                                                             */
 197          /* created  : xillinx                                                           */
 198          /* descript : 控制CPU的资源使用                                                 */
 199          /********************************************************************************/
 200          void CPU_source_initialize (void)
 201          {   CPU_timer_0_initialize();
 202   1          CPU_timer_2_initialize();
 203   1          CPU_uart_serial_initial();
 204   1          IT0 = 0x1;    //* 选择中断类型: 0<==>低电平,1<==>下降沿
 205   1          EX0 = 0x1;    //* 外部中断0
 206   1          ET0 = 0x1;    //* 定时器0
 207   1          EX1 = 0x0;    //* 外部中断1
 208   1          ET1 = 0x0;    //* 定时器1
 209   1          ES  = 0x1;    //* UART串口0
 210   1          EA  = 0x1;    //* 全局中断控制
 211   1      }
 212          
 213          
 214          /********************************************************************************/
 215          /* fun_name : CPU_timer_0_interrupt()                                           */
 216          /* version  : v1.00                                                             */
 217          /* created  : xillinx                                                           */
 218          /********************************************************************************/
 219          void CPU_timer_interrupt(void)                       
 220          {   CPU_soft_timer_lo++;
 221   1          system_timer++;                     //* for system time operator
 222   1          CPU_001_tick_process();
 223   1          if((CPU_soft_timer_lo&0x01)==0x0)
 224   1          {  CPU_002_tick_process();
 225   2          }
 226   1          if((CPU_soft_timer_lo&0x03)==0x0)
 227   1          {  CPU_004_tick_process();
 228   2          }
 229   1          if((CPU_soft_timer_lo&0x07)==0x0)
 230   1          {  CPU_008_tick_process();
 231   2          }
 232   1          if((CPU_soft_timer_lo&0x0F)==0x0)
 233   1          {  CPU_010_tick_process();
 234   2          }
 235   1          if((CPU_soft_timer_lo&0x1F)==0x0)
 236   1          {   CPU_020_tick_process();
 237   2          }
 238   1          if((CPU_soft_timer_lo&0x3F)==0x0)
 239   1          {   CPU_040_tick_process();
C51 COMPILER V8.02   CPU                                                                   09/30/2008 23:49:30 PAGE 5   

 240   2          }
 241   1          if((CPU_soft_timer_lo&0x7F)==0x0)
 242   1          {   CPU_080_tick_process();
 243   2          }
 244   1          if((CPU_soft_timer_lo&0xFF)==0x0)
 245   1          {   CPU_100_tick_process();
 246   2              CPU_soft_timer_hi++;
 247   2              if((CPU_soft_timer_hi&0x01)==0x0)
 248   2              {  CPU_200_tick_process();
 249   3              }
 250   2              if((CPU_soft_timer_hi&0x03)==0x0)
 251   2              {  CPU_400_tick_process();
 252   3              }
 253   2          }
 254   1      }
 255          
 256          
 257          /********************************************************************************/
 258          /* fun_name : CPU_timer_2_interrupt()                                           */
 259          /* descript : 定时器2中断                                                       */
 260          /* version  : v1.00                                                             */
 261          /* created  : xillinx                                                           */
 262          /********************************************************************************/
 263          void CPU_timer_2_interrupt(void) interrupt 5 
 264          {   TF2=0x0;
 265   1      }


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