📄 main.lst
字号:
164 1 //// VECSEG = 0x00C0
165 1
166 1 /// ---------------------------------------------------------------------
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/28/2006 09:54:58 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 2 (CAPCOM2)
199 1 CC2_vInit();
200 1
201 1 // USER CODE BEGIN (Init,3)
202 1
203 1 // USER CODE END
204 1
205 1 // globally enable interrupts
206 1 PSW_IEN = 1;
207 1
208 1 } // End of function MAIN_vInit
209
210
211 //****************************************************************************
212 // @Function void MAIN_vUnlockProtecReg(void)
213 //
214 //----------------------------------------------------------------------------
215 // @Description This function makes it possible to write one protected
216 // register. After calling of this function and write on the
217 // protected register is the security level set to low
218 // protected mode.
219 //
220 //----------------------------------------------------------------------------
221 // @Returnvalue None
222 //
223 //----------------------------------------------------------------------------
224 // @Parameters None
225 //
226 //----------------------------------------------------------------------------
227 // @Date 2006-8-25
228 //
229 //****************************************************************************
230
231 // USER CODE BEGIN (UnlockProtecReg,1)
232
233 // USER CODE END
234
235 void MAIN_vUnlockProtecReg(void)
236 {
237 1 ubyte ubPASSWORD;
238 1
239 1 if((SCUSLS & 0x1800) == 0x0800) // if low protected mode
240 1 {
241 2
C166 COMPILER V6.02, MAIN 08/28/2006 09:54:58 PAGE 5
242 2 ubPASSWORD = SCUSLS & 0x00FF;
*** WARNING C192 IN LINE 242 OF MAIN.C: '=': value truncated
243 2 ubPASSWORD = ~ubPASSWORD;
244 2 SCUSLC = 0x8E00 | ubPASSWORD; // command 4
245 2
246 2 } // end if low protected mode
247 1
248 1 if((SCUSLS & 0x1800) == 0x1800) // if write protected mode
249 1 {
250 2 SCUSLC = 0xAAAA; // command 0
251 2 SCUSLC = 0x5554; // command 1
252 2
253 2 ubPASSWORD = SCUSLS & 0x00FF;
*** WARNING C192 IN LINE 253 OF MAIN.C: '=': value truncated
254 2 ubPASSWORD = ~ubPASSWORD;
255 2
256 2 SCUSLC = 0x9600 | ubPASSWORD; // command 2
257 2 SCUSLC = 0x0800; // command 3; new PASSWOR is 0x00
258 2
259 2 ubPASSWORD = SCUSLS & 0x00FF;
*** WARNING C192 IN LINE 259 OF MAIN.C: '=': value truncated
260 2 ubPASSWORD = ~ubPASSWORD;
261 2 SCUSLC = 0x8E00 | ubPASSWORD; // command 4
262 2
263 2 } // end if write protected mode
264 1
265 1 } // End of function MAIN_vUnlockProtecReg
266
267
268 //****************************************************************************
269 // @Function void main(void)
270 //
271 //----------------------------------------------------------------------------
272 // @Description This is the main function.
273 //
274 //----------------------------------------------------------------------------
275 // @Returnvalue None
276 //
277 //----------------------------------------------------------------------------
278 // @Parameters None
279 //
280 //----------------------------------------------------------------------------
281 // @Date 2006-8-25
282 //
283 //****************************************************************************
284
285 // USER CODE BEGIN (Main,1)
286
287 // USER CODE END
288
289 void main(void)
290 {
291 1 // USER CODE BEGIN (Main,2)
292 1
293 1 // USER CODE END
294 1
295 1 MAIN_vInit();
296 1
297 1 // USER CODE BEGIN (Main,4)
298 1 while(1) {};
299 1 // USER CODE END
300 1
C166 COMPILER V6.02, MAIN 08/28/2006 09:54:58 PAGE 6
301 1 } // End of function main
302
303
304
305 // USER CODE BEGIN (MAIN_General,10)
306
307 // USER CODE END
308
MODULE INFORMATION: INITIALIZED UNINITIALIZED
CODE SIZE = 132 --------
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 + -