Hello Doug and Dwayne, Thanks for the reply. I added 0.1uF capacitors to the regulator output, LED= terminals and the microcontroller power suppl y terminals and there was no= more reset problems. I feel bad that I ignored basic circuit problems considering the appeal and= size of the gadget. Since the gadget needs to be such that it could be fab= ricated easily, I couldn't opt for surface mount components.=A0 Thanks for the valuable suggestions. As it is, the microcontroller reset pr= oblem never popped up so far. I still trying to do some more rigorous tests Sai ________________________________ From: doug metzler To: Microcontroller discussion list - Public. Sent: Friday, November 4, 2011 12:12 PM Subject: Re: [EE]: Weird microcontroller reset problem Yes, Dwayne is absolutely correct -0 put a big ol' cap on the PIC vdd as close to the controller as you can.=A0 I use 10uF. DougM On Fri, Nov 4, 2011 at 8:27 AM, Dwayne Reid wrote: > At 08:03 AM 11/4/2011, yamanoor sairam wrote: > >>My theory for the LED getting stuck in a particular color is that >>the controller is getting reset and that this is happening due to >>the absence of capacitors in the circuit. I am considering adding >>capacitors across the LED and the microcontroller and at the input. >>My theory for the LED playing the default script is that the current >>draw for I2C communication interface is low. I am using a 1K pull up >>resistor on the SCL and SDA lines. I read an article that it should >>be at least 1.8K. But I am not able to prove it as the gadget works >>sometimes for 1K resistance. >> >>I would like to hear your thoughts on the erratic behavior of the >>enclosure when operated using a battery and mounted inside an enclosure. > > The easy way to tackle this is to break it into parts. > > 1) You ** DO ** need bypass capacitors for the input of the voltage > regulator and at the PIC Vdd pin. =A0Try that first. > > 2) If adding the capacitors doesn't fix the problem, use 2 battery > supplies: one for the PIC and a separate power supply for the > LED. =A0Do make sure that the negative lead of each supply is connected > together and to the circuit ground. > > 3) Ensure that any un-used pins on the PIC are connected to either > ground or Vdd. > > 4) How is the MCLR pin programmed? =A0Is it an input or is it > reset? =A0Pull MCLR up to Vdd if you aren't using it. > > Try all of the above things and let us know how you make out. > > dwayne > > -- > Dwayne Reid =A0 > Trinity Electronics Systems Ltd =A0 =A0Edmonton, AB, CANADA > (780) 489-3199=A0voice =A0 =A0 =A0 =A0 =A0(780) 487-6397 fax > www.trinity-electronics.com > Custom Electronics Design and Manufacturing > > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .