From: Fiorenzo D. R. <fd....@ti...> - 2003-02-20 13:14:33
|
----- Original Message ----- From: "Thorsten Godau" <tho...@gm...> To: <sdc...@li...> Sent: Thursday, February 20, 2003 1:13 PM Subject: [Sdcc-user] Proper warmboot routine? > has someone ever written a proper warmboot routine > for MCS51? Hello, my boot initializes all registers and clears internal RAM. Here an example for 89c51rx2 (in assembler) : ORG 0000h ; LJMP reset ;power-on/reset ; ; power-on/reset ; reset: MOV SP, #<stack begin> MOV P0, #11110000b MOV P1, #01111111b MOV P2, #11111111b MOV P3, #11111111b MOV PCON, #00010000b MOV TCON, #00000000b MOV RCAP2L, #LOW(-5) MOV RCAP2H, #HIGH(-5) MOV TL2, #LOW(-5) MOV TH2, #HIGH(-5) MOV T2MOD, #00000000b MOV T2CON, #00110100b MOV SCON, #11010000b MOV CCAP0L, #LOW(10000) MOV CCAP0H, #HIGH(10000) MOV CCAPM0, #01001101b MOV CCAPM1, #00000000b MOV CCAPM2, #00000000b MOV CCAPM3, #00000000b MOV CCAPM4, #00000000b MOV CMOD, #00000011b MOV CCON, #01000000b MOV AUXR, #00000000b MOV AUXR1, #00000000b MOV IE, #01010000b MOV IP, #00000000b MOV IPH, #00000000b MOV PSW, #00000000b MOV R0, #7Fh res_1: MOV @R0, #0 DJNZ R0, res_1 ; Fiorenzo Ramaglia Italy fd....@ti... |