Is there a Watchdog breakout out there? - Netduino Plus 2 (and Netduino Plus 1) - Netduino Forums
   
Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Is there a Watchdog breakout out there?

Watchdog

  • Please log in to reply
27 replies to this topic

#1 Giuliano

Giuliano

    Advanced Member

  • Members
  • PipPipPip
  • 361 posts
  • LocationSimi Valley, CA

Posted 21 February 2013 - 08:31 PM

Good day everyone,

 

I found this really cool article by Mario that explains on how to use a watchdog with the Netduno. I believe it would work with all Netduino but I want it to specifically work with N+2 for my scenario. He is using the 74HC4060 but I wanted to know if there is a breakout I can get somewhere to achieve the same task.

 

http://highfieldtale...r-the-netduino/

 

I have also read an article somewhere  that the N+2 already has a built-in watchdog functinality in it that is not used by the firmware, can someone confirm on that?

 

Thank you



#2 JerseyTechGuy

JerseyTechGuy

    Advanced Member

  • Members
  • PipPipPip
  • 870 posts

Posted 21 February 2013 - 10:08 PM

As far as I've seen there is no watchdog breakout board.  I read Mario's article too and have considered using this on future project.  I see however there is a slight issue with the ND+2 with the 3.3v rail.  Mario suggested adding a capacitor which makes sense and should work however I haven't tried this.

 

I will likely design a small board for this have them made at OSHPark only because they are pretty cheap and I like things neat and tidy.  If you have time to work on the prototype and adding the Cap to see if it works, I'm sure I can whip together a board in eagle based on that that you can have made at OSHPark or whatever board producer you will use.  Since these can be Through Hole components it will be an easy board to produce and solder up.



#3 Giuliano

Giuliano

    Advanced Member

  • Members
  • PipPipPip
  • 361 posts
  • LocationSimi Valley, CA

Posted 22 February 2013 - 01:49 AM

Thanks Dave for your feedback. Sure, I have time, I am going to order the stuff listed in Mario's article, besides that, should I order something else that comes to your mind?

#4 JerseyTechGuy

JerseyTechGuy

    Advanced Member

  • Members
  • PipPipPip
  • 870 posts

Posted 22 February 2013 - 02:12 AM

Thanks Dave for your feedback. Sure, I have time, I am going to order the stuff listed in Mario's article, besides that, should I order something else that comes to your mind?

 

Just be sure to get the capacitor he refers to in his last post about the ND+2 problems with the watchdog.



#5 Giuliano

Giuliano

    Advanced Member

  • Members
  • PipPipPip
  • 361 posts
  • LocationSimi Valley, CA

Posted 22 February 2013 - 05:29 AM

Hi Dave, I ordered the following parts:

  • 74HCT4060 - 14-Stage Binary Counter
  • 2N3904 NPN General Purpose Transistor
  • 0.10uF (100nF) 50V Multilayer Ceramic Capacitor 
  • 10uF 16V Radial Electrolytic Capacitor (needed for N+2)
  • 2.2kohm 1/2W 5% Carbon Film Resistor
  • 2.7kohm 1/2W 5% Carbon Film Resistor
  • 68kohm 1/2W 5% Carbon Film Resistor

Now question, would the volts on the capacitors really matter, those were the minimun I was able to find.

 

Also, I was reading this thread where ToniA implements the Watchdog by changing the firmware in the N+:

 

http://forums.netdui...-netduino-plus/

 

Have you experiment with it?

 

Thanks



#6 ToniA

ToniA

    Advanced Member

  • Members
  • PipPipPip
  • 40 posts

Posted 22 February 2013 - 08:53 AM

By the way, my goal is still to have the Netduino Plus 4.2 firmware compiled with both 1-wire and hardware watchdog features enabled. For now this 4.1.0.6 with CW2's 1-wire has served me well enough.

 

Also, I have access to RDVS compiler versions 3.1 and 4.0.



#7 NooM

NooM

    Advanced Member

  • Members
  • PipPipPip
  • 490 posts
  • LocationAustria

Posted 22 February 2013 - 09:10 AM

seriously thats a very complex watchdog i think.

 

iam using a attiny85 for that, and its just a few lines of code.

 

and for the netduino side its just setting a pin low and high.

there might be even simpler solutions (real watchdog ic's) - wich only needs to pull a pin low and high.



#8 JerseyTechGuy

JerseyTechGuy

    Advanced Member

  • Members
  • PipPipPip
  • 870 posts

Posted 22 February 2013 - 11:39 AM

By the way, my goal is still to have the Netduino Plus 4.2 firmware compiled with both 1-wire and hardware watchdog features enabled. For now this 4.1.0.6 with CW2's 1-wire has served me well enough.

 

Also, I have access to RDVS compiler versions 3.1 and 4.0.

 

I still think there is something to be gained from a Hardware watchdog over a software watchdog when there is only one choice available.  Yes it adds more components but it can be ready easily.  Chris Walker mentioned about 3-4 weeks for the software watchdog and in reality we know 3-4 weeks is optimistic as things come up as higher priority.  In the end the option to use both a Hardware and Software watchdog together will give the best of both worlds and a solid foundation for a fault tolerant system design.



#9 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 22 February 2013 - 02:58 PM

By the way, my goal is still to have the Netduino Plus 4.2 firmware compiled with both 1-wire and hardware watchdog features enabled. For now this 4.1.0.6 with CW2's 1-wire has served me well enough.

 

Also, I have access to RDVS compiler versions 3.1 and 4.0.

 

If you are interested, there is 4.2 firmware source with 'default' OneWire implementation available in my NetduinoFirmware repository (dev branch). It is based on 4.2.0.1, with OneWire fixes (microsecond delay timing, workaround for Issue#1884) and does not include some unused code to reduce the image size, especially noticeable in bootloader.



#10 Giuliano

Giuliano

    Advanced Member

  • Members
  • PipPipPip
  • 361 posts
  • LocationSimi Valley, CA

Posted 25 February 2013 - 06:37 PM

Hi Noom,I am curious, how are you using the attiny85 in your setup, do you mind sharing?

#11 NooM

NooM

    Advanced Member

  • Members
  • PipPipPip
  • 490 posts
  • LocationAustria

Posted 25 February 2013 - 06:46 PM

sry i dont have the code anymore, but its very very simple.

i used the arduino ide and language to programm the tiny.

 

its like that: setup one pin as input, one as output, pullup enabled. (let it run with 3.3v, 1mhz internal oscillator)

 

make a timer with milis() ..

.. everytime the inputpin changes, make the timer a new value, the ammount is on yours (i used 1000msec)

when it runs out, pull output (connected to reset) down, let it down for like 50msec, make it high again, start over

(i suggest adding a 1 minute, maybe more, startup time, depending on your code, so it wount reset before the netduino is executing your code.

 

netduino side: just set a pin connected to the tiny high and low a value you like



#12 baxter

baxter

    Advanced Member

  • Members
  • PipPipPip
  • 415 posts

Posted 26 February 2013 - 01:21 AM

Why not just use a MAX823/MAX824/MAX825?

 

http://datasheets.ma...823-MAX825Z.pdf



#13 JerseyTechGuy

JerseyTechGuy

    Advanced Member

  • Members
  • PipPipPip
  • 870 posts

Posted 26 February 2013 - 03:04 AM

Why not just use a MAX823/MAX824/MAX825?

 

http://datasheets.ma...823-MAX825Z.pdf

 

Simply because Mario already put together the demo circuit of this and tested it. A few of us are looking for a quick and dirty Hardware Watch Dog and I can easily design and product the boards from Mario's design without spending a lot of time re-inventing the wheel.  If you have time to design, build and test a MAX82x based one, please by all means go for it as I don't have the spare time for such a project.  Far too many projects on the list already. :wacko:



#14 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 26 February 2013 - 05:26 AM

Guys, since you mentioned me (and the circuit), I believe I should explain something more.

 

Most of the times, the circuits/articles I present aren't "engineered" (i.e. the best solution for production), rather are just an alibi for teaching how to solve small problems.

I'm strongly convinced that saying "use this chip" to the users, they won't learn anything. Instead, facing the problem and solving with the most understandable way, everyone can learn "walking by him/herself".

So, I wouldn't use a similar circuit for an high-end project, but for a home/hobby target is nice enough: it's unexpensive and reliable.

 

Facing the problem.

What's exactly the problem? Getting a Netduino-based circuit a more reliable life?

Well, upon this requirement, there should be *two* things to check: first off, watch at our application running, and secondly, check for any power failure. I mean take some emergency task when the power supply is falling down (e.g. save some important data onto the SD).

From my perspective, some subject to be controlled shouldn't be also the controller. Also, since the controlled device (i.e. the mcu and others) is a relatively complex circuit/software, the controller should be as simplest as possible, just to minimize the possibility to fail itself.

 

The internal watchdog may be suitable, but (1) you have to modify the firmware (I don't like this way) and (2) that would solve the MCU reliability but takes no account on any external circuit connected to. Also, there's no way to alert the MCU itself when the power (Vin) is falling.

 

An external MCU (e.g. ATtiny).

Of sure may be a solution, but is it reliable? Bear in mind the complexity of a even tiny MCU compared to a simple counter: I believe there are 10k times more gates inside. This leads to a lesser reliability. So, what? just watch at the watcher? Nonsense...

Well, if the extra MCU is meant to serve other services, that might be a decent solution though.

 

A specialized watchdog (e.g. MAX823).

That's much better: there are plenty of specialized chips, which performs both timeout and power-failure checking. They are very simple internally, optimized for reliability and -because they're externally wired- you can glue then to any kind of circuit, even pretty complex.

I would surely consider this option for a professional project.

 

Instead, there's a major problem.

The Netduino performance (and the bootstrap time) is relatively long compared to the typical periods of a watchdog. Take a look at the MAX823 for instance: it yields a 1.6s timeout, then resets the board. Now, it depends on your app, but it seems to me that 1.6s for getting a complete steady in the NetMF is too short.

Same consideration for a power drop. When the Vin begins to drop, may fall within hundreds of millisecs. Our Netduino app won't be able to handle an interrupt and save some important data into the SD in so short time.

 

Finally, the original project in my mind was pretty wider. The project should have added by a RTC, which had two purposes: the first one is obviously giving the exact time, and the second feature is to wake the board periodically. That's for power-save purposes.

Since the circuit would have been pretty complex (for an unexpert user), I decided to turn for just the watchdog section, which is very simple.

 

Hope it helps.

Cheers


Biggest fault of Netduino? It runs by electricity.

#15 AxelG

AxelG

    Advanced Member

  • Members
  • PipPipPip
  • 52 posts

Posted 26 February 2013 - 06:39 PM

I have developed a prototype based on the MAX6373 chip.  I wrote a simple software driver (using timers in c#) that uses one GPIO to reset the hardware watchdog periodically.  If it misses a reset, the watchdog will perform a hardware reset on the ND/ND+ (or any other MCU)

 

The board was designed to have the watchdog timeout be selected by jumpers and expose all eight pins on the MAX to your breadboard.  All it needs is power, access to RESET, and one GPIO.

 

I will post the eagle layout and drivers once it is fully tested.  The board just came in from BatchPCB and will solder it this week.



#16 AxelG

AxelG

    Advanced Member

  • Members
  • PipPipPip
  • 52 posts

Posted 27 February 2013 - 02:51 AM

Well, I had some time tonight and soldered and tested the MAX6373 board I made based on this chip:

 

After wiring up the board, I realized I forgot the pullup resistor on the /RESET line, so I created a version 1.1 board that includes one on the board without having to wire one on the breadboard.  (Eagle files available)

 

Attached is the version 1.1 schematic, R4 is new.

 

I have a few spare version 1.0 boards if anybody is interested.  I can also solder a MAX 6373 if you want.  PM me.

 

 

Attached File  WatchDogSch.JPG   68.71KB   98 downloads

 

Attached File  MAX6373WatchDog.zip   1.34KB   47 downloads

 

Attached File  2013-02-26_22-08-57_159.jpg   63.68KB   81 downloads



#17 JerseyTechGuy

JerseyTechGuy

    Advanced Member

  • Members
  • PipPipPip
  • 870 posts

Posted 27 February 2013 - 03:25 AM

Thanks for the contribution AxelG.  I think I'll try both this and Mario's just to play around with.



#18 Giuliano

Giuliano

    Advanced Member

  • Members
  • PipPipPip
  • 361 posts
  • LocationSimi Valley, CA

Posted 27 February 2013 - 06:07 AM

Thanks everyone for their replies, this is some great information, too much for my brain to handle :) I need to do some reading and I second what Dave have said and would love to try out both solutions.



#19 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

Posted 27 February 2013 - 07:37 AM

I have developed a prototype based on the MAX6373 chip.  I wrote a simple software driver (using timers in c#) that uses one GPIO to reset the hardware watchdog periodically.  If it misses a reset, the watchdog will perform a hardware reset on the ND/ND+ (or any other MCU)

Don't timers run in their own threads on NETMF (see the first paragraph of this section of the API reference)?

 

In which case, could you not get into a situation where the timer thread is running but your application is locked?

 

Regards,

Mark


To be or not to be = 0xFF

 

Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life

Follow @nevynuk on Twitter


#20 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 27 February 2013 - 07:51 AM

Hi Mark, You could definitely block your main thread and still have background threads running. But if a blocking condition is in on the native code side of the fence...then the thread scheduler will never get the chance to re-activate your native thread. Chris





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.