Vasile, I remember doing similar thing with one of those Texas Instrument temperature sensors. What I did was simply change the higher 8 bits (the high byte). In other words, if the number is positive, leave it as it is, but if it is negative, change it to 0xFF. That should take care of it... Rudy > Thanks Gerhart and Tony > > On Mon, 3 Dec 2001, [Iso-8859-1] K|bek Tony wrote: > > > Hi, > > Perhaps if you would elaborate a bit on the actual > > formula you intend to use I can give some hints. > > > OK here is: > > temperature = temp_read - 1/2LSB + [ (count_per_degree - count_remain / > count_per_degree) ] > > All values are 9 bit numbers, > Truncated half-degree bit ( temp_read - 1/2LSB ) its a simple task: > rrf temp_read_lo, f > bcf status_c > rlf temp_read_lo, f > The new value ( 9 bit too ) will have resolution of only 1 C degree > instead of 0.5 C and will be contained in temp_read_lo, temp_read_hi > ( the sign ) > Application note 105 from Dallas said : > "convert truncated value from 2's complement to signed integer" > This is the problem I have. > Application note does say nothing more about. > But also it seems that measuring only positive temperatures I will not > have errors even I will not perform that conversion. > About division, I've plan to use a standard 16bit division routine, > maybe Nikolay will point to a 9 bit division one ? > > > We have had some disscussions about signed/unsigned on the list > > check the archives. > > There are some problems by checking archives even for registered people > because of overloading ( 1search/minute ) At my low transfer rate in one > minute I've got nothing . > What money are necesarry to improve the piclist server ? > > Thanks, Vasile > > -- > http://www.piclist.com hint: PICList Posts must start with ONE topic: > [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads > > > > -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads