📄 9e5quickbootloader.lst
字号:
C51 COMPILER V8.05a 9E5QUICKBOOTLOADER 03/08/2007 09:20:43 PAGE 1
C51 COMPILER V8.05a, COMPILATION OF MODULE 9E5QUICKBOOTLOADER
OBJECT MODULE PLACED IN .\object\9E5QuickBootLoader.obj
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE 9E5QuickBootLoader.c ROM(SMALL) OPTIMIZE(9,SIZE) BROWSE DEBUG OBJECTEXTEND
-OBJECT(.\object\9E5QuickBootLoader.obj)
line level source
1 /*===============================================================================================
2 *
3 * Copyright (C) 2004
4 *
5 * This file is distributed in the hope that it will be useful, but WITHOUT
6 * WARRANTY OF ANY KIND.
7 *
8 * Author(s):
9 *
10 * DESCRIPTION: for nRF9E5
11 *
12 * nRF9E5/nRF24E1 range demo. Select receiver by shorting P03 and P05 and transmitter by shorting
13 * P05 and P06. Uncomment/comment the appropriate #define below to select nRF9E5 or nRF24E1.
14 *
15 * The transmitter continously send one byte packets. Each time the receiver receives a packet the
16 * P00 pin is set low (LED1 is turned on on the 9E5 eval board). At the same time a 20ms timer is
17 * started and if a new packets is not received before the 20ms time-out the P00 pin is set high
18 * (LED1 is turned off). If a new packet is received before the time-out a new 20ms time-out period
19 * is started.
20 *
21 * Please remember to turn off the RS232 switch on the receiver and transmitter boards. On the
22 * nRF9E5 board turn off all dip-switches on the transmitter and turn on only the LED1 switch on
23 * the receiver.
24 *
25 * COMPILER:
26 *
27 * This program has been tested with Keil C51 V7.09
28 *
29 * $Revision: 1 $
30 *
31 *==================================================================================================
32 */
33 // Comment out the following line for nRF24E1
34 #include "reg9e5.h"
35 #include "serial.h"
36 #include "spi.h"
37 #include "timer0.h"
38 #include "25lc320.h"
39 #include "PubFunc.h"
40 #include "xmodem.h"
41
42 extern void SwitchToAppBank();
43 extern void CopyUserProgram(void);
44
45 BYTE code UpDataStr[] = "\r\nBoot Ver: 1.00\n\r";
46 void updata(void)
47 {
48 1 CUSTOM_TIMER tmrWaiting;
49 1 SetCustomTimer(&tmrWaiting, SECONDS(3));
50 1 while (!IsTimeOut(&tmrWaiting)) {
51 2 if (XmodemRecvBuf[0] == 'U' || XmodemRecvBuf[0] == 'u') {
52 3 SIOSendData("\r\nCompile Time :", sizeof("\r\nCompile Time :"));
53 3 SIOSendData(__DATE__, sizeof(__DATE__));
54 3 SIOSendData(" ",1);
C51 COMPILER V8.05a 9E5QUICKBOOTLOADER 03/08/2007 09:20:43 PAGE 2
55 3 SIOSendData(__TIME__, sizeof(__TIME__));
56 3 SIOSendData(UpDataStr, sizeof(UpDataStr));
57 3
58 3
59 3 xmodem();
60 3 // SIOSendData("Program Swith\r\n",sizeof("Program Swith\r\n"));
61 3 }
62 2 serial_recv_num=0;
63 2 }
64 1 }
65
66 void init(void)
67 {
68 1 BYTE data buf[2];
69 1
70 1 //uart initial
71 1 SCON = 0x50; // Serial mode1, enable receiver
72 1 TMOD = TMOD & 0x0F | 0x20; // Timer1 8bit auto reload
73 1 PCON = PCON | 0x80; // SMOD=1 (double baud rate)
74 1 #ifdef TIME1_4CLK_INTERVAL
75 1 CKCON |= 0x10; // T1M=1 (/4 timer clock)
76 1 TH1 = TIME1;// 0xF3; // 19200@16MHz (when T1M=1 and SMOD=1)
77 1 #else
CKCON &= 0xEF;
#endif
80 1 TR1 = 1; // Start timer1
81 1
82 1 P0_ALT |= 0x06; // Select alternate functions on pins P0.1 and P0.2
83 1 P0_DIR = 0xE2; // P0.0 out,P0.1 input(RXD),P0.2 P0.3 P0.4 output,P0.5 P0.6 P0.7 input
84 1 ES = 1;
85 1 serial_recv_num=0; //number of serial recev buffer
86 1
87 1 //init timer0
88 1 TR0 = 0;
89 1 TMOD |= 0x01;
90 1 #ifdef TIME0_4CLK_INTERVAL
91 1 CKCON |= 0x08;
92 1 #else
CKCON &= 0xF7;
#endif
95 1 TR0 = 0;
96 1 RELOAD_TIMER0
97 1 TR0 = 1; // 启动定时器
98 1 ET0 = 1;
99 1 gwSystemTime=0;
100 1 EA = 1; //int open
101 1
102 1 //init clk
103 1 ChoiceSPIModule(INTERNAL);
104 1 buf[0] = RRC | 0x09;
105 1 SPIReadWrite(buf, 2);
106 1
107 1 buf[1] &= 0xC3;
108 1 buf[1] |= 0x1C;
109 1
110 1 buf[0] = WRC | 0x09;
111 1 SPIReadWrite(buf, 2);
112 1
113 1 }
114
115 void main(void)
116 {
C51 COMPILER V8.05a 9E5QUICKBOOTLOADER 03/08/2007 09:20:43 PAGE 3
117 1 init();
118 1 Init25lc320();
119 1
120 1 updata();
121 1
122 1 SwitchToAppBank(); //copy copyprogram to 0x0FA0
123 1 ChoiceSPIModule(EXTERNAL);
124 1 CopyUserProgram(); //copy user program to 0x0000
125 1
126 1 }
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 180 ----
CONSTANT SIZE = 59 ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = ---- 7
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 + -