📄 t0_m1_c_gs.lst
字号:
C51 COMPILER V7.06 T0_M1_C_GS 04/06/2004 13:58:50 PAGE 1
C51 COMPILER V7.06, COMPILATION OF MODULE T0_M1_C_GS
OBJECT MODULE PLACED IN t0_m1_c_gs.OBJ
COMPILER INVOKED BY: C:\KEIL\C51\BIN\C51.EXE t0_m1_c_gs.c BROWSE DEBUG OBJECTEXTEND TABS(3)
stmt level source
1 /**
2 * @file $RCSfile: t0_m1_c_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 1.
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 1 (16 bits counter)
24 * with a software gate. The counter count up at eatch negative transitions
25 * The 16-bits register consist of all 8 bits of TH0 and all 8 bits
26 * of TL0.
27 * FUNCTION_INPUTS: P3.4(T0) must be an external clock
28 * FUNCTION_OUTPUTS: void
29 */
30 void main(void)
31 {
32 1 TMOD &= 0xF0; /* Timer 0 mode 1 counter with software gate */
33 1 TMOD |= 0x05; /* GATE0=0; C/T0#=1; M10=0; M00=1; */
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 * 65536 cycles * P3.4(T0) period
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_M1_C_GS 04/06/2004 13:58:50 PAGE 2
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 24 ----
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 + -