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

📄 t0_m0_t_gs.lst

📁 C51 TIMER 0的使用 Timer_0_mode_0_timer_gate_soft
💻 LST
字号:
C51 COMPILER V7.06   T0_M0_T_GS                                                            04/07/2004 09:38:11 PAGE 1   


C51 COMPILER V7.06, COMPILATION OF MODULE T0_M0_T_GS
OBJECT MODULE PLACED IN t0_m0_t_gs.OBJ
COMPILER INVOKED BY: C:\KEIL\C51\BIN\C51.EXE t0_m0_t_gs.c BROWSE DEBUG OBJECTEXTEND TABS(3)

stmt level    source

   1          /**
   2           * @file $RCSfile: t0_m0_t_gs.c,v $
   3           *
   4           * Copyright (c) 2004 Atmel.
   5           *
   6           * Please read file license.txt for copyright notice.
   7           *
   8           * @brief This file is an example to use timer0 in mode 0.
   9           *
  10           * This file can be parsed by Doxygen for automatic documentation
  11           * generation.
  12           * Put here the functional description of this file within the software
  13           * architecture of your program.
  14           *
  15           * @version $Revision: 1.0 $ $Name:  $
  16           */
  17          
  18          /* @section  I N C L U D E S */
  19          #include "reg_c51.h"
  20          
  21          
  22          /**
  23           * FUNCTION_PURPOSE: This file set up timer 0 in mode 0 (13 bits timer) 
  24           * with a software gate.
  25           * The 13-bits register consist of all 8 bits of TH0 and the lower 5 bits   
  26           * of TL0. The upper 3 bits of TL0 are undeterminate and are ignored.   
  27           * FUNCTION_INPUTS: void
  28           * FUNCTION_OUTPUTS: void
  29           */
  30          void main(void)
  31          {
  32   1         TMOD &= 0xF0;              /* Timer 0 mode 0 with software gate */
  33   1                                    /* GATE0=0; C/T0#=0; M10=0; M00=0; */
  34   1         
  35   1         TH0 = 0x00;                /* init values */
  36   1         TL0 = 0x00;    
  37   1         ET0=1;                     /* enable timer0 interrupt */
  38   1         EA=1;                      /* enable interrupts */
  39   1         TR0=1;                     /* timer0 run */
  40   1         while(1);                  /* endless  */
  41   1      }
  42          
  43          
  44          /**
  45           * FUNCTION_PURPOSE: timer0 interrupt
  46           * FUNCTION_INPUTS: void
  47           * FUNCTION_OUTPUTS: P1.0 toggle period = 2 * 8192 cycles  
  48           */
  49          void it_timer0(void) interrupt 1 /* interrupt address is 0x000b */
  50          {
  51   1         TF0 = 0;                   /* reset  interrupt flag (already done by hardware)*/
  52   1         P1_0 = ~P1_0;              /* P1.0 toggle when interrupt. */
  53   1      }


C51 COMPILER V7.06   T0_M0_T_GS                                                            04/07/2004 09:38:11 PAGE 2   

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