📄 delay.lst
字号:
C51 COMPILER V7.50 DELAY 04/25/2008 10:51:18 PAGE 1
C51 COMPILER V7.50, COMPILATION OF MODULE DELAY
OBJECT MODULE PLACED IN Delay.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE Delay.c BROWSE DEBUG OBJECTEXTEND
line level source
1 /************************************************************************************
2 * Copyright (c) 2004,西安铭朗电子科技有限责任公司
3 * All rights reserved.
4 *
5 * 文件名称: delay.C
6 * 文件标识: none
7 * 适用器件: C8051F040
8 *
9 * 摘 要: 本文件是延时子程序;使用外部22.1184MHz晶振.
10 *
11 * 当前版本:1.2
12 * 作 者:张宁强
13 * 完成日期:2006年1月10日
14 *
15 * 历史版本:1.0
16 * 原作者 : 李林利 卢阳
17 * 完成日期:2005年6月1日
18 *************************************************************************************/
19 /************************************************************************************/
20 // 引用外部头文件
21
22 #include "c8051f040.h"
23 #include "intrins.h"
24 #include "delay.h"
25
26 /************************************************************************************/
27 /***********************************************************************************
28 * 函数名称:Delay_us;
29 *
30 * 函数功能描述:延时n微秒子函数;
31 *
32 * 输入参数:延时时间(单位微秒);
33 *
34 * 返回数据:none;
35 *
36 * 注意: none;
37 ************************************************************************************/
38
39 void Delay_us(unsigned char Times)
40 {
41 1 unsigned char i;
42 1 for (i=0; i<Times; i++)
43 1 {
44 2 _nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();//100ns
45 2 _nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();//100ns
46 2 _nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();//100ns
47 2 _nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();//100ns
48 2 _nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();//100ns
49 2 _nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();//100ns
50 2 _nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();//100ns
51 2 _nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();_nop_();//100ns
52 2 _nop_();_nop_();_nop_();_nop_();_nop_();
53 2 }
54 1 }
55 /***********************************************************************************
C51 COMPILER V7.50 DELAY 04/25/2008 10:51:18 PAGE 2
56 * 函数名称:Delay_us;
57 *
58 * 函数功能描述:延时n毫秒子函数;
59 *
60 * 输入参数:延时时间(单位毫秒);
61 *
62 * 返回数据:none;
63 *
64 * 注意: none;
65 ************************************************************************************/
66
67 void Delay_ms(unsigned char Times)
68 {
69 1 unsigned char i;
70 1 for (i=0; i<Times; i++)
71 1 {
72 2 Delay_us(125);
73 2 Delay_us(125);
74 2 Delay_us(125);
75 2 Delay_us(125);
76 2 }
77 1 }
78
79 /***********************************************************************************
80 * 函数名称:Delay_us;
81 *
82 * 函数功能描述:延时n秒子函数;
83 *
84 * 输入参数:延时时间(单位秒);
85 *
86 * 返回数据:none;
87 *
88 * 注意: none;
89 ************************************************************************************/
90
91 void Delay_s(unsigned char Times)
92 {
93 1 unsigned char i;
94 1 for (i=0; i<Times; i++)
95 1 { Delay_ms(250);
96 2 Delay_ms(250);
97 2 Delay_ms(250);
98 2 Delay_ms(250);
99 2 }
100 1 }
101
102 /***********************************************************************************/
103 // 文件结束
104 /***********************************************************************************/
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 149 ----
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 + -