>Thanks a great deal to all who gave me suggestions. I changed the unused >PIC I/O from outputs to inputs, and tied them all to ground. The circuit >works like a champ! I tried to re-create the problem, but I had no >"success" (prior, the problem was easily reproducible). > >FYI, I know I forgot to mention some things about the HW design. All >along, my mag switch, when open, is pulled up to 5V and closes to ground. >The switch is not debounced, though I will implement a design utilizing an >R/S flip-flop. You don't need any hardware, you can debounce by software. Gabriel > >Thanks again to all who responded! I hope you all will be as much help in >the future. > >Best regards, > >--John > > > > > >Quentin on 02/17/99 03:11:14 PM > >Please respond to pic microcontroller discussion list > > >To: PICLIST@MITVMA.MIT.EDU >cc: (bcc: John Esposito/gg/DadeInt) >Subject: Re: Hardware or software problem??? > > > > >Meet PICcy, your friendly ghost. :) > >I know you said you configured all unused pins as outputs, but this >still looks very much like you getting interference through a floating >input. Double check that. Also check RB4. >Could be your breadboard is having a bad connection. >Do you have a pullup/pulldown resistor on your switch input? >As a test, make all unused pins as input and connect them to ground. >connect the case of your Xtal to ground. >And, I don't think it is your problem, but you don't need the 74HC04 to >drive the LED, you can do that direct from the PIC pin via a 680 ohm >resistor. > >Just a few things I can think of. >Quentin