![]() |
Forum Index : Microcontroller and PC projects : External watchdog chips...
![]() ![]() ![]() ![]() |
|||||
Author | Message | ||||
bigmik![]() Guru ![]() Joined: 20/06/2011 Location: AustraliaPosts: 2950 |
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 Mick's uMite Stuff can be found >>> HERE (Kindly hosted by Dontronics) <<< |
||||
BobD![]() Guru ![]() Joined: 07/12/2011 Location: AustraliaPosts: 935 |
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. |
||||
kiiid Guru ![]() Joined: 11/05/2013 Location: United KingdomPosts: 671 |
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. http://rittle.org -------------- |
||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9610 |
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: ThailandPosts: 2209 |
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. Microblocks. Build with logic. |
||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9610 |
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: AustraliaPosts: 2950 |
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: ThailandPosts: 2209 |
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 Microblocks. Build with logic. |
||||
BobD![]() Guru ![]() Joined: 07/12/2011 Location: AustraliaPosts: 935 |
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: AustraliaPosts: 2950 |
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: AustraliaPosts: 935 |
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 ZealandPosts: 9610 |
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. Smoke makes things work. When the smoke gets out, it stops! |
||||
kiiid Guru ![]() Joined: 11/05/2013 Location: United KingdomPosts: 671 |
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. http://rittle.org -------------- |
||||
MicroBlocks![]() Guru ![]() Joined: 12/05/2012 Location: ThailandPosts: 2209 |
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 ZealandPosts: 9610 |
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* Smoke makes things work. When the smoke gets out, it stops! |
||||
MicroBlocks![]() Guru ![]() Joined: 12/05/2012 Location: ThailandPosts: 2209 |
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. Microblocks. Build with logic. |
||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9610 |
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. Smoke makes things work. When the smoke gets out, it stops! |
||||
MicroBlocks![]() Guru ![]() Joined: 12/05/2012 Location: ThailandPosts: 2209 |
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. Microblocks. Build with logic. |
||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9610 |
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.19 Smoke makes things work. When the smoke gets out, it stops! |
||||
MicroBlocks![]() Guru ![]() Joined: 12/05/2012 Location: ThailandPosts: 2209 |
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. |
||||
![]() ![]() ![]() ![]() |
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |