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.

Robert L.

Member Since 07 Jun 2011
Offline Last Active Nov 28 2014 09:20 PM
-----

#35288 Netduinos arriving in Radio Shack stores

Posted by Robert L. on 15 September 2012 - 10:58 AM

The first Netduino-related item in Radio Shack is the Netduino Starter Kit.

Chris


Yikes, these forums are about to be saturated with clueless postings, with the same "I bricked my N+" and "How do I upgrade my N+" and "How do I interface my N+ with XXX" over and over again.

Not that I am always cluefull myself, you understand.


#19018 Watchdog timer

Posted by Robert L. on 11 October 2011 - 03:56 AM

Hi Robert, could you give us printout of the schematic you used? I am curious if I can run a quick test to see if it can fit my needs too

Cheers,

Stavros


Sure thing, here is a PDF of the circuit I am using. A couple of things of note, I used A3 as my watchdog reset line, any digital output would do, even one that is used for some other purpose, IE it does not have to be dedicated as long as the line toggles regularly, but stops switching if the machine locks up. The other point I would make, is adding the 100uF caps is not strictly part of the watchdog, but they do help the N+ board's power supplies to run more quietly. Note that the values for the duration of the reset pulse and the watchdog timeout are easily adjusted with changing the values of C4 and C5.

Attached Files




#18908 Watchdog timer

Posted by Robert L. on 07 October 2011 - 04:24 PM

Hi, I'm really interested in your solution.. can you submit a schema of your circuit? Does the Netduino Plus have a dedicated reset line that work also when the program freeze and all the threads stop responding?
In negative case the WDT circuit should be projected in a kind of way that it force the reboot of the Netduino board (removing and restoring the power to the board)?? Or the software reset work even when all threads hangs? (sorry for my bad english..)


I finally got my watchdog circuit to work reliably. Whenever the program hangs, it reboots the N+ board. To make this work, I added an external chip whose output drives the N+ reset line with a negative pulse when needed. This circuit needs a periodic pulse to tell it that the software is still running, the absence of a pulse for more than a certain time, will then reset the N+; In my case, I set the timeout interval to about 30 seconds. This gives the N+ software time to do very lengthy tasks without the need to sprinkle pulse generating code everywhere.

Here is the class I wrote to generate the pulses which prevent reset.

public class WDT  {
    static OutputPort WDTO = new OutputPort(Pins.GPIO_PIN_A3, false);
    Int32 delay = 60;
    bool last = true;

    public  WDT() {
        (new Thread(Run)).Start();
        }
    public void Set( int dly ) {
        delay = dly;
        }

    private void Run() 
    {
        while (delay > 0)   // just let the task die if delay runs out
        {
            delay--;
            WDTO.Write(last);          // pulse the MAX6751 chip
            last = true ^ last;        // toggle the value to create a square wave
            Thread.Sleep(1000);        // sleep for one second
        }
    }
}

When the N+ locks up, this code, which runs as a separate thread, will stop executing, and therefore it will no longer generate pulses, after the 30 seconds expire, the external chip will reset the N+ board. This code will also stop if the Set() method is not called often enough. I wanted to be able to set different timeout at different places in the code. So this technique let's me cause a reset even if no full machine lockup occurs.

Question: Is that any interest in such a shield, or would people just like to make their own? The circuit is not complicated, although the chip is a tiny surface mount one.


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.