Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 06:02 02 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : External watchdog chips...

     Page 2 of 4    
Author Message
bigmik

Guru

Joined: 20/06/2011
Location: Australia
Posts: 2950
Posted: 04:09pm 09 Jun 2013
Copy link to clipboard 
Print this post

Lads,

Of course to deselect the cct for programming it is as easy as a shorting link between MCLR and the circuit...

Another thing to enable it to have no effect during reset/power-up would be to replace the GND on the RESISTOR with another output so there wont be a LOW applied to the MCLR when the micro is restarting.

As per this circuit, of course this requires an extra output pin but the watchdog can be enabled or disabled at will.





Regards,

Mick

EDIT** I would think about putting the other diode back in as well, as a fully discharged capacitor could pull the MCLR low without it.

Mick


Edited by bigmik 2013-06-11
Mick's uMite Stuff can be found >>> HERE (Kindly hosted by Dontronics) <<<
 
BobD

Guru

Joined: 07/12/2011
Location: Australia
Posts: 935
Posted: 06:07pm 09 Jun 2013
Copy link to clipboard 
Print this post

We would be best to go back to kiid's original circuit without the 20K resistor and including the second diode plus with Mick's ENABLE. It would seem we have an external watchdog with a startup and continuance under program control. So simple it probably could be soldered onto the board with a few common components.

edit:
I see a problem during development. If you stop your program by Ctrl + C or other means without resetting your ENABLE pin first then the watchdog is going to reset your processor and any program in memory will be lost. That could be a nuisance.Edited by BobD 2013-06-11
 
kiiid

Guru

Joined: 11/05/2013
Location: United Kingdom
Posts: 671
Posted: 09:31pm 09 Jun 2013
Copy link to clipboard 
Print this post

Nice corrections
Actually, instead of enabling the bleeding resistor, the ENABLE could be connected to the capacitor's negative lead instead. It will avoid any programming issues that way (it will be ~ENABLE, though).
I would leave R2 to ground and restore D2 and R1 in place.
Edited by kiiid 2013-06-11
http://rittle.org

--------------
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9610
Posted: 09:44pm 09 Jun 2013
Copy link to clipboard 
Print this post

Guys - some great comments coming in here - keep it up.

@ BobD - Yes, the CTRL-C break could be an issue indeed!!!

However, I guess that in those cases, you would need to make sure you disconnected ENABLE during those development conditions...


Smoke makes things work. When the smoke gets out, it stops!
 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 09:55pm 09 Jun 2013
Copy link to clipboard 
Print this post

Well, if that is what people think..... I keep my opinion that a watchdog should trigger a reset when a pulse is missing and not how long a logic level is missing. The chances that something go wrong with a logic level is a few orders of a magnitude bigger then when using a pulse.

A good component to use is this one:
http://nz.element14.com/texas-instruments/tps3813k33dbvt/sup ervisory-circuit-3813-sot-23/dp/8457190

It has a supervisory role monitoring the power supply AND has a windowed watchdog that accepts pulses within a frequency range. Anything out of that 'window' will cause a reset.
Priced at $2.76 it is very affordable.
Only extra part needed is a single capacitor to set the window time and a decoupling capacitor.

And i still remain the opinion that the internal PIC32 watchdog is the only working possibility when using MMBasic. Once Geoff has added that to the language you would be able to ENABLE and DISABLE it.

An external watchdog can only be used in a Maximite when you connect the output of the watchdog through a jumper or switch. Flip the swith or place the jumper when your program is running. Even then you must make sure that when a reset occurs your program starts quickly enough to pulse the watchdog, if not you have a permanently resetting system.

Also during programming the watchdog circuit has to be disconnected. While programming there are no pulses and the watchdog would assert the reset.

In summary an external watchdog should be pulsed by the firmware and it should be disconnected while programming.
So either Geoff adds software to the firmware to use the internal watchdog and/or there has to be a standardized external watchdog on a certain port that can be controlled.






Edited by TZAdvantage 2013-06-11
Microblocks. Build with logic.
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9610
Posted: 10:27pm 09 Jun 2013
Copy link to clipboard 
Print this post

Thanks for the link, TZA - I will check out this device.

Smoke makes things work. When the smoke gets out, it stops!
 
bigmik

Guru

Joined: 20/06/2011
Location: Australia
Posts: 2950
Posted: 10:45pm 09 Jun 2013
Copy link to clipboard 
Print this post

  TZAdvantage said   The chances that something go wrong with a logic level is a few orders of a magnitude bigger then when using a pulse.



Thanks TZ,

Of course the logic level could be lost removing the ability to reset the PIC so that will NOT be a satisfactory answer.. I agree a supervisor WDT chip should be used.


But I like the idea of garden variety parts to do the same job...


Regards,

Mick


