📄 main.lst
字号:
170 1 //// this register must be set in the start-up file
171 1 //// SYSCON0 = 0x0000
172 1
173 1 /// ---------------------------------------------------------------------
174 1 /// Initialization of the SYSCON1 Register:
175 1 /// ---------------------------------------------------------------------
176 1 /// clock prescaler for system is fpll / 1
177 1
178 1 //// this register must be set in the start-up file
179 1 //// SYSCON1 = 0x0000
C166 COMPILER V6.04, MAIN 08/30/2007 14:28:44 PAGE 4
180 1
181 1 /// ---------------------------------------------------------------------
182 1 /// Initialization of the SYSCON3 Register:
183 1 /// ---------------------------------------------------------------------
184 1
185 1 //// this register must be set in the start-up file
186 1 //// SYSCON3 = 0x0000
187 1
188 1 /// ---------------------------------------------------------------------
189 1 /// Initialization of EBC
190 1 /// ---------------------------------------------------------------------
191 1
192 1 //// this register must be set in the start-up file
193 1 //// EBCMOD1 = 0x007F
194 1
195 1 /// EBC is disabled
196 1 //// -----------------------------------------------------------------------
197 1 //// End of Important Settings for the Start-Up File
198 1 //// -----------------------------------------------------------------------
199 1
200 1
201 1 // -----------------------------------------------------------------------
202 1 // Initialization of the Peripherals:
203 1 // -----------------------------------------------------------------------
204 1
205 1 // initializes the Parallel Ports
206 1 IO_vInit();
207 1
208 1 // initializes the Asynchronous/Synchronous Serial Interface 0 (ASC0)
209 1 ASC0_vInit();
210 1
211 1 // initializes the General Purpose Timer Unit (GPT1)
212 1 GPT1_vInit();
213 1
214 1 // USER CODE BEGIN (Init,3)
215 1
216 1 // USER CODE END
217 1
218 1 // globally enable interrupts
219 1 PSW_IEN = 1;
220 1
221 1 } // End of function MAIN_vInit
222
223
224 //****************************************************************************
225 // @Function void MAIN_vUnlockProtecReg(void)
226 //
227 //----------------------------------------------------------------------------
228 // @Description This function makes it possible to write one protected
229 // register. After calling of this function and write on the
230 // protected register is the security level set to low
231 // protected mode.
232 //
233 //----------------------------------------------------------------------------
234 // @Returnvalue None
235 //
236 //----------------------------------------------------------------------------
237 // @Parameters None
238 //
239 //----------------------------------------------------------------------------
240 // @Date 2007-5-25
241 //
C166 COMPILER V6.04, MAIN 08/30/2007 14:28:44 PAGE 5
242 //****************************************************************************
243
244 // USER CODE BEGIN (UnlockProtecReg,1)
245
246 // USER CODE END
247
248 void MAIN_vUnlockProtecReg(void)
249 {
250 1 uword ubPASSWORD;
251 1
252 1 if((SCUSLS & 0x1800) == 0x0800) // if low protected mode
253 1 {
254 2
255 2 ubPASSWORD = SCUSLS & 0x00FF;
256 2 ubPASSWORD = ~ubPASSWORD;
257 2 SCUSLC = 0x8E00 | ubPASSWORD; // command 4
258 2
259 2 } // end if low protected mode
260 1
261 1 if((SCUSLS & 0x1800) == 0x1800) // if write protected mode
262 1 {
263 2 SCUSLC = 0xAAAA; // command 0
264 2 SCUSLC = 0x5554; // command 1
265 2
266 2 ubPASSWORD = SCUSLS & 0x00FF;
267 2 ubPASSWORD = ~ubPASSWORD;
268 2
269 2 SCUSLC = 0x9600 | ubPASSWORD; // command 2
270 2 SCUSLC = 0x0800; // command 3; new PASSWOR is 0x00
271 2
272 2 ubPASSWORD = SCUSLS & 0x00FF;
273 2 ubPASSWORD = ~ubPASSWORD;
274 2 SCUSLC = 0x8E00 | ubPASSWORD; // command 4
275 2
276 2 } // end if write protected mode
277 1
278 1 } // End of function MAIN_vUnlockProtecReg
279
280
281 //****************************************************************************
282 // @Function void main(void)
283 //
284 //----------------------------------------------------------------------------
285 // @Description This is the main function.
286 //
287 //----------------------------------------------------------------------------
288 // @Returnvalue None
289 //
290 //----------------------------------------------------------------------------
291 // @Parameters None
292 //
293 //----------------------------------------------------------------------------
294 // @Date 2007-5-25
295 //
296 //****************************************************************************
297
298 // USER CODE BEGIN (Main,1)
299
300 // USER CODE END
301
302 void main(void)
303 {
C166 COMPILER V6.04, MAIN 08/30/2007 14:28:44 PAGE 6
304 1 // USER CODE BEGIN (Main,2)
305 1
306 1 // USER CODE END
307 1
308 1 MAIN_vInit();
309 1
310 1 // USER CODE BEGIN (Main,4)
311 1 ASC0_TIC_IR = 1;
312 1
313 1 while(1);
314 1 // USER CODE END
315 1
316 1 } // End of function main
317
318
319
320 // USER CODE BEGIN (MAIN_General,10)
321
322 // USER CODE END
323
MODULE INFORMATION: INITIALIZED UNINITIALIZED
CODE SIZE = 142 --------
NEAR-CONST SIZE = -------- --------
FAR-CONST SIZE = -------- --------
HUGE-CONST SIZE = -------- --------
XHUGE-CONST SIZE = -------- --------
NEAR-DATA SIZE = -------- --------
FAR-DATA SIZE = -------- --------
XHUGE-DATA SIZE = -------- --------
IDATA-DATA SIZE = -------- --------
SDATA-DATA SIZE = -------- --------
BDATA-DATA SIZE = -------- --------
HUGE-DATA SIZE = -------- --------
BIT SIZE = -------- --------
INIT'L SIZE = -------- --------
END OF MODULE INFORMATION.
C166 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -