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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
09/28/00 14:34
Read: times


 
#5386 - RE: Software Reset.
Hi Craig,

this question seems ever be a topic.
How about a point in the tutorial about this ?


Hi Leonid,

it seems, you want to force a reset from an interrupt handler.
Then a new interrupt can never be entered, before a RETI was executed.

Solution:
Define an unused interrupt function and call it before you jump to 0x0000. Since 2 interrupt priorities on the 8051, also 2 interrupts can be in execution. So call it twice to finish both.
See the C example below:

#define CALL(addr) (((void(*)(void))(char code *)addr)())

void reti(void) interrupt 31{}

void softreset(void)
{
CALL( reti ); // clear interrupt hardware for high priority
CALL( reti ); // clear interrupt hardware for low priority
CALL( 0x0000 ); // reset
}


Peter


List of 2 messages in thread
TopicAuthorDate
Software Reset.            01/01/70 00:00      
RE: Software Reset.            01/01/70 00:00      

Back to Subject List