John, This depends on the accuracy that you need. What are you going to do with the force number when you get it? What you can do is the following: F = K*(T1-Zacutal)/T2actual, right? Ok, Multiply T1 and Zactual by some constant, let's call it C. Then, the result,F, will be C times bigger than you want it. Then,execute the following code: FH = (F & (C-1)) >> E; FL = F & (-C); Where 2^E = C. FH will be the portion of F to the left of the decimal point, FL will be the portion to the right. How you procede from there depends on what you want to do with it! If you want to do more math on it, it would be best to just leave it as F,and do the F->FH,FL conversion at the very end,before you present it or make a decision based on it. Sean where K is a constant = 4*Bit Scale Factor (like 255 bits from 50% duty cycle to 100%) T1 is the high time of the PWM during normal operation Zactual= Zcal*T2actual/T2cal. T2actual is the PWM on time during normal operation. Zcal is T1 during calibration. At 04:52 PM 11/7/99 -0500, you wrote: >I am calculating force from acceleration which is output as a variable PWM. >More acceleration the longer the T1 is high. The documentation for the sensor >says that fixed point math will be fine. Per your description, I can just >multiply by 2 to essentially shift the decimal point over. and then shift it >back when the calculation has concluded. > >Do I do any thing with the remainder, or just don't worry about it since it >will be in the 1000ths position and I really don't need to worry about that for >my application? > | | Sean Breheny | Amateur Radio Callsign: KA3YXM | Electrical Engineering Student \--------------=---------------- Save lives, please look at http://www.all.org Personal page: http://www.people.cornell.edu/pages/shb7 mailto:shb7@cornell.edu ICQ #: 3329174