At 15:39 5/11/99 +1300, you wrote: >Yes, there should be at least a voltage sensitive reset circuit on >any micro in just about any practical application, particularly >automotive. Watchdog is next on the list of most important things. Is that so... A watchdog is not important (My opinion) others will proberably not share this same recourse but I will give you my reasons especialy for the PIC. Fist code structure within the PIC is in such a way that only one instuction is skipped on a possible branch condition. Often after the branch instruction is another branch eg. lable SKIPNZ ;branch GOTO not ready ;branch code here lable As the PIC has a small stack, not accessable to the software, corruption is not likely by the software itself. So an accidental RETURN will bring you back to a code section that you may have just been in or are going to. Thus corruption may or may not cause a notticable problem (More on this to come), in that unless that the system can detect such it may be possible to continue on without a WDT. Now lets look at the watchdog speed. Most of us set this as slow as possible to avoid any possible miss hits. This is often 512 clock cycles. For most applications if you look at the code structure a CLRWDT will occur within the time period as nearly all the code would / can be exicuted within this time frame, unless that the code is structured in such a way as not to casue this to occur:- eg. Wait for a bit to be set Wait fot some external action then CLRWDT Often we spread CLRWDT all over the place, naughty us, there should only be one! So what does this mean. Well in a round about sort of way the PIC enforces a basic defensive programming style where the PIC will often come back from a cosmic shock and still keep ticken (OK not a real word but I think it's great, and you can invent words in english too!), lost of this is due to the small code space. Don't beleve me. OK try this. Take a look at your nice code with its CLRWDT in it (Have you analysed it for sporadic run time errors? I would put money on it that you have not). Now pic a point any point in the code and start operations from there, would the WDT go off? Defensive progamming is the way to go, how many of you do 7-3 and check to see that the result is <=4&>=0?. If you are worrided about cosmic stuff, then you will nead to verify the status quo at regular intervals to see that the thing has not corrupted itself. WDTs are only good for getting you out of endless loops. Dennis > >The circuit I described uses an Atmel AT89C2051 (shame on me!) >and a Dallas DS1833 econo-reset chip with a threshold of 4.375V. I >could have used a PIC (too late now) with internal brownout detect >and watchdog, but the above circuit behaves very reliably - so far... > >> Brent Brown wrote: >> >> > The 1N4007 diode in series with the input prevents damage from >> > reverse supply connection. It also stops the 1000uF cap from >> > discharging if the supply voltage falls (eg. engine cranking), so if >> > your circuit doesn't draw too much you have a short term UPS! >> >> A little gotcha with this idea. >> >> Make sure you have some sort of brownout detect on the PIC or some weird >> things may crop up. >> >> -- >> Best regards >> >> Tony >> >> http://www.picnpoke.com >> Email sales@picnpoke.com >> > > > >Brent Brown >Electronic Design Solutions >16 English Street >Hamilton, New Zealand >Ph/fax: +64 7 849 0069 >Mobile: 025 334 069 >eMail: brent.brown@clear.net.nz > >