Hi Bruce, If you are not driving the opto correctly there may be a variation in the rise time. I would suggest that you check the data sheets on the 4N25, and ensure that you are getting the frequency response you expect. 4k7 is a relatively light load. I would opt for something less maybe 470R, but depends on the ctr and frequency response characteristics of the opto. ---------------------------------------------------------- >I am using a 16C56 part to measure pulse widths >(in the 0 to 10 ms range). My problem is that I >am getting unreliable input pin detection within >software. I am driving the pin with a test 50 percent >duty square wave, and the measued pulse is correct most >of the time, but on random occasions the software indicates >that the pulse is slightly longer than it really is. > >I am driving the input pin via an 4N25 optocoupler, with >the input pin connected between the collector of the phototransistor >(with the emitter grounded) and a 4.7K pullup resistor. >I believe the software is working correctly, and the problem is >With the hardware implementation. > >Do I need any special filtering on input ports to reduce >false triggering? Am is missing something?? > >- Bruce > > >-- >----------------------------------------------------- ><<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >----------------------------------------------------- > Bruce A. Bowling > Staff Scientist > Thomas Jefferson National Accelerator Facility > 12000 Jefferson Ave - Newport News, VA 23602 > (804) 249-7240 >bowling@cebaf.gov http://devserve.cebaf.gov/~bowling >----------------------------------------------------- ><<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >----------------------------------------------------- Ray Gardiner, Shepparton, Victoria, Australia: ray@netspace.net.au