Mick's uMite Stuff can be found >>> HERE (Kindly hosted by Dontronics) <<<
 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 12:43am 10 Jun 2013
Copy link to clipboard 
Print this post

I looked for some more info about the tps3813 chip and found this article about watchdogs.
It is a good read.
http://www.ganssle.com/watchdogs.htm
more:
http://www.maximintegrated.com/app-notes/index.mvp/id/4229
and specific for the pic32:http://ww1.microchip.com/downloads/en/DeviceDoc/61114F.pdf take notice which oscillator is used.
It even has a windowed watchdog feature but information about that is scarce. Only found the bit that sets it.
bit 1 WDTWINEN: Watchdog Timer Window Enable bit
1 = Enable windowed Watchdog Timer
0 = Disable windowed Watchdog Timer
Edited by TZAdvantage 2013-06-11
Microblocks. Build with logic.
 
BobD

Guru

Joined: 07/12/2011
Location: Australia
Posts: 935
Posted: 01:59am 10 Jun 2013
Copy link to clipboard 
Print this post

Looking further at the circuit first proposed by kiid and then with mods by Mick, something that will have a detrimental influence on that design is that the Maximite has an external 10k pullup to 3.3V on MCLR. That pullup will prevent the circuit from asserting a reset.
 
bigmik

Guru

Joined: 20/06/2011
Location: Australia
Posts: 2950
Posted: 11:41am 10 Jun 2013
Copy link to clipboard 
Print this post

  BobD said   something that will have a detrimental influence on that design is that the Maximite has an external 10k pullup to 3.3V on MCLR. That pullup will prevent the circuit from asserting a reset.


Hi Bob,

Yes you are right...

We could add a transistor switch to the MCLR line but it is starting to be more complex where a supervisor IC is likely to be simpler and more effective...

