Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
11/27/01 18:28
Read: times


 
#16968 - RE: Reset Watchdog timer
To duh

Your comments are excelent and the last ones much closer to RTOS basis.
I don't know how much will understand Sebastian from your thoughts (excelent I repeat) since he is confused, where in his code should place the WDT reset command ?. Look at Sebastian second request.

To Sebastian,

A much closer approach to your question is looking straight to the timer intervals required for WDT (often with a large spectrum to choose among different values).
Let's take a value, for example 10 ms time-out period WDT.
Then suppose we are working with one 8051 compatible at 12Mhz clock frequency with 12 clocks per machine cycle. That means 1 microsec per machine cycle.
If somewhere in your code you will reset WDT (with instruction provided by manufacturer of microcontroller), from this point you have available only 10.000 machine cycle (10 ms / 1 microsec) to go on your program. If during this period you will not reset the WDT, after ends of 10 ms time-out period, the WDT will reset the micro (obvious if the interrupt and/or reset were enabled)
But if among 10.000 machine cycle (the instruction number depends on how many machine cycles are reserved for specific instructions) you will place one WDT reset instruction, thus will gain another 10 ms time-out.
That is, you have to take care how much time spends the micro processing instructions.
Unfortunatelly this is only mathematical point of view. You can't predict how the micro will spend 10 ms period (interrupt routine, jumping up and down in the code, routine calls).

This is why you have to pay attention to duh's thoughts, which clearly explain how and why you should program like he did.

Again to duh:

I understand from your thoughts that you try to avoid using WDT as much as you can.
It's a common practice to deliver one system to a customer with the WDT enabled routine? (obvious with WDT service interrupt in order to see the value of program counter, where the time-out occur)
Because in my opinion the purpose of WDT is to help the designer only during in house test.
Once the system is delivered to customer it's a shame (but healthy however) to see automatic reset (like in power supply lacks).
We are not talking here about "tight loop looking for a keystroke or comm character".
How it will be to see software reset in PC without operator handles either hardware switch or CTRL+ALT+DEL ?
Or instead Microsoft "blue screen" to see computer cold restart.

Duh: your thoughts are always welcome.

Regards,
Silviu

List of 14 messages in thread
TopicAuthorDate
Reset Watchdog timer            01/01/70 00:00      
RE: Reset Watchdog timer            01/01/70 00:00      
RE: Reset Watchdog timer            01/01/70 00:00      
RE: Reset Watchdog timer            01/01/70 00:00      
RE: Reset Watchdog timer            01/01/70 00:00      
RE: Reset Watchdog timer            01/01/70 00:00      
RE: Reset Watchdog timer            01/01/70 00:00      
RE: Reset Watchdog timer - Peter            01/01/70 00:00      
RE: Reset Watchdog timer - Peter            01/01/70 00:00      
RE: Reset Watchdog timer            01/01/70 00:00      
RE: Reset Watchdog timer            01/01/70 00:00      
RE: Reset Watchdog timer            01/01/70 00:00      
RE: Reset Watchdog timer            01/01/70 00:00      
RE: Reset Watchdog timer            01/01/70 00:00      

Back to Subject List