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 Timer of ADUC842

Dear sir,

I am using ADUC842 for my design.
I want to set watchdog timer of 2 sec for any errorneous condition.

In my main function, i have enabled all interrupts already...

I need to configure watchdog timer.

But before that i should disable all the interrupts,set the watchdog timer and again enable the interrupts.
since i have enabled all interrupts,i cant configure watchdog timer in the main function.

where should i configure the watchdog timer
? pls help.

Regards,
Mayuri G

Parents
  • CLR EA         //disable interrupts while writing
    SETB WDWR      //allow write to WDCON
    MOV WDCON,#72H //enable WDT for 2.0s timeout
    SETB EA        //enable interrupts again (if rqd)
    

    How long, exactly, do you think that code sequence takes to execute?

    You only need to do it once- at startup.

    Do you really think that it will make any significant difference if you do this immediately before you enable your other interrupts??

    "if i clear my interrupts,den my ISRs wont be executed"

    Until you enable them again!!

    "i need to keep my interrupts on always"

    See above - you only need to do this once, and only at the very start of your code - where is the problem in that?!

Reply
  • CLR EA         //disable interrupts while writing
    SETB WDWR      //allow write to WDCON
    MOV WDCON,#72H //enable WDT for 2.0s timeout
    SETB EA        //enable interrupts again (if rqd)
    

    How long, exactly, do you think that code sequence takes to execute?

    You only need to do it once- at startup.

    Do you really think that it will make any significant difference if you do this immediately before you enable your other interrupts??

    "if i clear my interrupts,den my ISRs wont be executed"

    Until you enable them again!!

    "i need to keep my interrupts on always"

    See above - you only need to do this once, and only at the very start of your code - where is the problem in that?!

Children