Hi Olin, I was thinking about what you said and now finally I understand. since time= r1 is=20 16 bit and going slower speed timer1 value=20 can overflow if it was setup to run fast and this is the reason it started= =20 jumping so i need to cover slowest speed first. in this case divide by 8 ti= mer1=20 prescaler covers slowest speed. I just tested input 1 hz i do not see any j= ump.=20 thanks for the info. now my next step is to do the rpm measurement. I have 1 hz input and capture value I am getting= =20 15.38 hz looking at the scope 65ms period using test delay routine. getting accurate RPM is not necessary in this cas= e.=20 average will do the job.=20 Andre =20 ________________________________ From: Olin Lathrop To: Microcontroller discussion list - Public. Sent: Sun, February 27, 2011 6:00:30 AM Subject: Re: [PIC]: having hard time to make RPM routine work Andre Abelian wrote: > I am seeing is going below 65 Hz the output is unstable and result > either shows low number or if I go even lower like 50 hz the output > frequency starts jumping higher kind of strange. This sounds like the period is long enough to be more than a whole timer 1 interval and you didn't deal with the wrapping properly. ******************************************************************** Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products (978) 742-9014. Gold level PIC consultants since 2000. --=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 .