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

Interval timer

I want to use a watchdog timer as an interval timer (and NOT for watchdog purposes). Can anyone throw light on how this can be done. Any help is appreciated.

Parents
  • Hi,
    I don't see any need why one has to use a watch dog timer as a interval timer ?

    But any way if you are using a AT89S8252,what you can do is program the watch dog timer using the PS3,PS1 and PS0 in the 0x96 register for the desired time(16 ms ,32 ms, 64 ms, 128 ms etc...).

    and in the code(on reset code),you need to check for the POF(POWER OFF Flag),this bit is set only if its a power on rest...

    I think from here you can start coding for yourself.If you find it difficult ...I 'll send you a document...

    Rgds
    Raj Shetgar

Reply
  • Hi,
    I don't see any need why one has to use a watch dog timer as a interval timer ?

    But any way if you are using a AT89S8252,what you can do is program the watch dog timer using the PS3,PS1 and PS0 in the 0x96 register for the desired time(16 ms ,32 ms, 64 ms, 128 ms etc...).

    and in the code(on reset code),you need to check for the POF(POWER OFF Flag),this bit is set only if its a power on rest...

    I think from here you can start coding for yourself.If you find it difficult ...I 'll send you a document...

    Rgds
    Raj Shetgar

Children
  • I want to use a watchdog timer as an interval timer (and NOT for watchdog purposes(
    1) a bad idea
    2) puppies are device dependent, what derivative do you use.
    3) how are you going to have a watchdog function (required for all decent code) if you use the WD for something else.

    Erik