??? 09/27/04 13:35 Read: times |
#78206 - RE: p89c51rd2 ISP Worked Responding to: ???'s previous message |
Worked beautifully
When I ground p1.0 and reset it enters ISP mode and flash magic works else the program keeps executing I have pasted the shabby piece of code, which i used to verify if it works. I checked he O/p of p2.0 & 2.1 with a logic probe. it keeps getting complemented after delay. Thank you very much everyone.. Deepak $mod51 org 0000h sjmp main VAR1 EQU R0 VAR2 EQU R1 VAR3 EQU R2 ;************************************************* ;****1Sec Delay routine**************** DELAY: MOV VAR3,#8 MOV VAR2,#8 MOV VAR1,#236 TT1: DJNZ VAR1,TT1 DJNZ VAR2,TT1 DJNZ VAR3,TT1 RET ;****End of Delay routine ************* main: jnb p1.0,ISP_Boot cpl p2.0 cpl p2.1 call delay call delay sjmp main ISP_Boot: AUXR1 DATA 0A2h ; WDTRST DATA 0A6h ; GoToBoot: mov AUXR1,#020h ;enable boot mov r0,#11 ;oscillator freq = 20Mhz mov r1,#6h ;program status byte mov dptr,#0 ;specify status byte mov a,#0ffh ;nonzero required call 0fff0h jmp $ ;wait for watchdog to reset end Deepak |