> Using your formula and simulating in Excel I always get an offset dependant > on FF i.e. if using 1/16 then error is -15 counts and if 1/32 then error > is -31 counts. Should this be added on at the end if using integer maths? The formula was not intended for just integers. It is usually a good idea to have enough fraction bits for the bits of shifting implied by FF. So if FF is 1/16, then there should be 4 fraction bits. Of course the formula works with more too. Sometimes is is convenient to use 8 fraction bits even when fewer are needed. The result can be read by picking off the approriate bytes instead of having to shift to get rid of the fraction bits. ***************************************************************** Embed Inc, embedded system specialists in Littleton Massachusetts (978) 742-9014, http://www.embedinc.com -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads