📄 initial.lst
字号:
C51 COMPILER V7.08 INITIAL 04/10/2005 22:25:31 PAGE 1
C51 COMPILER V7.08, COMPILATION OF MODULE INITIAL
OBJECT MODULE PLACED IN Initial.OBJ
COMPILER INVOKED BY: d:\Keil\C51\BIN\C51.EXE Initial.c BROWSE DEBUG OBJECTEXTEND
line level source
1 void Sys_Init(void)
2 {
3 1 unsigned char delay; // 用于测试目的
4 1
5 1 WDTCN = 0xde; // 禁止看门狗定时器
*** ERROR C202 IN LINE 5 OF INITIAL.C: 'WDTCN': undefined identifier
6 1 WDTCN = 0xad;
*** ERROR C202 IN LINE 6 OF INITIAL.C: 'WDTCN': undefined identifier
7 1
8 1 // #if OSCEN //使用内部晶振
9 1 // {
10 1 // OSCICN |= 0x03; // 设置内部振荡器为最高频率(16 MHz)
11 1 // }
12 1 // #else //外部晶振
13 1 // {
14 1 OSCXCN = 0x66; // Enable external crystal
*** ERROR C202 IN LINE 14 OF INITIAL.C: 'OSCXCN': undefined identifier
15 1
16 1 delay=256; // Delay >1 ms before polling XTLVLD.
17 1 while(delay--);
18 1
19 1 while (!(OSCXCN & 0x80)); // Wait until external crystal has
*** ERROR C202 IN LINE 19 OF INITIAL.C: 'OSCXCN': undefined identifier
20 1 // started.
21 1 OSCICN = 0x0C; // Switch to external oscillator
*** ERROR C202 IN LINE 21 OF INITIAL.C: 'OSCICN': undefined identifier
22 1 OSCICN = 0x88; // Disable internal oscillator; enable
*** ERROR C202 IN LINE 22 OF INITIAL.C: 'OSCICN': undefined identifier
23 1 // missing clock detector.
24 1
25 1 while (!(OSCXCN & 0x80)); // Wait until external crystal has
*** ERROR C202 IN LINE 25 OF INITIAL.C: 'OSCXCN': undefined identifier
26 1 // started.
27 1 OSCICN = 0x08; // Switch to external oscillator
*** ERROR C202 IN LINE 27 OF INITIAL.C: 'OSCICN': undefined identifier
28 1 // }
29 1 // #endif
30 1 XBR0 = 0x07; // 通过交叉开关将SMBus/SPI/UART连到通用I/O引脚
*** ERROR C202 IN LINE 30 OF INITIAL.C: 'XBR0': undefined identifier
31 1 //UART P0.6,P0.7
32 1 XBR1 = 0x00;
*** ERROR C202 IN LINE 32 OF INITIAL.C: 'XBR1': undefined identifier
33 1 XBR2 = 0x40; // 允许交叉开关和弱上拉
*** ERROR C202 IN LINE 33 OF INITIAL.C: 'XBR2': undefined identifier
34 1 SPI0CN=0x01; //允许SPI;
*** ERROR C202 IN LINE 34 OF INITIAL.C: 'SPI0CN': undefined identifier
35 1 SMB0CN = 0x44; // 允许SMBus在应答周期发送ACK
*** ERROR C202 IN LINE 35 OF INITIAL.C: 'SMB0CN': undefined identifier
36 1 SMB0CR = -80; // SMBus时钟频率 = 100kHz.
*** ERROR C202 IN LINE 36 OF INITIAL.C: 'SMB0CR': undefined identifier
37 1 EIE1 |= 2; // SMBus中断允许
*** ERROR C202 IN LINE 37 OF INITIAL.C: 'EIE1': undefined identifier
38 1 PRT1CF |= 0x44; // enable P1.6 (LED) as a push-pull output
*** ERROR C202 IN LINE 38 OF INITIAL.C: 'PRT1CF': undefined identifier
39 1
C51 COMPILER V7.08 INITIAL 04/10/2005 22:25:31 PAGE 2
40 1 PRT0CF |= 0x04;
*** ERROR C202 IN LINE 40 OF INITIAL.C: 'PRT0CF': undefined identifier
41 1 PRT2CF |= 0x01;
*** ERROR C202 IN LINE 41 OF INITIAL.C: 'PRT2CF': undefined identifier
42 1
43 1 //PRT1CF |= 0x40;
44 1 // set up Timer3 for auto-reload to generate interrupts at 100ms intervals
45 1 TMR3CN = 0x00; // stop Timer3
*** ERROR C202 IN LINE 45 OF INITIAL.C: 'TMR3CN': undefined identifier
46 1 TMR3RLH = ((-TC_100ms >> 8) & 0xff); // init Timer3 reload value
*** ERROR C202 IN LINE 46 OF INITIAL.C: 'TMR3RLH': undefined identifier
47 1 TMR3RLL = (-TC_100ms & 0xff);
*** ERROR C202 IN LINE 47 OF INITIAL.C: 'TMR3RLL': undefined identifier
48 1 TMR3H = 0xff; // init Timer3 to reload immediately
*** ERROR C202 IN LINE 48 OF INITIAL.C: 'TMR3H': undefined identifier
49 1 TMR3L = 0xff;
*** ERROR C202 IN LINE 49 OF INITIAL.C: 'TMR3L': undefined identifier
50 1 EIE2 = EIE2 | 0x01; // enable Timer3 OVR interrupt
*** ERROR C202 IN LINE 50 OF INITIAL.C: 'EIE2': undefined identifier
51 1 //TMR3CN = 0x04; // start Timer3
52 1 EA = 1; // 全局中断允许
*** ERROR C202 IN LINE 52 OF INITIAL.C: 'EA': undefined identifier
53 1 SM_BUSY = 0; // 为第一次传输释放SMBus
*** ERROR C202 IN LINE 53 OF INITIAL.C: 'SM_BUSY': undefined identifier
54 1 MODECON =1; //充放电模式控制(0为放电,1为充电)
*** ERROR C202 IN LINE 54 OF INITIAL.C: 'MODECON': undefined identifier
55 1 CH=1;
*** ERROR C202 IN LINE 55 OF INITIAL.C: 'CH': undefined identifier
56 1 RT=0;
*** ERROR C202 IN LINE 56 OF INITIAL.C: 'RT': undefined identifier
57 1 }
58
59 void UART0_Init (void)
60 {
61 1 SCON = 0x50; // SCON: mode 1, 8-bit UART, enable RX
*** ERROR C202 IN LINE 61 OF INITIAL.C: 'SCON': undefined identifier
62 1 TMOD = 0x22; // TMOD: timer 1,TIMER0, mode 2, 8-bit reload
*** ERROR C202 IN LINE 62 OF INITIAL.C: 'TMOD': undefined identifier
63 1 TH1 = 0xFA;//-(SYSCLK/BAUDRATE/16); // set Timer1 reload value for baudrate
*** ERROR C202 IN LINE 63 OF INITIAL.C: 'TH1': undefined identifier
64 1 TL1=TH1;
*** ERROR C202 IN LINE 64 OF INITIAL.C: 'TL1': undefined identifier
65 1 TH0=DAH;
*** ERROR C202 IN LINE 65 OF INITIAL.C: 'TH0': undefined identifier
66 1 TL0=DAL;
*** ERROR C202 IN LINE 66 OF INITIAL.C: 'TL0': undefined identifier
67 1 CKCON |= 0x18; // Timer1,TIMER0 uses SYSCLK as time base
*** ERROR C202 IN LINE 67 OF INITIAL.C: 'CKCON': undefined identifier
68 1 PCON |= 0x80; // SMOD = 1
*** ERROR C202 IN LINE 68 OF INITIAL.C: 'PCON': undefined identifier
69 1 ES0=1;
*** ERROR C202 IN LINE 69 OF INITIAL.C: 'ES0': undefined identifier
70 1 ET0=1;
*** ERROR C202 IN LINE 70 OF INITIAL.C: 'ET0': undefined identifier
71 1 ET2=1;
*** ERROR C202 IN LINE 71 OF INITIAL.C: 'ET2': undefined identifier
72 1 TR0=1;
*** ERROR C202 IN LINE 72 OF INITIAL.C: 'TR0': undefined identifier
73 1 TR1 = 1; // start Timer1
*** ERROR C202 IN LINE 73 OF INITIAL.C: 'TR1': undefined identifier
74 1 T2CON =0x00; //用定时器1的溢出脉冲做串口发送/接收时钟,定时器、
*** ERROR C202 IN LINE 74 OF INITIAL.C: 'T2CON': undefined identifier
C51 COMPILER V7.08 INITIAL 04/10/2005 22:25:31 PAGE 3
75 1 RCAP2H =0xfe; //TR2=0,停计数器、,具有重装载功能
*** ERROR C202 IN LINE 75 OF INITIAL.C: 'RCAP2H': undefined identifier
76 1 RCAP2L =0xfb; //1个字节10位占用174个机器周期,
*** ERROR C202 IN LINE 76 OF INITIAL.C: 'RCAP2L': undefined identifier
77 1 TH2 =0xfe; //等待10个字节时须在16位模式下设置为0xf933
*** ERROR C202 IN LINE 77 OF INITIAL.C: 'TH2': undefined identifier
78 1 TL2 =0xfb;
*** ERROR C202 IN LINE 78 OF INITIAL.C: 'TL2': undefined identifier
79 1 }
80 void DAC_Init(void)
81 {
82 1 REF0CN=1; //使能基准参考电压
*** ERROR C202 IN LINE 82 OF INITIAL.C: 'REF0CN': undefined identifier
83 1
84 1 DAC0CN=0x80;//DAC0DF=000;
*** ERROR C202 IN LINE 84 OF INITIAL.C: 'DAC0CN': undefined identifier
85 1
86 1 REF0CN=0x03;//
*** ERROR C202 IN LINE 86 OF INITIAL.C: 'REF0CN': undefined identifier
87 1 }
88
89 void Var_Init(void)
90 {
91 1 unsigned char i;
92 1 for ( i=0; i<10; i++)
93 1 RECVCHARS[i]=0;
*** ERROR C202 IN LINE 93 OF INITIAL.C: 'RECVCHARS': undefined identifier
94 1 RECVCHARS[9]=0;
*** ERROR C202 IN LINE 94 OF INITIAL.C: 'RECVCHARS': undefined identifier
95 1 for ( i=0; i<RBUFSIZE; i++)
*** ERROR C202 IN LINE 95 OF INITIAL.C: 'RBUFSIZE': undefined identifier
96 1 RData[i]=0; //串口接收数据缓冲区定义为30字节
*** ERROR C202 IN LINE 96 OF INITIAL.C: 'RData': undefined identifier
97 1 for ( i=0; i<SBUFSIZE; i++)
*** ERROR C202 IN LINE 97 OF INITIAL.C: 'SBUFSIZE': undefined identifier
98 1 SData[i]=0; //串口接收数据缓冲区定义为30字节
*** ERROR C202 IN LINE 98 OF INITIAL.C: 'SData': undefined identifier
99 1 Pos = 0;
*** ERROR C202 IN LINE 99 OF INITIAL.C: 'Pos': undefined identifier
100 1 DataNo = 0;
*** ERROR C202 IN LINE 100 OF INITIAL.C: 'DataNo': undefined identifier
101 1 RECVTIMES=0;
*** ERROR C202 IN LINE 101 OF INITIAL.C: 'RECVTIMES': undefined identifier
102 1 DataSended=0;
*** ERROR C202 IN LINE 102 OF INITIAL.C: 'DataSended': undefined identifier
103 1 TestVar=0;
*** ERROR C202 IN LINE 103 OF INITIAL.C: 'TestVar': undefined identifier
104 1 Head=0;
*** ERROR C202 IN LINE 104 OF INITIAL.C: 'Head': undefined identifier
105 1 }
C51 COMPILATION COMPLETE. 0 WARNING(S), 62 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -