Portugal
Offline
Newbie
Karma: 0
Posts: 34
This text is personal. Aquire a Gold account to read it.
|
 |
« on: March 11, 2011, 02:00:11 pm » |
Hey, guys, I'm designing a Watchdog for my Arduino using the famous 555 integrated circuit. I wish to connect the output of the Watchdog to the RESET pin of the Arduino, which is triggered when it is LOW. Basically what I want is a 555 timer in Astable mode with a Mark Time (HIGH output duration) of about 10 seconds (which is the maximum time the Arduino has to execute one loop) and a Space Time (LOW output duration) of about 0.3 seconds (which, I believe, is enough LOW time to trigger the RESET on the Arduino). The base schematic is the first one that appears in this site. The external components are: C = 0.1mF = 100uF R1 = 150 kOhm R2 = 4.3 kOhm Now, here's my question: How can I reset the Watchdog? Do I simply have to connect the RESET pin of the 555 to a digital output pin of the Arduino and simply make the code like this: void setup() { digitalWrite(WatchdogResetPin, HIGH); } void loop() { digitalWrite(WatchdogResetPin, HIGH); // restart the Watchdog timing (...)
digitalWrite(WatchdogResetPin, LOW); // reset the Watchdog, making it restart counting the 10 seconds of its HIGH output delay(5); // just to give it time to receive the pulses and stuff... }
Is this it? Thanks!
|
|
|
|
« Last Edit: March 12, 2011, 10:46:01 am by pedrotome »
|
Logged
|
|
|
|
|
Connecticut
Offline
Edison Member
Karma: 16
Posts: 1214
RTFD (Datasheet in our case)
|
 |
« Reply #1 on: March 11, 2011, 05:17:50 pm » |
What you could do is hookup a transistor to the power pins of the 555, have the arduino control this. 555 restarts on power up, so it will start counting 10 seconds.
Good Luck!
|
|
|
|
|
Logged
|
I'm not kidding. If I am asking a question whose answer is found within the concerned product's datasheet, shame on me. If I am answering a similar question, shame on you!
|
|
|
|
Global Moderator
UK
Offline
Brattain Member
Karma: 143
Posts: 19365
I don't think you connected the grounds, Dave.
|
 |
« Reply #2 on: March 11, 2011, 05:21:20 pm » |
Hey, guys, I'm designing a Watchdog for my Arduino using the famous 555 integrated circuit Why? Is there something you don't like about the built-in one?
|
|
|
|
|
Logged
|
Pete, it's a fool looks for logic in the chambers of the human heart.
|
|
|
|
Portugal
Offline
Newbie
Karma: 0
Posts: 34
This text is personal. Aquire a Gold account to read it.
|
 |
« Reply #3 on: March 11, 2011, 07:15:31 pm » |
What you could do is hookup a transistor to the power pins of the 555, have the arduino control this. 555 restarts on power up, so it will start counting 10 seconds.
Good Luck!
Do you mean something like the image attached? And the code would be void setup() { digitalWrite(WatchdogResetPin7, HIGH); } void loop() { digitalWrite(WatchdogResetPin7, HIGH); // restart the Watchdog timing, turning on the 555 chip (...)
digitalWrite(WatchdogResetPin7, LOW); // reset the Watchdog by turning off the 555 chip delay(5); // just to give it time to receive the pulses and stuff... }
That's it??? This guy empties the Capacitor instead of turning the 555 chip off. I don't know, but it just seems more reliable to me. Do you have any idea on how I can do this? Hey, guys, I'm designing a Watchdog for my Arduino using the famous 555 integrated circuit Why? Is there something you don't like about the built-in one? The built-in Watchdog is supposed to be bad. The new Optiboot bootloader featured in the new Arduino Unos has a Watchdog that actually works, but I don't have that bootloader. Also, hardware Watchdogs are always more reliable/better, right? That's what I've read...
|
|
|
|
« Last Edit: March 11, 2011, 07:18:34 pm by pedrotome »
|
Logged
|
|
|
|
|
Portugal
Offline
God Member
Karma: 5
Posts: 962
|
 |
« Reply #4 on: March 11, 2011, 08:27:29 pm » |
The code made by the Arduino may be bad, but there is no problem with the built in atmega watchdog, I think that it is disabled in the older fuses settings, but you can fix that.
|
|
|
|
|
Logged
|
|
|
|
|
nr Bundaberg, Australia
Offline
Tesla Member
Karma: 75
Posts: 6970
Scattered showers my arse -- Noah, 2348BC.
|
 |
« Reply #5 on: March 11, 2011, 08:54:59 pm » |
The built-in Watchdog is supposed to be bad Don't know why, I've used it many times. hardware Watchdogs are always more reliable/better, right? The internal WD is hardware, it's just internal  In both cases there is still the possibility of "kicking the dog" even when the code is bad. ______ Rob
|
|
|
|
|
Logged
|
|
|
|
|
Portugal
Offline
Newbie
Karma: 0
Posts: 34
This text is personal. Aquire a Gold account to read it.
|
 |
« Reply #6 on: March 12, 2011, 10:09:19 am » |
Well, even if some people say the Arduino's built-in WDT will eventually cause an infinite reset loop and others say it won't, I still would like to finish this simple 555 timer. My only problem is the fact that I've never understood the RESET pin of the 555 (and other pins, actually), which means I don't know how to use it or if I can use it for this. I would also like to know how I can empty the Capacitor, like in the link I posted above.
So... to keep the replies spot-on on the topic, forget the Watchdog. Just tell me how to do the above. :p
Thanks for the above users' replies, though!
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
UK
Offline
Brattain Member
Karma: 143
Posts: 19365
I don't think you connected the grounds, Dave.
|
 |
« Reply #7 on: March 12, 2011, 10:11:59 am » |
The built-in Watchdog is supposed to be bad....
Also, hardware Watchdogs are always more reliable/better, right? And the AVR's built-in one is implemented in ... what? Marzipan?
|
|
|
|
|
Logged
|
Pete, it's a fool looks for logic in the chambers of the human heart.
|
|
|
|
Portugal
Offline
Newbie
Karma: 0
Posts: 34
This text is personal. Aquire a Gold account to read it.
|
 |
« Reply #8 on: March 12, 2011, 10:45:35 am » |
The built-in Watchdog is supposed to be bad....
Also, hardware Watchdogs are always more reliable/better, right? And the AVR's built-in one is implemented in ... what? Marzipan? Dude, chill out, it's not like I'm an expert on anything. I'm just saying what I've learned from reading countless other topics about Watchdogs on the Arduino Forum. Almost everyone says it isn't a path one should viably follow - even with Optiboot. I just want to reset a 555 astable circuit with minimal complication. baum told me I could use a transistor to turn on/off the 555 chip using the Arduino. That sounds great, but I'm not sure if the way I think I can do it is right (the schematic I attached above). I'm also not sure if reseting the 555's timing capacitor would be even better than turning off the 555 itself. These are my questions. Please stop the "Arduino's built-in Watchdog" discussion - I'm not interested in going that way. Happy face for you: 
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
UK
Offline
Brattain Member
Karma: 143
Posts: 19365
I don't think you connected the grounds, Dave.
|
 |
« Reply #9 on: March 12, 2011, 01:45:03 pm » |
Dude, chill out Just trying to save you time, effort and hair-loss. Smiley face back atchya.
|
|
|
|
|
Logged
|
Pete, it's a fool looks for logic in the chambers of the human heart.
|
|
|
|
nr Bundaberg, Australia
Offline
Tesla Member
Karma: 75
Posts: 6970
Scattered showers my arse -- Noah, 2348BC.
|
 |
« Reply #10 on: March 12, 2011, 09:30:53 pm » |
This guy empties the Capacitor instead of turning the 555 chip off. "This guy" is Jon Oxer, here's a member here (user "Jonathan Oxer"), he's right into open source so maybe he will divulge the secret. ______ Rob
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Boston area, metrowest
Offline
Brattain Member
Karma: 269
Posts: 17040
Available for Design & Build services
|
 |
« Reply #11 on: March 12, 2011, 11:00:26 pm » |
From my reading of the datasheet, the best you can hope for is to continually reset the 555 to hold its output low - then run it thru an inverter (such as a transistor like in your picture, with the collector pulled high). Set it up in astable mode, with Reset connected to an arduino output pin. See if you can keep the output low by resetting within your 10 second window. If that works, add the inverter and drive your arduino reset line.
|
|
|
|
|
Logged
|
|
|
|
|
|