ATmel T89C51AC2 have a watchdog and enable it at main() program. Sometime when cpu hang!! and not reset. How to insert watchdong sequence at ORG 0 or first execute instruction after reset. void main(void) { MACRO_ENABLE_WATCHDOG(); // sometime not self reset ..... ..... ... while(1) { ... ... ... } } ORG 0 MACRO_ENABLE_WATCHDOG(); STARTUP.A51(Clear RAM) main.c(run)
That would need to go into the startup code - in assembler. This is, of course, the fundamental flaw in having a watchdog that needs to be enabled by software!