I'm working on a PID regulator for a speed motor controller :p I'm planing to capture with CCP2 the period from a 9 pulses per revolution encoder. I can't use other encoder than this! In order to display in RPM I use this algorithm: RPM = F * 60 / 9 since F = 1 / t(Period) RPM = 60M / t(us) / 9 or RPM = 6666666 / t(us) is there a simplest method? Thanks in advance. Dennis. -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu