📄 rtc.lst
字号:
C51 COMPILER V7.05 RTC 04/13/2004 13:35:27 PAGE 1
C51 COMPILER V7.05, COMPILATION OF MODULE RTC
OBJECT MODULE PLACED IN rtc.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE rtc.c BROWSE DEBUG OBJECTEXTEND
stmt level source
1 //rtc.c - code recommendation for C header file
2 /***********************************************************************
3 MODULE: Real Time Clock
4 VERSION: 1.00
5 CONTAINS: Routines for controlling the Real Time Clock/System Timer
6 on the Philips P89LPC932
7 COPYRIGHT: Embedded Systems Academy, Inc. - www.esacademy.com
8 LICENSE: May be freely used in commercial and non-commercial code
9 without royalties provided this copyright notice remains
10 in this file and unaltered
11 WARNING: IF THIS FILE IS REGENERATED BY CODE ARCHITECT ANY CHANGES
12 MADE WILL BE LOST. WHERE POSSIBLE USE ONLY CODE ARCHITECT
13 TO CHANGE THE CONTENTS OF THIS FILE
14 GENERATED: On "Feb 24 2004" at "16:21:01" by Code Architect 2.03
15 ***********************************************************************/
16
17 // SFR description needs to be included
18 #include<REG922.h>
19 #include "rtc.h"
20 #include "watchdogrtc.h"
21
22 /***********************************************************************
23 DESC: Initializes the Real Time Clock and starts it running
24 Generates an interrupt every 1.997ms
25 Clock source: CPU Clock at 7.3728 MHz
26 RETURNS: Nothing
27 CAUTION: Set EA to 1 to enable interrupts
28 ************************************************************************/
29 void rtc_init(void)
30 {
31 1 // set reload value
32 1 // count frequency = clock source / 128 / RTCH,RTCL
33 1 RTCH = 0xfF;
34 1 RTCL = 0xFF;
35 1
36 1 // select CPU Clock, enable interrupt source
37 1 RTCCON = 0x62;
38 1
39 1 // initialize watchdog/real time clock interrupt
40 1 watchdogrtc_isrinit();
41 1
42 1 // start real time clock
43 1 RTCCON |= 0x01;
44 1 }
45
46 /***********************************************************************
47 DESC: Starts the Real Time Clock
48 RETURNS: Nothing
49 CAUTION: rtc_init must be called first
50 ************************************************************************/
51 void rtc_start(void)
52 {
53 1 // start the real time clock
54 1 RTCCON |= 0x01;
55 1 }
C51 COMPILER V7.05 RTC 04/13/2004 13:35:27 PAGE 2
56
57 /***********************************************************************
58 DESC: Stops the Real Time Clock
59 RETURNS: Nothing
60 CAUTION: rtc_init must be called first
61 ************************************************************************/
62 void rtc_stop(void)
63 {
64 1 // stop the real time clock
65 1 RTCCON &= ~0x01;
66 1 }
67
68
69
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 + -