PDA

View Full Version : Program DS1620 as a stand-alone thermostat using BS2



KatyBri
04-20-2007, 03:57 AM
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.

Tracy Allen
04-20-2007, 04:11 AM
www.emesys.com/OL2d1620.htm#thermostat (http://www.emesys.com/OL2d1620.htm#thermostat)

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com (http://www.emesystems.com)

KatyBri
04-20-2007, 06:37 AM
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,[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 Savage
04-20-2007, 06:47 AM
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 Allen
04-20-2007, 08:21 AM
The value that is shifted out is in units of 0.5 degrees Celsius. Thus the 15 in...

shiftout 15,14,lsbfirst,[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 (http://www.emesystems.com)

C.Moher
04-20-2007, 08:30 AM
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.

KatyBri
04-20-2007, 09:26 AM
You all were very helpful. Thanks very much. I'm all set now.