Shop OBEX P1 Docs P2 Docs Learn Events
Program DS1620 as a stand-alone thermostat using BS2 — Parallax Forums

Program DS1620 as a stand-alone thermostat using BS2

KatyBriKatyBri Posts: 171
edited 2007-04-20 01:26 in BASIC Stamp
I have a new project where I need to program a DS1620 as a stand-alone thermostat.

The Parallax DS1620 App Note had example code for a BS1, but not a BS2 (unless I missed it).

Other code I've found was in VB6, or was too involved.

Does anyone know where some simple BS2 code, which can be pasted into the BS2's IDE, may be found? All I need to do is program the DS1620's upper and lower set points.

Thanks.

Comments

  • Tracy AllenTracy Allen Posts: 6,664
    edited 2007-04-19 20:11
    www.emesys.com/OL2d1620.htm#thermostat

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • KatyBriKatyBri Posts: 171
    edited 2007-04-19 22:37
    Thanks Tracy,

    I need help with one last thing. The following piece of code-

    ' set the upper threshold= +7.5 deg C· shiftout 15,14,lsbfirst,[noparse][[/noparse]1,15\9]· ' upper threshold=15/2=7.5 deg CI don't see how one gets the 15/2=7.5 How would I change the code for +26 deg C (80F) and +29 deg C (85F)
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-04-19 22:47
    There is also some code for a Digital Thermostat I built back in NY. You may find some of the code useful. Tracy actually helped on the C to F conversion.

    http://forums.parallax.com/showthread.php?p=601101

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2007-04-20 00:21
    The value that is shifted out is in units of 0.5 degrees Celsius. Thus the 15 in...

    shiftout 15,14,lsbfirst,[noparse][[/noparse]1,15\9]

    specifies a threshold of 7.5.

    So for thresholds of 26.0 and 29.0 you would use 52 and 58 respectively. Don't forget the \9 for nine bits.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • C.MoherC.Moher Posts: 35
    edited 2007-04-20 00:30
    I just happen to be working on the same thing with the same chip.

    See;

    http://www.parallax.com/dl/docs/books/edu/WebAppliedSensors-v1.4.pdf



    It lays out a nice easy to understand thermostat with the DS1620. I am having trouble however with displaying the 0.5 decimal part of the DS1620... see my post to follow.
  • KatyBriKatyBri Posts: 171
    edited 2007-04-20 01:26
    You all were very helpful. Thanks very much. I'm all set now.
Sign In or Register to comment.