Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
09/21/03 02:55
Read: times


 
#55060 - RE: trouble of using P89c51rb2
Responding to: ???'s previous message
Hi Lin,

Getting stuck in the ISP mode gives you some option to forcefully get out of it.

Your problem now is that the Status Byte happens to hold a non-zero value and the ENBOOT bit is also set ( somehow) and you enter ISP as soon as you reset

Just add this code snippet at the begining ( 000H ) of your existing code, downlaod the code and you should be able to come out of the ISP mode ( PSEN=High) :
WRSB: MOV 0A2H, #0  ;Clr the Enboot bit
      MOV R0, #6    ;Fosc - your crystal freq. here
      MOV R1, #06H  ;program status byte 
      MOV DPTR, #0  ;specify status byte
      MOV A, #0     ;zero status byte for code execution
      CALL 0FFF0H   ;execute the function


and once the issue is resolved, comment out the above code, else you will get stuck in Normal mode!

And to avoid such mess ups in future, use FlashMagic and a Reset controller for the MCU. These guys with on-board boot ROMs hate simple R-C resets. For that matter most MCUs are like that.

Raghu

List of 7 messages in thread
TopicAuthorDate
trouble of using P89c51rb2            01/01/70 00:00      
   RE: trouble of using P89c51rb2            01/01/70 00:00      
      RE: trouble of using P89c51rb2            01/01/70 00:00      
         RE: trouble of using P89c51rb2            01/01/70 00:00      
   RE: trouble of using P89c51rb2            01/01/70 00:00      
      RE: trouble of using P89c51rb2            01/01/70 00:00      
         RE: trouble of using P89c51rb2            01/01/70 00:00      

Back to Subject List