📄 delay.lst
字号:
C51 COMPILER V7.09 DELAY 08/24/2007 15:55:02 PAGE 1
C51 COMPILER V7.09, COMPILATION OF MODULE DELAY
OBJECT MODULE PLACED IN delay.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE delay.c OPTIMIZE(SIZE) BROWSE DEBUG OBJECTEXTEND
line level source
1 /*
2 *********************************************************************************************************
3 * SIMPLE SOFTWARE DELAY FUNCTIONS
4 *
5 * File name : delay.c
6 * Programmer : John Leung, TechToys. Hong Kong
7 * Web presence : www.TechToys.com.hk
8 * Note :
9 * Language : Keil C 7.xx 2K limited version under uVision2 IDE
10 * Hardware : not specified
11 * Date : Version 0.0 (30th May 2006)
12 *********************************************************************************************************
13 * DESCRIPTION
14 *
15 * This module provides interface for simple software delay functions adjusted for external
16 * crystal of 11.0592MHz
17 *********************************************************************************************************
18 */
19
20 #include <REG51RB2.H>
21 #include "delay.h"
22
23 /*
24 *********************************************************************************************************
25 * DELAY MICRO-SECOND FUNCTION
26 *
27 * Description : This function implements a software delay in usec. However, this is NOT an exact
28 * usec delay function.
29 * Timing calculation as (13*N+26)us at 11.0592MHz, (12*N+24)us at 12MHz
30 * Arguments : 'N' time to delay, (13*N+26)us, adjusted for external crystal of 11.0592MHz,
31 * 12 clock cycle timing
32 *
33 * Returns : none
34 *********************************************************************************************************
35 */
36 void DelayUs(unsigned int N)
37 {
38 1 unsigned int x;
39 1
40 1 for(x=0; x<=N;x++);
41 1 }
42
43 /*
44 *********************************************************************************************************
45 * DELAY MILLI-SECOND FUNCTION
46 *
47 * Description : This function implements a software delay in millisec. Parameters adjusted for an
48 * external crystal of 11.0592MHz, with mcu of 12 clock cycle
49 * Arguments : 'msec' time to delay, roughly in millisec timing
50 *
51 * Returns : none
52 *********************************************************************************************************
53 */
54 void DelayMs(unsigned int msec)
55 {
C51 COMPILER V7.09 DELAY 08/24/2007 15:55:02 PAGE 2
56 1 unsigned int x,y;
57 1
58 1 for(x=0; x<=msec;x++)
59 1 {
60 2 for(y=0;y<=110;y++);
61 2 }
62 1 }
63
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 50 ----
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 + -