At 01:37 AM 5/12/03 +0000, you wrote: >Thanks for your reply. >The input to my schmitt trigger is actually pulses coming from an optical >encoder. 2 pulses of different phases are sent to my microcontroller via two >schmitt trigger to decode the position of the motor. My microcontroller is >configure as an event counter to count these pulses. I tried so many >techniques but fail to find a solution to this problem. Whenever any >equipment with transformer is switched on nearby, the counter jumps wildly. > >Being a rather lousy student myself, can you explain how can I lower the >high input impedance to my schmitt trigger? The wire carrying the pulses >from the optical encoder to the schmitt trigger is about 2meters long. > >Thanks alot! >Mark It's difficult to know the best approach without seeing your circuit. Perhaps if you can make a small gif of it, people on the list can suggest better solutions... You also need to verify how the electrical interference enters your circuit. If possible, try running it completely isolated from AC power - use batteries or whatever. See if this works. It may be coming in the opto input to the schmitt trigger or somewhere else. You will have to become adept at guessing where the trouble is and trying to verify your guesses! It is difficult for beginners but after doing so, you will learn a LOT! Good luck! Tom M. -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads