??? 04/19/07 21:53 Read: times Msg Score: -1 -1 Message Not Useful |
#137566 - idea Responding to: ???'s previous message |
Lynn Reed said:
mov r1,#6h ;program status byte (No Watchdog!) mov dptr,#0 ;specify status byte mov a,#0ffh ;nonzero required call 0fff0h ; IAP Call to set status byte jmp $ ;wait for watchdog to reset When I look at that piece of code, it makes me think that there either must be a good piece of code at address FFF0h that handles R1, DPTR, and A, or you are missing something. If what you are intending to do is store something into external memory so that the next time the reset button is pressed, then you might want to try something like this: mov DPTR,#0000h movx A,@DPTR dec A jnz install jz wasreset continue: ;place the rest of your mainline code here wasreset: ;this routine is executed everytime the reset button is pressed ;after the program is executed for the first time. ljmp continue install: ; if the value of external ram address 0 is not 1 then ; set it to 1 and do appropiate functions. ; This routine happens every time the power is applied to the ; circuit for the first time. mov A,#1h movx @DPTR,A ljmp continue |