Watchdog timer output HIGH or LOW

Our range of tiny modules are designed to make it easy for you to quickly add functionality to your projects. [Module List]
Post Reply
nicoskaralis
Posts: 3
Joined: Tue Jun 12, 2018 12:46 pm

Watchdog timer output HIGH or LOW

Post by nicoskaralis » Tue Jun 12, 2018 1:11 pm

I'm studding the 555 chip and I found this great project. I'm trying to understand how the watchdog timer works but I don't have a 555 chip right now so I'm using iCircuit for mac to simulate and debug the circuit

I've understand how it works but in all my simulations the output (OUT pin that goes to Arduino reset) is always HIGH except when the capacitor is being discharged.

Am I missing something here? Shouldn't the output be LOW at all times and only HIGH when the timer tries to reset the Arduino?

Is my software wrong? My circuit wrong? or am I missing something else?

This is the simulation results
Image

Brissieboy
Posts: 116
Joined: Fri Sep 20, 2013 7:25 am

Re: Watchdog timer output HIGH or LOW

Post by Brissieboy » Wed Jun 13, 2018 5:58 am

nicoskaralis,
From a quick look, I suspect you may have the circuit wrong. Shouldn't the 555 pin you have marked as trig (pin 2) be the threshold (pin 6)?

nicoskaralis
Posts: 3
Joined: Tue Jun 12, 2018 12:46 pm

Re: Watchdog timer output HIGH or LOW

Post by nicoskaralis » Wed Jun 13, 2018 2:37 pm

The 555 "object" is from the iCircuit library, I don't have the option to change its pins

The position of the pins might be off, but souldn't the output be the same?
In the schematics TR (2) and THR (6) are shorted so it wouldn't matter anyway. Right?

Brissieboy
Posts: 116
Joined: Fri Sep 20, 2013 7:25 am

Re: Watchdog timer output HIGH or LOW

Post by Brissieboy » Wed Jun 13, 2018 10:47 pm

Oops, sorry. Didn't look hard enough.
The 555 output will be high while the capacitor is charging (less than about 2/3 Vcc), only going low once it reaches that threshold.
By pulsing the 'In' input you discharge the capacitor before it reaches the threshold, thus preventing the output from going low and resetting the Arduino (reset is active low). If no input is received within the time controlled by the timing circuit (the 10uF and 1m/4m and 4k7 resistors) then the output will go low and reset will occur.
That's exactly what you want to happen.
You need to pulse the input regularly during programme execution to keep the reset from occurring.

But watchdogs only cause a restart. They tend to hide the real problem, and can cause more problems that they solve. I think you need to ask yourself whether or not you really need a watchdog. What are you expecting might happen? Can you resolve that situation by better design in your software? What will happen to your application if a reset/restart does occur? Just my opinion, but I tend to think a watchdog is not necessary in most situations.

nicoskaralis
Posts: 3
Joined: Tue Jun 12, 2018 12:46 pm

Re: Watchdog timer output HIGH or LOW

Post by nicoskaralis » Wed Jun 13, 2018 11:15 pm

Brissieboy wrote:
Wed Jun 13, 2018 10:47 pm
The 555 output will be high while the capacitor is charging (less than about 2/3 Vcc), only going low once it reaches that threshold.
By pulsing the 'In' input you discharge the capacitor before it reaches the threshold, thus preventing the output from going low and resetting the Arduino (reset is active low). If no input is received within the time controlled by the timing circuit (the 10uF and 1m/4m and 4k7 resistors) then the output will go low and reset will occur.
That's exactly what you want to happen.
You need to pulse the input regularly during programme execution to keep the reset from occurring.
Yeah, I understand that.
Using the simulation software (iCircuit) i've understood how the timer works, when it resets the arduino.
That is fine, my question is not how it works, my question is about the voltage on the OUT pin

If you take a look at the bottom section of the image you can see the voltage of the OUT pin in the timeline. When the capacitor reached 3.33 the circuit called a reset, like it should do.
According to the Arduino docs: a HIGH on the reset pin will restart the arduino
But if you check the OUT.V in the image you can see that it is always high and only drops to low when the capacitor is charged enough, which is clearly the opposite of what the documentation says (both arduino documentation and watchdog documentation)

And yet, the circuit clearly works because nobody is complaining.
Where is the problem? Did I not understand something? Is my circuit wrong? Is the simulator software wrong?
Brissieboy wrote:
Wed Jun 13, 2018 10:47 pm
But watchdogs only cause a restart. They tend to hide the real problem, and can cause more problems that they solve. I think you need to ask yourself whether or not you really need a watchdog. What are you expecting might happen? Can you resolve that situation by better design in your software? What will happen to your application if a reset/restart does occur? Just my opinion, but I tend to think a watchdog is not necessary in most situations.
I know. They are not always needed. I'm not using it on an arduino. I'm not even building it physically
I'm studying about the 555 chip and I'm trying to understand how this circuit (watchdog) works.

If my simulation software is defective I need to change it
If I did some mistake I need to find it

Brissieboy
Posts: 116
Joined: Fri Sep 20, 2013 7:25 am

Re: Watchdog timer output HIGH or LOW

Post by Brissieboy » Thu Jun 14, 2018 1:55 am

According to the Arduino docs: a HIGH on the reset pin will restart the arduino
The Arduino reset pin is active LOW - meaning it needs a LOW to initiate a reset, not a HIGH.
So the circuit operates correctly.

The old versatile 555 is one of the greatest little devices since the transistor. Amazing what it can made to do.

Post Reply