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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
08/16/01 21:18
Read: times


 
#14170 - RE: Sans: CPU reset by SW
Hello Oleg.

void SoftResetMicro (void)
{
_asm
mov IE,#0x0
pop ACC
pop ACC
mov ACC,#0x00
push ACC
push ACC
reti
_endasm;
}


This routine will surely do the trick you are looking for.

I have used it myself and it works perfectly.

After executing this routine the PC will have been loaded with 0000h, so a reset is in effect. PC will get the address stored in the stack and then it will jump to it because of the reti instruction.

You might want to use a routine that will clear some registers. That can be done before or after the reset, depending on what your program does. Always set the SP register after reset to a specific value, or else you will be in serious debugging trouble.


Panos Kenterlis
Computer Systems Engineer
Greece

List of 18 messages in thread
TopicAuthorDate
CPU reset by SW            01/01/70 00:00      
RE: CPU reset by SW            01/01/70 00:00      
RE: CPU reset by SW            01/01/70 00:00      
RE: CPU reset by SW            01/01/70 00:00      
RE: CPU reset by SW            01/01/70 00:00      
RE: CPU reset by SW            01/01/70 00:00      
RE: CPU reset by SW            01/01/70 00:00      
RE: Michal: CPU reset by SW            01/01/70 00:00      
RE: Sans: CPU reset by SW            01/01/70 00:00      
RE: Sans: CPU reset by SW            01/01/70 00:00      
RE:San Brgmns: CPU reset by SW            01/01/70 00:00      
RE: RE:San Brgmns: CPU reset by SW            01/01/70 00:00      
RE: Sans: CPU reset by SW            01/01/70 00:00      
RE: CPU reset by SW            01/01/70 00:00      
RE: CPU reset by SW            01/01/70 00:00      
RE: CPU reset by SW            01/01/70 00:00      
RE: CPU reset by SW            01/01/70 00:00      
RE: CPU reset by SW            01/01/70 00:00      

Back to Subject List