This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Watchdog relation and interrupt 0

Hello,

I have a problem when i disable the watchdog

// WDTCN = 0x0DE; // WDTCN = 0x0AD;

at the begining of the main. I put a breakpoint at the external interrupt 0. It will never go in and stop at the breakpoint. When i stop the program. I will stay inside the while loop and I checked the interrupt peripheral, it seems that interrupt 0 has been requested.

This problem will not happen when I enable the watchdog in the begining of the main.

WDTCN = 0xFF; // lock out the watchdog disable feature WDTCN = 0xA5; // enable and restart watchdog timer

Anybody has any idea about this?

  • Aren't we even supposed to know which processor you have?

  • I am using Silicon Labs C8051F121 now.

  • I have a problem when i disable the watchdog

    // WDTCN = 0x0DE; // WDTCN = 0x0AD;

    I am using Silicon Labs C8051F121 now

    You are mixing devices
    the f12x has a separate watchdog it is not automatically enabled, so no disable required.

    The SILabs deviates (f3x -up) has the old Intel "PCA dog" which, is not a real a watchdog, but some cheap substitute (can way too easily be disabled), that one is automatically enabled and must (in most cases) be disabled in startup.a51

    I guess you mean stopped at a breakpoint at the begining of the main. I put a breakpoint at the external interrupt 0.

    does the event you are looking for happen AFTER you set the breakpoint and run.

    another, typical reason for "does not work from power-up, but works from reset" is uninitalized variables.

    post the values of IE, 0, 1, TMOD and TCON shown in the debugger when it works and when it does not.

    Another possibility: What is the contents SFRPAGE at the beginning of main in cases a and b, that would be a typical uninitalized variable.

    By the way, would it not be more natural to post a question that has nothing to do with Keil and only SILabs chips at the SILabs forum? Anyhow, not it has happened, keep it here.

    Erik

  • the old Intel "PCA dog" which, is not a real a watchdog, but some cheap substitute (can way too easily be disabled) by a single write to PCA0MD which may set 'external clock' which you do not have.

    Erik

  • Hi Erik,

    THanks for the reply. I will try to work up from there.

    It seems like it just couldn't stop at the interrupt 0 (breakpoint i have set) if i disable the watchdog at the beginning of the program.

  • post the values after the thing has run a while of IE, 0, 1, TMOD and TCON as shown in the debugger when it works and when it does not.