Watchdog solution

Hi
I have read several posts discussing watchdogs but there seems to be no concrete solution.
Has anyone implemented a hardware / software watchdog that will ensure that a spark core runs continually 24/7
This is vital for a device installed in the field in a potentially difficult place to access.
I would like to usea spark core for a continuously monitoring project but without a suitable watchdog it will be a non starter.

How about an ATTiny45 with code running on it to reset the SparkCore if it doesn’t receive a given pulse train in a given amount of time. ATTiny45’s are cheap (DigiKey @ $1.50 in low volume). It would just require 1 GPIO on the SparkCore and a bit of extra code on the SparkCore. With a bit of extra work (soldering) you could even have it automatically factory reset the device if it failed to start X times. That’s all do-able with 1 IC (the ATTiny45). How about that?

1 Like

@harrisonhjones, great idea! Another idea is to wait for the Photon which will run FreeRTOS and provide a more flexible watchdog approach. :smile:

That would work as well :smile:

I just dropped $7 and ordered 5 Attiny45s. I’ll see if I can’t get a solution working this weekend.

we just can't wait for the Photons!!! :smiley:

ATTiny45... @harrisonhjones... great idea.

2 Likes

Adding another microprocessor as a watchdog will only make the reliability worse.
Does the Photon implement an external watchdog circuit?

Attinys are incredibly reliable and, since they will literally be running maybe 10 lines of code, should be perfectly fine as a watchdog.

In my opinion, the main reason the SparkCore is unreliable is because of it’s blocking CC3000 driver. That’s not going away in the near future so some kind of external watchdog circuit is necessary. I agree, and entire microcontroller is probably overkill but it’s easy, cheap(ish), and quick overkill.

@martinhoyle the watchdog timer of the STM32F103 used in the Core has some limitations and as @harrisonhjones pointed out, the challenge with the Core is not the processor but the CC3000 module. The STM32F205 which will be used in the Photon has two watchdog timers (IWDT and WWDT). I am not sure how Spark will couple these with FreeRTOS but given the lessons learned from the Core, I have no doubt watchdog capability will be carefully considered. :smile:

I know micro’s are reliable but at some point they will crash. A more reliable solution is an external circuit eg max6369 - I am just wondering if anybody has put this onto a pcb to save me having to wire up my own. I would still be interested to know if the photon has an improved watchdog capability

@martinhoyle, I don’t get it. An Atiny85 is unreliable but a max6369 is! I believe an Atiny85 or an MPS430 are just as reliable and offer more flexible solutions. Also, the built-in watchdogs will function just as an external device will.

2 Likes

Going the attiny way you could even sleep safely (if programmed correctly) without risking the watchdog resetting your core.

@martinhoyle I’m currently using the Maxim MAX367* series of watchdog timers. @peekay123, the disadvantage of the Atiny is the programming in my opinion, not so much the reliability. The Maxim seires is small, no programming required, and relatively inexpensive, especially with “samples” :slight_smile: I built a tiny little breakout board that’s available on Oshpark here for like 65 cents for 3. It’s designed for the whole series, so includes a place for the pullup resistor and jumper spots. Caution, it is a tiny little bugger, so it takes some steady hands to solder it. Here’s a pic of an assembled breakout:

3 Likes

An atiny85 will be unreliable as it is a programmed micro a max6369 is a dedicated watchdog chip. The built in watchdog functions will operate if the firmware is correctly configured the only way to find this out would be to search through the spark code. A quicker solution would be if someone in the know could advise on whether the internal watchdog’s have been implemented and how. It would appear that they have not been used correctly in the spark otherwise people would not be reporting locking up core’s.
mumplepins - breakout board seems like the ultimate solution I will investigate.

If you’re interested in integrating this into a PCB, here are the Eagle files for the breakout.

Hi,

I regularly pulse a pin in my code and use a 7555 (CMOS 555) as a missing pulse detector. connected to the toggling pin. I don’t use it to reset the processor in my application but it would be easy to implement. It is cheap and does not require programming.

Best regards,
Clive

1 Like

Hi

mumblepins - thanks for posting the eagle files. I have ordered pcb’s from Oshpark so will have a play when they arrive. I have worked for many years with microcontrollers and learnt that a solid watchdog solution saves a lot of grief.
Thanks again.

Regards Martin

Hi there,
I’m sorry to get into this post, but I got 2 photon and I did not found any information on the watchdog, @peekay123 does your 1st assumption are okay and is there any available in photon ?