Shop OBEX P1 Docs P2 Docs Learn Events
DS1621&Basic Stamp — Parallax Forums

DS1621&Basic Stamp

ChenChen Posts: 15
edited 2011-02-14 18:42 in BASIC Stamp
Is there anyone who can send me the basic program that can measure both positive and negative temperature values with DS1621 and BS2?

I searched the internet and the limited available codes don't work. I expect a working one.

Comments

  • dandreaedandreae Posts: 1,375
    edited 2011-02-14 11:04
    Here is a link that may help you: http://www.phanderson.com/stamp/i2c/ds1621_1.html

    Dave
  • ChenChen Posts: 15
    edited 2011-02-14 17:47
    Thanks. That program does not give any hint on how to read negative temperature values and how to use fractional values. And I doubt about the I2C simulation part in that program. Someone might say it does not work. Do you ever try it and did it work?
  • Mike GreenMike Green Posts: 23,101
    edited 2011-02-14 18:42
    In order to understand how negative temperatures are handled and how fractional degrees are handled, you need to read and understand the DS1621 datasheet which explains what's provided by the DS1621 in its 9 bit result value. The program Dave provided supplies this 9 bit result value and it's your responsibility to interpret it properly. There is a comment near the beginning of the program that describes the division of the 9 bit value by 2 to yield an 8 bit value in degrees C.

    I suspect the program hasn't been tried as is because the value being divided by 2 is given as "i_byte" while the actual variable is "i_9_bits". How about if you try it?
Sign In or Register to comment.