📄 init.lst
字号:
C51 COMPILER V8.02 INIT 07/26/2008 19:16:14 PAGE 1
C51 COMPILER V8.02, COMPILATION OF MODULE INIT
OBJECT MODULE PLACED IN init.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\c51.exe init.c DB OE BR
line level source
1 /////////////////////////////////////
2 // Generated Initialization File //
3 /////////////////////////////////////
4
5 #include "C8051F120.h"
6
7 // Peripheral specific initialization functions,
8 // Called from the Init_Device() function
9 void Reset_Sources_Init()
10 {
11 1 WDTCN = 0xDE;
12 1 WDTCN = 0xAD;
13 1 }
14
15 void DAC_Init()
16 {
17 1 SFRPAGE = DAC0_PAGE;
18 1 DAC0CN = 0x84;
19 1 SFRPAGE = DAC1_PAGE;
20 1 DAC1CN = 0x84;
21 1 }
22
23 void Voltage_Reference_Init()
24 {
25 1 SFRPAGE = ADC0_PAGE;
26 1 REF0CN = 0x03;
27 1 }
28
29 void ADC_Init()
30 {
31 1 SFRPAGE = ADC2_PAGE;
32 1 ADC2CF = 0x19;
33 1 ADC2CN = 0x80;
34 1 ADC2GT = 0x40;
35 1 }
36
37 void Timer_Init()
38 {
39 1 SFRPAGE = TIMER01_PAGE;
40 1 TCON = 0x10;
41 1 TMOD = 0x01;
42 1 CKCON = 0x08;
43 1 TL0 = 0x0F;
44 1 TH0 = 0xF0;
45 1 IE = 0x82;
46 1 }
47
48
49 void Oscillator_Init()
50 {
51 1 int i = 0;
52 1 SFRPAGE = CONFIG_PAGE;
53 1 OSCXCN = 0x67;
54 1 for (i = 0; i < 3000; i++); // Wait 1ms for initialization
55 1 while ((OSCXCN & 0x80) == 0);
C51 COMPILER V8.02 INIT 07/26/2008 19:16:14 PAGE 2
56 1 CLKSEL = 0x01;
57 1 OSCICN = 0x00;
58 1
59 1 }
60
61
62
63 /*
64 void Oscillator_Init()
65 {
66 SFRPAGE = CONFIG_PAGE;
67 OSCICN = 0x83;
68 }
69 */
70
71 void Port_IO_Init()
72 {
73 1 // P0.0 - INT0 (Tmr0), Push-Pull, Digital
74 1 // P0.1 - Unassigned, Push-Pull, Digital
75 1 // P0.2 - Unassigned, Push-Pull, Digital
76 1 // P0.3 - Unassigned, Push-Pull, Digital
77 1 // P0.4 - Unassigned, Push-Pull, Digital
78 1 // P0.5 - Unassigned, Push-Pull, Digital
79 1 // P0.6 - Unassigned, Push-Pull, Digital
80 1 // P0.7 - Unassigned, Push-Pull, Digital
81 1
82 1 // P1.0 - Skipped, Open-Drain, Analog
83 1 // P1.1 - Skipped, Open-Drain, Analog
84 1 // P1.2 - Skipped, Open-Drain, Analog
85 1 // P1.3 - Skipped, Open-Drain, Analog
86 1 // P1.4 - Skipped, Open-Drain, Analog
87 1 // P1.5 - Skipped, Open-Drain, Analog
88 1 // P1.6 - Skipped, Open-Drain, Analog
89 1 // P1.7 - Skipped, Open-Drain, Analog
90 1
91 1 // P2.0 - Unassigned, Push-Pull, Digital
92 1 // P2.1 - Unassigned, Push-Pull, Digital
93 1 // P2.2 - Unassigned, Push-Pull, Digital
94 1 // P2.3 - Unassigned, Push-Pull, Digital
95 1 // P2.4 - Unassigned, Push-Pull, Digital
96 1 // P2.5 - Unassigned, Push-Pull, Digital
97 1 // P2.6 - Unassigned, Push-Pull, Digital
98 1 // P2.7 - Unassigned, Push-Pull, Digital
99 1
100 1 // P3.0 - Unassigned, Push-Pull, Digital
101 1 // P3.1 - Unassigned, Push-Pull, Digital
102 1 // P3.2 - Unassigned, Push-Pull, Digital
103 1 // P3.3 - Unassigned, Push-Pull, Digital
104 1 // P3.4 - Unassigned, Push-Pull, Digital
105 1 // P3.5 - Unassigned, Push-Pull, Digital
106 1 // P3.6 - Unassigned, Push-Pull, Digital
107 1 // P3.7 - Unassigned, Push-Pull, Digital
108 1
109 1 SFRPAGE = CONFIG_PAGE;
110 1 P1MDIN = 0x00;
111 1 P0MDOUT = 0xFF;
112 1 P2MDOUT = 0xFF;
113 1 P3MDOUT = 0xA0;
114 1 P4MDOUT = 0xFF;
115 1 P5MDOUT = 0x00;
116 1 P6MDOUT = 0x00;
117 1 P7MDOUT = 0xFF;
C51 COMPILER V8.02 INIT 07/26/2008 19:16:14 PAGE 3
118 1 XBR0 = 0x00;
119 1 XBR1 = 0x04;
120 1 XBR2 = 0xC0;
121 1 }
122
123
124
125
126
127 // Initialization function for device,
128 // Call Init_Device() from your main program
129 void Init_Device(void)
130 {
131 1 Reset_Sources_Init();
132 1 DAC_Init();
133 1 Voltage_Reference_Init();
134 1 Oscillator_Init();
135 1 ADC_Init();
136 1 Timer_Init();
137 1 Port_IO_Init();
138 1 }
139
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 + -