Also the Pullup on CHARGE will be no good either as if the PIC loses control the pullup would charge C1 and it would not do the job of being a missing pulse detector (assuming the PIC locked with the CHARGE output in a floating or `unknown' state)..

Regards,

Mick

PS. THis has been an interesting topic (for me anyway)

Mick's uMite Stuff can be found >>> HERE (Kindly hosted by Dontronics) <<<
 
BobD

Guru

Joined: 07/12/2011
Location: Australia
Posts: 935
Posted: 11:59am 10 Jun 2013
Copy link to clipboard 
Print this post

It's a bit sad about that circuit as it was so simple but we (me included) never really looked into it fully and the simplicity was it's failing. I too am of the opinion that a supervisor IC would be the best solution. That was a very good article that TZA referred us to in a previous post.
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9610
Posted: 01:01pm 10 Jun 2013
Copy link to clipboard 
Print this post

All very useful information, folks - thanks.

Only problem I have so far with the 3813's and the like, is that they are SOT-23, which is really a bit tiny. I suppose the pin spacing on the 23-6 package, is only 0.2mm narrower then standard SOIC, so perhaps I will get a few of these in my next order from Element-14, just to check them out.

Does anyone know of an external WDT which is in a more standard SOIC, SOT-223 or even full DIL package?

EDIT: I see the 3813 looks like it's maximum WDT is 3s, which is not long enough for me anyway. I need at least 6s, preferably 10-15s before an automatic reset could ever happen. PICAXE 08 is looking more and more attractive, as I can change the behaviour of the timer so easily in code, although, I still am dubious about using a PIC as a WDT for a PIC(blind leading the blind again, as MOBI pointed out!). Although to be fair, I have had a really good run with PIC's, so perhaps I will try out one of these on the breadboard for the sake of experimentation.Edited by Grogster 2013-06-11
Smoke makes things work. When the smoke gets out, it stops!
 
kiiid

Guru

Joined: 11/05/2013
Location: United Kingdom
Posts: 671
Posted: 02:07pm 10 Jun 2013
Copy link to clipboard 
Print this post

Maybe MCP795W11 or similar?
Another possible way out: you could use the alarm output of almost any RTC to trigger a secondary watchdog reset by setting it to one second ahead of the current time read from the RTC. The only problem is that the resolution of most RTCs can't be lower than one second. Some RTCs even come in DIP packages.Edited by kiiid 2013-06-12
http://rittle.org

--------------
 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 08:09pm 10 Jun 2013
Copy link to clipboard 
Print this post

Good find Kiid!
But why not use the built in watchdog of the MCP795Wxx chip directly?
Here is the datasheet
It uses SPI but that should not really be a problem.
You can configure it for a wide range:
[code]
- 000 – 977 us
- 001– 15.6 ms
- 010 – 62.5 ms
- 011 – 125 ms
- 100 – 1s
- 101 – 16s
- 110 – 32s
- 111 – 64s
[/code]
It is also an RTC, 64 byte of sram, eprom and a few types have a uniqueID. A pretty versatile chip.
The watchdog has to be reset with a command send over SPI or with a high speed pulse. It can also monitor a highspeed and a low speed signal further ensuring that the main circuit is functioning properly.
Price is around 2.50US$ for single piece.
If someone wants one, i am going to place an order end of this week for Microchip parts and can include a few. I have a few soic to dip adapters if that is what you want.


Microblocks. Build with logic.
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9610
Posted: 09:24pm 10 Jun 2013
Copy link to clipboard 
Print this post

Hi folks.


I found this thing on Element-14:

MAX6369

This unit is exactly what I want and need - programmable for the 10s or so I want as the timeout etc, and I can get these via the NZ supplier(Element 14)

OK - a little more $$$ then the TZA SPI unit($9.20 for one-off's), but I think I will definitely try this one out. This one can have timeouts up to 60s set by pins on the device, and it also has a startup delay to allow the MCU to get going before it starts looking for pulses to keep it alive - just what I need.

Only problem is - it is SOT23-8, which is the little small bugger again, but I am prepared to make the effort.

I also don't have any footprint for SOT23-8, and there are no dimensions in the PDF, so I am going to hunt for that on the net now...

EDIT: Found it.

SOT23-8

...it gets worse - these things are only 0.65mm pin spacing - that's getting a bit too small for me to solder. *sigh*Edited by Grogster 2013-06-12
Smoke makes things work. When the smoke gets out, it stops!
 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 09:54pm 10 Jun 2013
Copy link to clipboard 
Print this post

Grogster,

In the MAX6369 pdf there are two links to the package (page 9):
http://pdfserv.maximintegrated.com/package_dwgs/21-0078.PDF

and land pattern:
http://pdfserv.maximintegrated.com/land_patterns/90-0176.PDF

It is an expensive chip, maxim is known for that. But at the same time they make so many chips that are really useful. Wonder why other manufacturers don't do that.

The chip kiid mentioned and i commented on is really a RTC chip and you would need a crystal to supply the 32.768Khz frquency.
The watchdog functionality is a very nice extra feature as are the sram, flash and id.
The watchdog does not have a startup delay, you need to enable it through a command.
It would be a good addition to a Mono Maximite as that version does not have an RTC.
Edited by TZAdvantage 2013-06-12
Microblocks. Build with logic.
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9610
Posted: 10:16pm 10 Jun 2013
Copy link to clipboard 
Print this post

Yeah, I know it's kinda costly.

However, if it does what is advertised, and I am not going to need buckets of them, then...

However, the 0.65mm pin spacing is still putting me off big time - it's just too small for me to solder.

I am still hunting around, so feel free to mention any other chips you find.

I would prefer a programmable WDT only, without extra features, if at all possible.

I MIGHT still get a couple of those 6369's, and SEE if I can solder them to a WDT board.

The idea I had, was for a plug-in WDT board, that can plug directly into the CGCMM, as the holes right behind the SD card have the RESET, 3v3 and GND all on them, so a kind of daughter-board for the CGCMM1 or CGCMM2 boards. (and use A0 as the pin to pulse the WDT to keep it alive)

I will keep you all posted on this concept, but certainly the SOT23-8 would make this a nice small plug-in daughter-board if I do go down this path.Edited by Grogster 2013-06-12
Smoke makes things work. When the smoke gets out, it stops!
 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 10:24pm 10 Jun 2013
Copy link to clipboard 
Print this post

Maybe one of the breakout boards from adafruit

And you can get a sample 6369 from Maxim Integrated here:
https://shop.maximintegrated.com/storefront/searchsample.do? event=Sample&menuitem=Sample&Partnumber=MAX6369

The price when you order directly is $ 7.68

I don't have a business account with them yet. They have a factory and distribution center in Thailand. I have to think about that.... i used them before for 1-wire stuff and that order went smooth.

Edited by TZAdvantage 2013-06-12
Microblocks. Build with logic.
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9610
Posted: 10:33pm 10 Jun 2013
Copy link to clipboard 
Print this post

Thanks for the links, TZA!

I guess I should not be so frightened of 0.65mm - plenty of other people hand-solder this spacing, and YouTube has plenty of videos showing you how, so I suppose...

My price here for the 6369's is $9.20, but that is in New Zealand dollars.
If you are working things out in US dollars, then the per-unit price I can get them from here is US$7.19Edited by Grogster 2013-06-12
Smoke makes things work. When the smoke gets out, it stops!
 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 10:41pm 10 Jun 2013
Copy link to clipboard 
Print this post

Ah, i see US$, HK$, NZ$, AUS$...... I need to specify which one.
You have a good price then.

The small stuff is also easy to do on a hotplate especially for a breakout board.
For soldering a good set of 'helping hands' makes it much easier.


Microblocks. Build with logic.
 
     Page 2 of 4    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025