📄 main.lst
字号:
191 1
192 1 //// this register must be set in the start-up file
193 1 //// EBCMOD1 = 0x000F
194 1
195 1 /// EBC is enabled
196 1 /// pin #BHE is enabled
197 1 /// #WR and #BHE retain their normal function
198 1 /// pin ALE is disabled
199 1 /// as segment address are 2 pins enabled ( A[17] .. A[16] )
200 1 /// #CS1 .. #CS0 are enabled
201 1 /// pin #READY is disabled
202 1 /// bus arbitration is disabled, P6.7 .. P6.5 may used for general
203 1 /// purpose IO
204 1
205 1 //// this register must be set in the start-up file
206 1 //// EBCMOD0 = 0x6022
207 1
208 1 /// ---------------------------------------------------------------------
209 1 /// ---------- chip select 0 is enabled ----------
210 1 /// ---------------------------------------------------------------------
211 1 /// - 16-bit Multiplexed Bus
212 1 /// access time is controlled by bitfield PHE0
213 1
214 1 //// this register must be set in the start-up file
215 1 //// FCONCS0 = 0x0031
216 1
217 1 /// Phase A: 3 clock cycles
218 1 /// Phase B: 1 clock cycles
219 1 /// Phase C: 0 clock cycles
220 1 /// Phase D: 0 clock cycles
221 1 /// Phase E: 10 clock cycles
222 1 /// Read Phase F: 0 clock cycles
223 1 /// Write Phase F: 3 clock cycles
224 1
225 1 //// this register must be set in the start-up file
226 1 //// TCONCS0 = 0x6243
227 1
228 1 /// ---------------------------------------------------------------------
229 1 /// ---------- chip select 1 is disabled ----------
230 1 /// ---------------------------------------------------------------------
231 1
232 1
233 1 /// ---------------------------------------------------------------------
234 1 /// ---------- chip select 2 is disabled ----------
235 1 /// ---------------------------------------------------------------------
236 1
237 1
238 1 /// ---------------------------------------------------------------------
239 1 /// ---------- chip select 3 is disabled ----------
240 1 /// ---------------------------------------------------------------------
241 1
C166 COMPILER V6.08, MAIN 09/12/2008 14:53:44 PAGE 5
242 1
243 1 //// -----------------------------------------------------------------------
244 1 //// End of Important Settings for the Start-Up File
245 1 //// -----------------------------------------------------------------------
246 1
247 1
248 1 // -----------------------------------------------------------------------
249 1 // Initialization of the Peripherals:
250 1 // -----------------------------------------------------------------------
251 1
252 1 // initializes the Parallel Ports
253 1 IO_vInit();
254 1
255 1 // initializes the General Purpose Timer Unit (GPT1)
256 1 GPT1_vInit();
257 1
258 1 // USER CODE BEGIN (Init,3)
259 1
260 1 // USER CODE END
261 1
262 1 // globally enable interrupts
263 1 PSW_IEN = 1;
264 1
265 1 } // End of function MAIN_vInit
266
267
268 //****************************************************************************
269 // @Function void MAIN_vUnlockProtecReg(void)
270 //
271 //----------------------------------------------------------------------------
272 // @Description This function makes it possible to write one protected
273 // register. After calling of this function and write on the
274 // protected register is the security level set to low
275 // protected mode.
276 //
277 //----------------------------------------------------------------------------
278 // @Returnvalue None
279 //
280 //----------------------------------------------------------------------------
281 // @Parameters None
282 //
283 //----------------------------------------------------------------------------
284 // @Date 2006-07-27
285 //
286 //****************************************************************************
287
288 // USER CODE BEGIN (UnlockProtecReg,1)
289
290 // USER CODE END
291
292 void MAIN_vUnlockProtecReg(void)
293 {
294 1 uword ubPASSWORD;
295 1
296 1 if((SCUSLS & 0x1800) == 0x0800) // if low protected mode
297 1 {
298 2
299 2 ubPASSWORD = SCUSLS & 0x00FF;
300 2 ubPASSWORD = ~ubPASSWORD;
301 2 SCUSLC = 0x8E00 | ubPASSWORD; // command 4
302 2
303 2 } // end if low protected mode
C166 COMPILER V6.08, MAIN 09/12/2008 14:53:44 PAGE 6
304 1
305 1 if((SCUSLS & 0x1800) == 0x1800) // if write protected mode
306 1 {
307 2 SCUSLC = 0xAAAA; // command 0
308 2 SCUSLC = 0x5554; // command 1
309 2
310 2 ubPASSWORD = SCUSLS & 0x00FF;
311 2 ubPASSWORD = ~ubPASSWORD;
312 2
313 2 SCUSLC = 0x9600 | ubPASSWORD; // command 2
314 2 SCUSLC = 0x0800; // command 3; new PASSWOR is 0x00
315 2
316 2 ubPASSWORD = SCUSLS & 0x00FF;
317 2 ubPASSWORD = ~ubPASSWORD;
318 2 SCUSLC = 0x8E00 | ubPASSWORD; // command 4
319 2
320 2 } // end if write protected mode
321 1
322 1 } // End of function MAIN_vUnlockProtecReg
323
324
325 //****************************************************************************
326 // @Function void main(void)
327 //
328 //----------------------------------------------------------------------------
329 // @Description This is the main function.
330 //
331 //----------------------------------------------------------------------------
332 // @Returnvalue None
333 //
334 //----------------------------------------------------------------------------
335 // @Parameters None
336 //
337 //----------------------------------------------------------------------------
338 // @Date 2006-07-27
339 //
340 //****************************************************************************
341
342 // USER CODE BEGIN (Main,1)
343
344 // USER CODE END
345
346 void main(void)
347 {
348 1 // USER CODE BEGIN (Main,2)
349 1
350 1 // USER CODE END
351 1
352 1 MAIN_vInit();
353 1
354 1 // USER CODE BEGIN (Main,4)
355 1 while(1)
356 1 {
357 2 }
358 1 // USER CODE END
359 1
360 1 } // End of function main
361
362
363
364 // USER CODE BEGIN (MAIN_General,10)
365
C166 COMPILER V6.08, MAIN 09/12/2008 14:53:44 PAGE 7
366 // USER CODE END
367
MODULE INFORMATION: INITIALIZED UNINITIALIZED
CODE SIZE = 136 --------
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 + -