I've done mul. and div. parts of the code but I don't understand how I can use timer 2 in time delay calculation. I'm using 16F887. Could you please say in words. I don't need the code. Thanks. On Thu, Nov 22, 2012 at 1:52 PM, David Meiklejohn wr= ote: > nik wrote: > > > > If I choose to count the ignition pulses per second, would using timer1 > > in counter mode while using timer0 to time 1 second (like what David > > suggested) be a better idea then using CCP in capture mode for the same > > method? > > As the others have been saying, it depends on how the trade-offs work for > you. Counting pulses in 1 sec is fine and easy, if you are happy with > having an updated rpm value every second. Counting over 1/10 sec gives y= ou > faster updates, but lower accuracy at low RPMs. For engine control, you > probably need faster feedback and as Denny pointed out, you'll get the > fastest response by measuring the time between pulses - but CCP isn't ide= al > for measuring long periods. > > By the way, it doesn't need to be timer0 that creates your time base - > bigger PICs have plenty of timers to choose from, but if you're looking a= t > a > 16F then timer2 is a good option because its period register and postscal= er > make it easy to generate interrupts at a rate that makes your calculation= s > easiest. > > Cheers, > David > > > > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .