At 09:26 PM 6/12/08, you wrote: >The speedo wants 2,458 pulses per kilometre. This works out at dividing >the wheel sensor frequency by about 2.367 with a maximum frequency from >the wheels of 320Hz at 150MPH (no I don't plan to go that fast! Might as >well design to the max speed though). Express the 1/2.458 as a fractional binary number: = 0.0110 1100 0010 0111 etc... or = 0.6C27 in hexadecimal Now make a 16 bit variable, add 0x6C27 to it for every incoming pulse. Every time there is a carry set after addition, send an output pulse. The division ratio will be very close to 2.367 without large tables. Best regards, Josef -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist