On 03/04/2011 06:55, geetansh arora wrote: > i m trying to measure speed of objects using LDR/photodiode connected to > interupt pin n a light beam is focussed on it. when a object passes d lig= ht > beam,d voltage at that pin will change but only for some milli seconds n = i > want to calculate that time. > plz help. > i think this time i m more clear abt my problem n u guys will be able to > help me. > thank you If it is milliseconds (last time it was microseconds?) then it's a=20 little easier. The advice is pretty much the same though, check out the=20 CCP peripheral in the datasheet, this is probably the simplest way.=20 Alternatives are things like using the timers, or counting cycles in a=20 loop. All basically involve detecting a change of voltage on a pin, then=20 counting until it changes again. I would give it a try and see how you go, then if you run into problems=20 post your code and we can help more. --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .