?? main.lst
字號:
167 1 /// Initialization of the SYSCON0 Register:
168 1 /// ---------------------------------------------------------------------
169 1
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 /// clock prescaler for PD+ bus is fcpu / 1
178 1
179 1 //// this register must be set in the start-up file
C166 COMPILER V6.02, MAIN 08/08/2006 15:48:03 PAGE 4
180 1 //// SYSCON1 = 0x0000
181 1
182 1 /// ---------------------------------------------------------------------
183 1 /// Initialization of the SYSCON3 Register:
184 1 /// ---------------------------------------------------------------------
185 1
186 1 //// this register must be set in the start-up file
187 1 //// SYSCON3 = 0x0000
188 1
189 1 //// -----------------------------------------------------------------------
190 1 //// End of Important Settings for the Start-Up File
191 1 //// -----------------------------------------------------------------------
192 1
193 1
194 1 // -----------------------------------------------------------------------
195 1 // Initialization of the Peripherals:
196 1 // -----------------------------------------------------------------------
197 1
198 1 // initializes the Capture / Compare Unit 6 (CCU6)
199 1 CCU6_vInit();
200 1
201 1 // initializes the Analog / Digital Converter (ADC)
202 1 ADC_vInit();
203 1
204 1 // initializes the Interrupt Controller (INT)
205 1 INT_vInit();
206 1
207 1 // USER CODE BEGIN (Init,3)
208 1
209 1 // USER CODE END
210 1
211 1 // globally enable interrupts
212 1 PSW_IEN = 1;
213 1
214 1 } // End of function MAIN_vInit
215
216
217 //****************************************************************************
218 // @Function void MAIN_vUnlockProtecReg(void)
219 //
220 //----------------------------------------------------------------------------
221 // @Description This function makes it possible to write one protected
222 // register. After calling of this function and write on the
223 // protected register is the security level set to low
224 // protected mode.
225 //
226 //----------------------------------------------------------------------------
227 // @Returnvalue None
228 //
229 //----------------------------------------------------------------------------
230 // @Parameters None
231 //
232 //----------------------------------------------------------------------------
233 // @Date 2006-7-8
234 //
235 //****************************************************************************
236
237 // USER CODE BEGIN (UnlockProtecReg,1)
238
239 // USER CODE END
240
241 void MAIN_vUnlockProtecReg(void)
C166 COMPILER V6.02, MAIN 08/08/2006 15:48:03 PAGE 5
242 {
243 1 ubyte ubPASSWORD;
244 1
245 1 if((SCUSLS & 0x1800) == 0x0800) // if low protected mode
246 1 {
247 2
248 2 ubPASSWORD = SCUSLS & 0x00FF;
*** WARNING C192 IN LINE 248 OF MAIN.C: '=': value truncated
249 2 ubPASSWORD = ~ubPASSWORD;
250 2 SCUSLC = 0x8E00 | ubPASSWORD; // command 4
251 2
252 2 } // end if low protected mode
253 1
254 1 if((SCUSLS & 0x1800) == 0x1800) // if write protected mode
255 1 {
256 2 SCUSLC = 0xAAAA; // command 0
257 2 SCUSLC = 0x5554; // command 1
258 2
259 2 ubPASSWORD = SCUSLS & 0x00FF;
*** WARNING C192 IN LINE 259 OF MAIN.C: '=': value truncated
260 2 ubPASSWORD = ~ubPASSWORD;
261 2
262 2 SCUSLC = 0x9600 | ubPASSWORD; // command 2
263 2 SCUSLC = 0x0800; // command 3; new PASSWOR is 0x00
264 2
265 2 ubPASSWORD = SCUSLS & 0x00FF;
*** WARNING C192 IN LINE 265 OF MAIN.C: '=': value truncated
266 2 ubPASSWORD = ~ubPASSWORD;
267 2 SCUSLC = 0x8E00 | ubPASSWORD; // command 4
268 2
269 2 } // end if write protected mode
270 1
271 1 } // End of function MAIN_vUnlockProtecReg
272
273
274 //****************************************************************************
275 // @Function void main(void)
276 //
277 //----------------------------------------------------------------------------
278 // @Description This is the main function.
279 //
280 //----------------------------------------------------------------------------
281 // @Returnvalue None
282 //
283 //----------------------------------------------------------------------------
284 // @Parameters None
285 //
286 //----------------------------------------------------------------------------
287 // @Date 2006-7-8
288 //
289 //****************************************************************************
290
291 // USER CODE BEGIN (Main,1)
292
293 // USER CODE END
294
295 void main(void)
296 {
297 1 // USER CODE BEGIN (Main,2)
298 1
299 1 // USER CODE END
300 1
C166 COMPILER V6.02, MAIN 08/08/2006 15:48:03 PAGE 6
301 1 MAIN_vInit();
302 1
303 1 // USER CODE BEGIN (Main,4)
304 1 while(1);
305 1 // USER CODE END
306 1
307 1 } // End of function main
308
309
310
311 // USER CODE BEGIN (MAIN_General,10)
312
313 // USER CODE END
314
MODULE INFORMATION: INITIALIZED UNINITIALIZED
CODE SIZE = 140 --------
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. 3 WARNING(S), 0 ERROR(S)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -