All of lore.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: David Fries <david@fries.net>
Cc: Evgeniy Polyakov <johnpol@2ka.mipt.ru>, linux-kernel@vger.kernel.org
Subject: Re: W1: w1_slave units, standardize 1C or .001C?  Break API
Date: Mon, 21 Jan 2008 19:11:07 -0800	[thread overview]
Message-ID: <47955ECB.3050100@zytor.com> (raw)
In-Reply-To: <479541F5.9080705@zytor.com>

H. Peter Anvin wrote:
> David Fries wrote:
>> The ds18b20 one wire temperature sensor conversion routine is
>> returning the units in degrees C while the ds1820 (ds18s20) is
>> returning it in .001 degrees C.  20C vs 20312C.  Once you know the
>> units I'm liking the latter as it gives a higher precision.  Time to
>> break user applications so the driver can give the temperature in the
>> same units for both sensors.
>>
>> I only have the ds18b20 sensor model.  Here is the current output from
>> the sys file for this sensor.
>> /sys/devices/w1_bus_master1/28-0000000e84a2/w1_slave
>> 45 01 4b 46 7f ff 0b 10 84 : crc=84 YES
>> 45 01 4b 46 7f ff 0b 10 84 t=20
>>
>> I ran the example data from the specification for the ds1820 through
>> it's conversion routine and found that t= was 1000 times the value.  
>> What should the displayed units be? 
>> This is the same ds18b20 conversion *1000.  Is everyone ok or is any
>> objecting to .001 degrees C for the units?  Patch will follow.  The
>> .001 C does truncate one bit of precision from the ds18b20 by the way.
>>
> 
> Millikelvins would have the nice property of never being negative.  :)
> 

Alternatively, centikelvins would fit nicely in 16 bits if anyone cares...

655.35 K = 382.20 °C = 719.96 °F

	-hpa

  reply	other threads:[~2008-01-22  3:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-21 23:15 W1: w1_slave units, standardize 1C or .001C? Break API David Fries
2008-01-22  1:08 ` H. Peter Anvin
2008-01-22  3:11   ` H. Peter Anvin [this message]
2008-01-22 21:07     ` Evgeniy Polyakov
2008-01-22 21:12       ` Evgeniy Polyakov
2008-01-23  4:09     ` David Fries
2008-01-23  4:22       ` H. Peter Anvin
2008-01-22 21:06 ` Evgeniy Polyakov
  -- strict thread matches above, loose matches on Subject: below --
2008-01-23  4:00 David Fries

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47955ECB.3050100@zytor.com \
    --to=hpa@zytor.com \
    --cc=david@fries.net \
    --cc=johnpol@2ka.mipt.ru \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.