Jan-Erik Soderholm wrote: > Moses McKnight wrote: > >> Unless I pull the pin low before I change it to an input the >> line stays high. > > Never design anything like that. I didn't :-) >> - I guess due to the board traces and maybe the switch >> acting as a capacitor and storing a charge. > > Or, in other words, "undefined", which is the last > thing you want, right ? :-) Yep :-) >> What did you mean by open inputs? A pin tied to > > nothing and set as an input? > > Yes! > Never, ever do that ! > The pin will pick up electromagnetic "noice" from the > environment and act as a 50 (or 60) Hz generator and > create all sorts of non-wanted effects. > > So, *never* leave an CMOS input pin un-connected. > This is true for *any* CMOS circuit, not only > PICs and not only microcontrollers. Good to know. I guess that would be the case for the 4us or so that the pin is an input if the switch isn't pressed. I think we might can change the switch design around to fix this, but I'll have to get with my boss and think it over carefully. My boss is the designer and I'm just the programmer, but I have wound up helping on the design a little as well. A year ago I had never touched a PIC chip and knew almost nothing about electronics except the basic function of some of the components! So although I've learned a lot since then I would still put myself in the ignoramus newbie category overall :-) Thanks for your help, I believe I understand it better now. Moses -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist