At 05:05 PM 3/13/02 -0500, you wrote: >Of course, for the utmost in simplicity, use 2 as your storage >factor. Your 2 is equivalent to my suggestion of 50. 360.00 * 50 = 18000 >Allows storage of values that when converted will have >a range from +65535 to -65535. The maximum error is off by 1. >For example, 35999 (which represents 359.99) is stored as >17999. When converted back you get 35998. ALL ODD values >will therefore be too small by exactly one count. Thus both >35998 and 35999 will ultimately convert to 35998. > >If you can tolerate the least significant digit in the answer >being off by 1, then this divide by 2 storage method is >the way to go, as it is super simple to implement. The 80 scale factor gives 60% better resolution (0.0125 vs. 0.02) and requires a simple 3-bit shift to put it into a form where it can be converted to BCD or ASCII for display with 0.1 resolution. I thought there might be cases where the 50 is better, though, which is why I mentioned it. I just can't think of any at the moment. 8-( Best regards, Spehro Pefhany --"it's the network..." "The Journey is the reward" speff@interlog.com Info for manufacturers: http://www.trexon.com Embedded software/hardware/analog Info for designers: http://www.speff.com 9/11 United we Stand -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads