Searching \ for 'DS1820' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/index.htm?key=ds1820
Search entire site for: 'DS1820'.

Truncated match.
PICList Thread
'DS1820'
1996\08\28@210848 by nogueira

flavicon
face
Hi again,

This time I need a routine to 'talk' to Dallas DS1820,
single wire digital teermometer.
I will need to read extended resolution, but standard
resolution is ok too.
If none of you have the code, I will do it and put to
the list.

Thanks for all,

Octavio
--
========================================================
Octavio Nogueira
e-mail:   spam_OUTnogueiraTakeThisOuTspammandic.com.br
homepage: http://ourworld.compuserve.com/homepages/tato
voice/fax: +55 11 240-6474
========================================================
"ProPic" The first Production PIC Programmer running in
Windows and under US$ 20.00.
Avaible at http://ourworld.compuserve.com/homepages/tato


'DS1820'
1996\09\01@172524 by nogueira
flavicon
face
Hi all,

I'm using the DS1820 one-wire temperature sensor from Dallas and I'm very
happy with it. It works very well and I have routines avaible to PICs.

In order to get a resolution grater than 0.5 degree I need to do the
following math, I'd like to get help solving this:

TEMPERATURE=TEMP_READ-0.25+(COUNT_PER_C-COUNT_REMAIN)/COUNT_PER_C

where:
TEMP_READ = 8 bits
COUNT_PER_C = 8 bits
COUNT_REMAIN = 8 bits
TEMPERATURE = 8 bits

I just want a small routine to do this math. If anyone can help me,
I will put the wole routine to use ths DS1820 on the list.

Regards,

Octavio
--
========================================================
Octavio Nogueira
e-mail:   .....nogueiraKILLspamspam@spam@mandic.com.br
homepage: http://ourworld.compuserve.com/homepages/tato
voice/fax: +55 11 240-6474
========================================================
"ProPic" The first Production PIC Programmer running in
Windows and under US$ 20.00.
Avaible at http://ourworld.compuserve.com/homepages/tato

1996\09\01@230154 by owler, Gary

flavicon
face
TEMPERATURE will need to be more than 8 bits if you want higher resolution
over the full temperature range.

Gary.
--------------------------------------------
Email: Gary.FowlerspamKILLspamdsto.defence.gov.au
Phone: +61 8 8259 5767
Fax:   +61 8 8259 5672

Defence Science & Technology Organisation
PO Box 1500, Salisbury, South Australia 5108
--------------------------------------------

----------
{Quote hidden}

1996\09\02@130505 by myke predko

flavicon
face
Octavio,

I had a similar problem with my thermometer (in the calibration routines).
The easiest way I found to resolve it was to convert the number to a 16 bit
by adding 8 trailing zeros to the number.

That way, a 1/4 is now simply adding 64 to your count and division can be
done by multiplying the fraction COUNT_PER_C.

Once you are finished with the operations on the 16 bit numbers, just take
the most significant 8 bits and you will have what you need.

Give me a ding if this doesn't make sense,

Myke
{Quote hidden}

Do you ever feel like an XT Clone caught in the Pentium Pro Zone?

1996\09\03@145647 by Scott Dattalo

face
flavicon
face
nogueira wrote:
> <snip>
>      I'd like to get help solving this:
>
> TEMPERATURE=TEMP_READ-0.25+(COUNT_PER_C-COUNT_REMAIN)/COUNT_PER_C
>
> where:
> TEMP_READ = 8 bits
> COUNT_PER_C = 8 bits
> COUNT_REMAIN = 8 bits
> TEMPERATURE = 8 bits
>
> I just want a small routine to do this math.


It's about time somebody asked another PIC related math question!

Suppose you make this little simplification:

TEMPERATURE=TEMP_READ-0.25+(COUNT_PER_C-COUNT_REMAIN)/COUNT_PER_C
          =TEMP_READ-0.25+ 1 - COUNT_REMAIN/COUNT_PER_C
          =TEMP_READ+0.75 - COUNT_REMAIN/COUNT_PER_C


Now, for an assumption/question. I assume that "TEMP_READ" is an 8-bit
integer that is very close to the correct temperature. The rest of the
equation is the fractional portion of "TEMPERATURE". Or maybe it is at
most one or two counts. Are these assumptions true?

If so, there are two tricks I can think of that can efficiently "solve"
this equation. But rather than posting a solution without first knowing
the problem, I'll wait to you verify the assumptions.

Scott

1996\09\04@075233 by Kalle Pihlajasaari

flavicon
face
Hi all temp fans,

> It's about time somebody asked another PIC related math question!
>
> Suppose you make this little simplification:
>
> TEMPERATURE=TEMP_READ-0.25+(COUNT_PER_C-COUNT_REMAIN)/COUNT_PER_C
>            =TEMP_READ-0.25+ 1 - COUNT_REMAIN/COUNT_PER_C
>            =TEMP_READ+0.75 - COUNT_REMAIN/COUNT_PER_C
>
>
> Now, for an assumption/question. I assume that "TEMP_READ" is an 8-bit
> integer that is very close to the correct temperature. The rest of the
> equation is the fractional portion of "TEMPERATURE". Or maybe it is at
> most one or two counts. Are these assumptions true?
>
> If so, there are two tricks I can think of that can efficiently "solve"
> this equation. But rather than posting a solution without first knowing
> the problem, I'll wait to you verify the assumptions.

One thing that may cause a lot of people a bit of a start is that the
TEMP_READ value is in 0.5 degree increments.

Otherwise your assumptions are correct.  Count_remain and Count_per_c
are both less than 255 and count remain is also less than count_per_c
and count_per_c cannot be 0 (probably a much narrower range of values)
Just a ratio of the slope ADC converter output.

Cheers
--
Kalle Pihlajasaari     RemoveMEkallespamTakeThisOuTdata.co.za
Interface Products     Box 15775, Doornfontein, 2028, South Africa
+27 (11) 402-7750      Fax: +27 (11) 402-7751

1996\09\04@080310 by nogueira

flavicon
face
Scott Dattalo wrote:
{Quote hidden}

Yes, you are absolutely right.

Octavio

--
========================================================
Octavio Nogueira
e-mail:   nogueiraEraseMEspam.....mandic.com.br
homepage: http://ourworld.compuserve.com/homepages/tato
voice/fax: +55 11 240-6474
========================================================
"ProPic" The first Production PIC Programmer running in
Windows and under US$ 20.00.
Avaible at http://ourworld.compuserve.com/homepages/tato


'DS1820'
1997\03\24@095619 by David BALDWIN
flavicon
face
I have some mail problems, so I am posting this again:


Has anybody some code to interface a PIc to more than one DS1820 or
DS1620 temp sensor? Thanks.

-david

P.S.: Andrew, ok for the WREN clearing. The loop was just to test the
writing, im my final application I only need to write three bytes "at a
time".


'DS1820'
1999\06\30@180146 by jvd
flavicon
face
Hello,

I'm looking for C examples using the DS1820, preferably Hi-Tech.
And to those that are interested there's a new rev of the DS1820 coming out.
DS18B20.  It is able to do 9-12 bit without doing math like the old one,
plus many other neat new features.  Just received a data sheet from Dallas
on it.  If intersted I could send it to you or the Dallas Contact.

Thank-you

Jason

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Jason Van Dellen
Application Developer
Electronic Proving Technology Inc.
EraseMEjvdspamattcanada.net
ICQ#  33592199
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

More... (looser matching)
- Last day of these posts
- In 1999 , 2000 only
- Today
- New search...