If you are using the reed switch to take your PIC out of sleep mode, no deboucing is necessary, except that you might want to run for a few milliseconds until the reed settles down. The resistor is sized so that the PIC sees a reliable state change over all temperature ranges. Remember that if the reed switch is too far away, external effects (such as nearby lightning and/or motors, flourescent lamps, etc) can cause the PIC to not act correctly unless the resistor value is low enough. If a few inches away, 100K is fine; if 200 meters away, I'd drop to 10K. But you can help by making the wires to the reed switch a twisted pair, and even better if the pair is inside a shielded jacket. In that case 22K might suffice. --Bob At 09:55 AM 7/29/2003 +0300, you wrote: >There is a reed switch connected to a cable and it is connected to portb >of the PIC. PIC is on battery voltage of 3 or 3.6 (lithium). I have been >reading the pulses generated from the reed switch when magnet is brought >near. I have two questions: > >* There seems to be no need for debouncing, should I still debounce? >* What is the ideal resistor value to be used (note that the system needs >low power consumption) >* If the cable between the pic and the reed is about 100meters, (makes 200 >meters of total distance from one pic pin to reed and from reed to ground) >should the above resistor value be changed? Would I need any other parts >like schmitt triggers etc.)? > >Any help is appricated, > >Omer > >-- >http://www.piclist.com#nomail Going offline? Don't AutoReply us! >email listserv@mitvma.mit.edu with SET PICList DIGEST in the body --------------- NOTICE 1. This account can accept email & attachments up to 10M in size. 2. Federal Monitors: At request of client, some attachments are encrypted. Please DO NOT delay traffic; please reply with credentials for password. -------------- -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body