Announcing the ORDuino !

Topics Related to the ORD Bot Printer

Re: Announcing the ORDuino !

Postby canadianavenger » Sun Mar 11, 2012 4:03 am

There's a watchdog in the AVR... so it's invisible :)
canadianavenger
 
Posts: 153
Joined: Wed Nov 30, 2011 3:24 am

Re: Announcing the ORDuino !

Postby orcinus » Sun Mar 11, 2012 1:35 pm

Oh, *that* watchdog.
Never even considered it, as it's a bit... limited.

Its timeout granularity is too coarse, the timeouts are heavily dependent on the input voltage (it's just an RC circuit, basically), and most importantly, enabling and disabling it can be done in software only, which kinda beats the purpose (having it enabled all the time is inconvenient, so you need to enable it only when you really do need it... and what if the software crashes before you can enable it?).
orcinus
 
Posts: 720
Joined: Tue Feb 14, 2012 4:03 am

Re: Announcing the ORDuino !

Postby canadianavenger » Sun Mar 11, 2012 6:13 pm

You have it enabled via the fuses so it cannot be turned off, set the initial period to be long enough for the software to set a more appropriate period.
canadianavenger
 
Posts: 153
Joined: Wed Nov 30, 2011 3:24 am

Re: Announcing the ORDuino !

Postby frob » Sun Mar 11, 2012 6:19 pm

canadianavenger wrote:There's a watchdog in the AVR... so it's invisible :)
Well that's certainly true! It's not the answer i was looking for, but i think that deserves something - call it the "smartypants" prize ;)
But there is in fact another external "real" watchdog elsewhere...
frob
 
Posts: 260
Joined: Tue Jan 31, 2012 6:24 pm
Location: Montreal, Quebec, Canada

Re: Safety & Reliability

Postby frob » Sun Mar 11, 2012 6:24 pm

orcinus wrote: ...Same goes for brownout detectors...

Fortunately, most modern micros include a usable brownout detector on-chip.
The same cant be said for watchdogs, but they're starting to get more common.
orcinus wrote: Most SMD watchdog ICs i've seen are either SOIC8 or SOT23.This looks like it might be a 3-pin side of a SOT23.

Close but no cigar - that's the 3.3V regulator for SD card ( 3x3mm DFN-6)
orcinus wrote: Of course, if we need a hint to find it, its probably not a usually seen package :)

HHmmmm... the force is strong with this one.... ;)
frob
 
Posts: 260
Joined: Tue Jan 31, 2012 6:24 pm
Location: Montreal, Quebec, Canada

Re: Announcing the ORDuino !

Postby frob » Sun Mar 11, 2012 6:40 pm

orcinus wrote:Oh, *that* watchdog.
Never even considered it, as it's a bit... limited.

Its timeout granularity is too coarse, the timeouts are heavily dependent on the input voltage (it's just an RC circuit, basically), and most importantly, enabling and disabling it can be done in software only, which kinda beats the purpose (having it enabled all the time is inconvenient, so you need to enable it only when you really do need it... and what if the software crashes before you can enable it?).

It hadn't looked at it up close till now. Actually to be it doesn't seem half bad to me. :)
I don't mind that the RC timebase varies a lot - There should be a wide margin between the watchdog period and the interval the code resets it.
I like that it allows a 2-stage reset, with an initial interrupt to attempt a clean shutdown, and a hard reset later if that fails.
My 2 cents on the matter is that if you use a watchdog, it should ideally be enabled permanently with no way to disable though software.
Watchdogs are a pain but a very beneficial one. Convenience isn't to me a prime consideration.

Murphy's law of watchdogs:
Should the watchdog be enabled / disabled though software, the latter will crash causing widespread destruction during the time the watchdog is disabled.
Should it be possible to disable the watchdog though software, even though no explicit code be included to do so, the software will crash and execute random data which will happen to be just the right sequence of instructions to disable the watchdog, and then proceed to cause widespread destruction.
frob
 
Posts: 260
Joined: Tue Jan 31, 2012 6:24 pm
Location: Montreal, Quebec, Canada

More on watchdogs....

Postby frob » Sun Mar 11, 2012 6:56 pm

If anyone's interested, here's how i usually handle these.
1- always enabled. preferably no way to disable in software.
2- best if code only resets the timer, doesn't play with the timer interval, but that can be acceptable in some cases.
3- only service the watchdogs in a single place in the code. Never in an ISR. if written as a subroutine avoid calling from more than a single place in the code.
4- preferably do so in a single thread /task independent from the rest of the code.
5- An this is the important one: Interlock the watchdog service routine with all critical tasks and ISR's -
For example, have all safety critical code set a flag (or semaphore/mutex) and in the watchdog code only service the watchdog if all the flags are set - then clear them all.
Note this works well even in simple 1-process/thread main() loop programs, as long as the main loop takes less time than the watchdog interval.
frob
 
Posts: 260
Joined: Tue Jan 31, 2012 6:24 pm
Location: Montreal, Quebec, Canada

Re: Safety & Reliability

Postby orcinus » Sun Mar 11, 2012 10:15 pm

frob wrote:
orcinus wrote: Most SMD watchdog ICs i've seen are either SOIC8 or SOT23.This looks like it might be a 3-pin side of a SOT23.

Close but no cigar - that's the 3.3V regulator for SD card ( 3x3mm DFN-6)


This, maybe?
Image

If that's a SOT-343.

Otherwise, no clue, LOL :D
orcinus
 
Posts: 720
Joined: Tue Feb 14, 2012 4:03 am

Re: Safety & Reliability

Postby frob » Mon Mar 12, 2012 2:30 pm

orcinus wrote:This, maybe?
Otherwise, no clue, LOL :D

Getting colder now; you were right in thinking it wouldn't look like any watchdog package you've seen before. ;)

The layout is almost finished, did a good amount of work on it last night, maybe 2 more evenings of effort left before i can send it out;
i'll post a more detailed shot of it in the next few days with the top tracks visible that might help :mrgreen:
frob
 
Posts: 260
Joined: Tue Jan 31, 2012 6:24 pm
Location: Montreal, Quebec, Canada

Re: Announcing the ORDuino !

Postby canadianavenger » Mon Mar 12, 2012 6:01 pm

I'll go with what looks like a SO20 package between the ISP connector and C5B?? [a little north of the circled component above]. As it sits in the general region of where the reset signal would be. [assuming I've located the ISP connector correctly. I was initially going to guess the BGA or LGA package at the top of the board under J6, but that is probably the USB uart, assuming that J6 is the USB connector]
canadianavenger
 
Posts: 153
Joined: Wed Nov 30, 2011 3:24 am

PreviousNext

Return to ORD Bot

Who is online

Users browsing this forum: No registered users and 45 guests

cron