 | Discussion Forum |  |
|
|
Software reset C51 from interrupt routinesNext Thread | Thread List | Previous Thread Start a Thread | Settings | Details | Message |
|---|
Read-Only Author Mani Entezami Posted 7-Mar-2007 07:59 GMT Toolset C51 |  Software reset C51 from interrupt routines Mani Entezami You can use the void pointer function sample in simple programs but if you want to use software reset in interrupt routines you can act like this: by calling the int. routine and coming up your condition it will jump to 0x0000 Also the "addr" is unsigned char and SP set as compiler defaults.
void t0_service(void) interrupt 1 using 3 {
addr=SP;
/* Your Code */
PSW=0;
if( /*your condition to jump 0x0000*/ ){
*(unsigned char *)(addr)=0;
*(unsigned char *)(addr-1)=0;
*(unsigned char *)(addr-2)=0;
*(unsigned char *)(addr-3)=0;
*(unsigned char *)(addr-4)=0;
*(unsigned char *)(addr-5)=0;
*(unsigned char *)(addr-6)=0;
*(unsigned char *)(addr-7)=0;
return;
}
}
| | Read-Only Author Reinhard Keil Posted 7-Mar-2007 13:22 GMT Toolset C51 |  RE: Software reset C51 from interrupt routines Reinhard Keil http://www.keil.com/support/docs/307.htm | |
Next Thread | Thread List | Previous Thread Start a Thread | Settings |
|