You need to use brownout protection at the PIC. THen, when the PIC reboots due to a brownout fault, you need to have something in the program to deal with that situation. Restart in a controlled fashion. In software, you can also do a sanity check: On startup, Set a number of registers (the more the merrier) to a certain value then check to see if they read that value back. If not, the PIC should strangle itself with a watchdog trimeout, reboot and then test it's sanity again until it comes out sane. For a machine like this you should also consider real external microprocessor supervisor chips. THese can be as simple as a reset on the MCLR line on low voltage, to a two-step affair which warns your PIC that low voltage is coming, allowing it to save a bunch of stuff and shut down in a controlled way, then a final low voltage signal that tells it to shutdown. Brownout situations can be dangerous, causing the PIC to lock up in an unknown state, leave a load on too long, or do something unplanned. -- Lawrence Lile Chris Loiacono Sent by: pic microcontroller discussion list 02/17/2003 04:17 PM Please respond to pic microcontroller discussion list To: PICLIST@MITVMA.MIT.EDU cc: Subject: Industrial Environments and PICs I have several products that use PICs in industrial machinery - which have been doing quite well except for the rare, but unpleasant instances below. These PIC based designs have replaced other commercially available controllers and PLC's and the like. I have noticed in a couple of machine installations what seem to be brown outs and resets. I have had similar occurrences back in the 'old' days when using PLC's - If the building wiring is weak, or if an electician a bit careless, someone will turn on a large machine at one end of the building and my PIC, like the PLC's will lock up. I can tell customers that they need a small UPS for a PLC in this environment, but it won't cut it with my own design...the idea was to improve the process while SAVING $$. I figure this must be a fairly common thing to deal with. I am a bit surprised because these boards are phase angle controllers and have been hardened (via snubbing, gating methods and filtering and decoupling) to withstand the worst noise from the AC switching at peaks. The lock-ups happen when the AC line is lower than normal, so I have changed to a(n) LDO Regulator (Thanks, Olin, for your suggestions). If these events still occur, I am left to conclude that there must be some interruption of the line of significant duration. Where might I look for strategies to deal with such a thing? I need 4.5V <200mA to keep the whole thing running for the duration. Having no experience with such things as super caps, I am wondering if this is a good app for one.... C -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics