Em 14/2/2011 15:48, Andre Abelian escreveu: > Hi all, > > this is for VW bug engine. > I have square wave pulse. I use function generator to generate it. every = 4th=20 > pulse is =20 > 1 cycle. I am using pic12f683 capture input to read this pulse and I setu= p to=20 > read every 4th pulse. some thing=20 > basic I am not picturing right. I need to find out how fast this engine (= pulse)=20 > is running so engine is based on RPM > revolution per minute. in this case I have to setup a time and count puls= es to=20 > determine the speed. Since it is RPM > counting 1 minute makes no sense so my question is how fast I should coun= t=20 > pulses to determine RPM? another words > lets say RPM shows 1000 revolution per minute if break it down will be i= n 1=20 > second 16.666 revolution so > should I count for 1 second and expect 16 or 17 counts?=20 > > I do not know for some reason I am not picturing it right... > > any suggestion ? > > > thanks > > Andre You will get better resolution if you not count the pulses, but instead measure the interval between the start or the end of two consecutive pulses (indeed the total length of one pulse =3D low period + high period). You may use the same CCP module you are using now. You should be able to get a resolution better than 1us. Measure the time T of the pulse and calculate the frequency F =3D 1 / T. Best regards, Isaac __________________________________________________ Fale com seus amigos de gra=E7a com o novo Yahoo! Messenger=20 http://br.messenger.yahoo.com/=20 --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .