Luberth Dijkman wrote: > > Hello Roman, > > No this is not my first time on the list > i think around 1997 i whas here ( build bob blicks and don zehnders digital/analog > propeller pic clock) > > you say counting pulses for half a second > i think i dont like that because there could be a missing pulse > so the error is around 60 rpm i think Whoops my mistake, you said a RPM meter to 20,000 rpm? So that is up to 333Hz? Sorry I thought you wanted 20,000Hz. > what i understand of the code is that its important how many cycles each possible loop > has > i think because the pic only has one timer and the timer is used for the input > if so i dont like that > > will take some time but im not giving up Your [image] didn't come through. For speeds up to 20,000 RPM (333Hz) maybe try this; * when input goes high; * get period reading * reset timer0, reset byte2 and byte3 * when timer0 overflows (interrupt); * increment byte2 * if byte2 overflows; * increment byte3 So when you get the / edge of the input you get a timer0 count up to 3 bytes, which should be accurate even down to quite low frequencies. This should be very easy to do in asm. :o) -Roman -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.