We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi, I use AT89S52 in a project. I send and receive data through TXD, RXD pins to a GSM module for sending SMS to another mobile equipment. I use watchdog facility and the watchdog counter is reset at every 256 counts. My crystal frequency is 11.0592 MHz. It happens once in a while that the uC doesn't respond and remains as if it hangs. Then it has to be RESET again. I doubt whether it happens while serial data reception and sending happens simultaneously. I wrote the program in C using KEIL IDE. My questions are 1) What are the special precautions to be taken in this case?(sending and receiving simultaneously) 2)why this happens even when the watchdog is active? It will be highly appreciated if anybody can give some guidance.
I tried supervisor IC DS1232. Working well.It has got a watchdog also which is monitoring the ALE pin of my uC. I think, still it is better to use the internal watchdog also to avoid program getting stuck due to software issues. Am I right?
Am I right?
Quite the contrary. Using an external watchdog monitor guarantees correct behavior, once it is configured.
There are actually stupid internal watchdogs that are using the same clock source as the processor core. That means that if the processor clock stops, then the watchdog stops.
With an external watchdog, you know that it has independent timing. Even better is of couse an external watchdog that can't just reset the processor, but that can even power-cycle the processor.
So, as long as the processor keeps accessing external memory - eg, fetching instructions - the watchdog will not fire.
Does that really sound like a good idea to you?!
Quite the contrary. Using an external watchdog monitor guarantees correct behavior, once it is configured. I thought there will be a square waveform at ALE pin as long as the program is running. In such case running an infinite loop without updating the internal watchdog timer will not cause a rest unless the internal watchdog is also used. Is it not true?
I don't use an external memory. This is as per the application circuit given in the data sheet of DS1232. Is it not true that monitoring the ALE pin is enough to confirm whether the program is running?
Can you please elaborate this point a little more?
Not necessarily "square", but that's (probably) not important.
"In such case running an infinite loop without updating the internal watchdog timer will not cause a reset"
Incorrect: if the internal watchdog is properly enabled, it will cause a reset when it is not updated for any reason.
So, as noted previously, if your program is in a loop, and the wathdog is not causing a reset, there are two possible reasons:
1. The watchdog is not properly enabled;
2. Your software is updating the Watchdog - despite being stuck in a loop.
The benefit of an external watchdog is that No 1 cannot happen.
But updating an external watchdog from ALE most certanily will cause No 2!
It shows that the program is running - but, obviously, that includes when it is running in a loop!!
I think you have misunderstood the purpose of that "example" circuit!
Look again - carefully.
(if you also want others to check it out, then provide a link)
So what, exactly, does ALE indicate in that situation?
It has got a watchdog also which is monitoring the ALE pin of my uC
It took you a month to come up with this. A frigging month. Lesson: if you don't provide data, nobody can help you.
if the internal watchdog is properly enabled, it will cause a reset when it is not updated for any reason. What I said is both the external and internal watchdogs to be used together to handle such situations. -internal to avoid running in an infinite loop and external to handle the situation where the program is not at all running and internal WDT not running.
Pls see fig 2 www.datasheetcatalog.org/.../DS1232.pdf
The title of that figure is, "PUSHBUTTON RESET" .
It is illustrating how to use the part as just pushbutton reset; connecting the /ST input to ALE effectively disables the watchdog function - unless the processor stops completely!