ds1620 and bs2 code
Hey there everyone, first time poster, and just starting to get in basic
stamps and electronics, so please forgive my inexperience. I was wondering if
anyone had code to program the ds1620 digital thermometer/thermostat for
standalone operation.
thanks in advance,,
Lou
stamps and electronics, so please forgive my inexperience. I was wondering if
anyone had code to program the ds1620 digital thermometer/thermostat for
standalone operation.
thanks in advance,,
Lou
Comments
>stamps and electronics, so please forgive my inexperience. I was wondering
if
>anyone had code to program the ds1620 digital thermometer/thermostat for
>standalone operation.
>thanks in advance,,
>Lou
Hi Lou, the following demo uses the BS2 to program the DS1620 for
standalone mode. Demo thresholds are -0.5 and +1.5 degrees C. Pin 7 on
the DS1620 is high when the temperature is >=1.5, and pin 6 is high when
the temperature is <=-0.5. Pin 5 of the DS1620 is high when the temperature
>=1.5 and low when the temperature <=-0.5, providing hysteresis between the
two thresholds. When you disconnect the DS1620 from the stamp and move it
over to work standalone in an application circuit, tie its pins 2 and 3 to
Vss.
' P13=chip select
' high activates the DS1620 to receive data
' P14=serial clock
' P15=serial SPI data in and out
' configure DS1620 for standalone mode, continuous conversions
high 13
shiftout 15,14,lsbfirst,[noparse][[/noparse]12,0]
low 13
pause 10 ' let it write (be sure to allow time!)
'
' set the lower threshold= -5.5 deg C
high 13
shiftout 15,14,lsbfirst,[noparse][[/noparse]2,-1\9] ' lower threshold=-1/2=-0.5 deg C
' the twos complement number is sent correctly as 9 bits
low 13
pause 10 ' let it write
'
' set the upper threshold= +1.5 deg C
high 13
shiftout 15,14,lsbfirst,[noparse][[/noparse]1,3] ' upper threshold=3/2=1.5 deg C
' only necessary to send 8 bits for positive number
low 13
pause 10
You can find more explanation on my web site at
http://www.emesystems.com/BS2index.htm
http://www.emesystems.com/OWL2face.htm
or at
http://www.stampsinclass.com/downloads.htm
in the Earth Measurements link.
-- Tracy Allen
Electronically Monitored Ecosystems
http://www.emesystems.com
access to a Stamp at Parallax. That Stamp is monitoring temperature with a
DS1620. The code is available online.
-- Jon Williams
-- Dallas, TX