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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
07/03/00 06:29
Read: times


 
#3519 - RE: 8051 software watchdog
Hi Chaithana,

oh, oh, oh, ...
why nobody read the damned data book (Philips, Atmel, ...)
:-)
:-)
:-)

"Execution proceeds from that location unti l the RETI
instruction is encountered. The RETI instruction informs the
processor that this interrupt rout ine is no longer in
progress, then pops the top two bytes from the stack and
reloads the Program Counter. Execution of the interrupted
program continues from where it left off.
Note that a simple RET instruction would also have
returned execution to the interrupted program, but it would
have left the interrupt control system thinking an interrupt
was still in progress, making future interrupts impossible."

!!!


Conclusion:

Execute a RETI to reset the interrupt logic.
On using 2 interrupt priorities do it twice and
on 4 interrupt priorities (e.g. at the C505) 4 times:


Solution:

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

void reti(void) interrupt 31 {}

void main (void){
CALL( reti ); // clear interrupt hardware
CALL( reti ); // clear interrupt hardware
CALL( reti ); // clear interrupt hardware
CALL( reti ); // clear interrupt hardware

// rest of main

}


Peter


List of 4 messages in thread
TopicAuthorDate
8051 software watchdog            01/01/70 00:00      
RE: 8051 software watchdog            01/01/70 00:00      
RE: 8051 software watchdog            01/01/70 00:00      
RE: 8051 software watchdog            01/01/70 00:00      

Back to Subject List