I've had trouble with PIC chips that don't have the "brownout reset" function. The RC circuit on the reset line (mentioned by G3VVT below) is a good idea. The CPU can also go into never-never land if the Vcc droops a little due to a brief line voltage drop-out.
Now a days, I use an external brownout reset chip for micros that don't have it built in. These are very small three terminal devices. They are good insurance against getting into an invalid state due to power glitches. The watchdog timer can also be helpful to reset from a lock-up condition without extra hardware. This assumes the micro does power up correctly so it can initiallize the watchdog timer. Later if something goes wrong, it can issue a software reset. This is also good for recovering from very rare and almost-impossible to catch software "issues". 73/ Bob - W5BIG ----- Original Message ----- From: "Stewart Baker" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Cc: <elecraft@mailman.qth.net> Sent: Wednesday, December 01, 2004 1:00 AM Subject: Re: [Elecraft] K2 - Strange Problem ? On Tue, 30 Nov 2004 15:45:37 EST, [EMAIL PROTECTED] wrote: > In a message dated 30/11/04 16:46:51 GMT Standard Time, > [EMAIL PROTECTED] writes: > That's what I was doing, however, because anything capacitive slows the rise > of > the 5A rail, and hence the correct MCU initialisation, I was chasing my tail. > > > This is a problem I have come across before about 5 years back where we had a > newly developed repeater logic controlled by a PIC chip. > I had the prototype running the local 2m repeater and the problem was that > there were what appeared to be clock pulses appearing on the through audio of > the logic. Attempts to decouple the 5V supply rail were disastrous in that it > locked up the PIC chip. Eventually traced to the gremlin of delayed voltage > rise on the chip due to charging of the decoupling capacitors. This is poison > to the PIC chips as they require apparently a very fast rise time on the > supply voltage. In our case the problem was self inflicted and was due to > trying to be clever and using two regulators in tandem. Was cured by > reverting to only one regulator fed direct from the incoming DC supply and > only just enough decoupling to clean up the supply line. > There is an additional support you can give the PIC chip in start up I > discovered when trying to fault find on a partially defective chip. > If instead of connecting the PIC chip MCLR pin direct to 5V (see U6 pin 1, > the MCU on the K2 control board), connect it via a 10K ohm resistor and place > a 4.7 to 10uF capacitor on the MCLR pin. This resultant delay allows all the > voltages to stabilise before the chip is enabled. At least it is my belief of > how the modification works. Additionally I added a diode with the anode to > the MCLR pin across the 10K resistor to discharge the capacitor quickly in > the event of a power interruption or the chip would again lock up. This was a > change made to get over a particular problem with a PIC chip, but could be > the answer to some odd glitches experienced recently. We now have this > incorporated into our repeater logic as a standard. An entirely different > usage, though one that could have parallels. > Perhaps Eric or Wayne at Elecraft could comment. > Bob, G3VVT Hi Bob, Thank you for the detailed explanation of your experiences with PIC resets. Microchip data sheets/books show a number of ways that a reset can be achieved on their PIC's. Tying MCLR and VDD together is unsatisfactory. The way you describe with the R,C and diode gives a very reliable reset everytime and is independent of the supply rise time. The diode makes sure that the MCLR line always starts from a known state by discharging the C. As you mention glitches on the supply also need to be addressed. Although not directly involved with the "strange problem" I consider the MCU reset a point of weakness in the K2 design, and am contemplating modifying the Control board to add a proper reset. I too would be interested in comment from Eric or Wayne. 73 Stewart G3RXQ _______________________________________________ Elecraft mailing list Post to: Elecraft@mailman.qth.net You must be a subscriber to post to the list. Subscriber Info (Addr. Change, sub, unsub etc.): http://mailman.qth.net/mailman/listinfo/elecraft Help: http://mailman.qth.net/subscribers.htm Elecraft web page: http://www.elecraft.com