Mike, Lets say to measure each period I still need to setup a fixed time right? i= n=20 whatever time frame the measurement is ? like frequency counter is based on per second. the result displays every 1= =20 second.=20 AA ________________________________ From: Michael Rigby-Jones To: Microcontroller discussion list - Public. Sent: Mon, February 14, 2011 10:12:56 AM Subject: RE: [PIC] RPM measurement question > -----Original Message----- > From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu] On Behalf > Of Andre Abelian > Sent: 14 February 2011 17:49 > To: Microcontroller discussion list - Public. > Subject: [PIC] RPM measurement question >=20 > Hi all, >=20 > this is for VW bug engine. > I have square wave pulse. I use function generator to generate it. every > 4th > pulse is > 1 cycle. I am using pic12f683 capture input to read this pulse and I setup > to > read every 4th pulse. some thing > basic I am not picturing right. I need to find out how fast this engine > (pulse) > is running so engine is based on RPM > revolution per minute. in this case I have to setup a time and count > pulses to > determine the speed. Since it is RPM > counting 1 minute makes no sense so my question is how fast I should count > pulses to determine RPM? another words > lets say RPM shows 1000 revolution per minute if break it down will be in > 1 > 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... >=20 > any suggestion ? This depends entirely on your application. If this going to be for a tachometer, then one second update rate will not be anything like fast enough, and you won't get very good resolution at low engine speeds. Instead of counting the number of pulses within a fixed gate period, also consider measuring the period of the pulse and taking the reciprocal. This gets you a new frequency measurement for every pulse, at the cost of a (possibly large) division operation. Regards Mike =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D This e-mail is intended for the person it is addressed to only. The information contained in it may be confidential and/or protected by law. If you are not the intended recipient of this message, you must not make any use of this information, or copy or show it to any person. Please contact us immediately to tell us that you have received this e-mail, and return the original to us. Any use, forwarding, printing or copying of this message is strictly prohibited. No part of this message can be considered a request for goods or services. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist =20 --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .