| ??? 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 |
| Topic | Author | Date |
| 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 |



