27220 Parallax Inc, 27220 Datasheet - Page 180

BOOK STAMPWORKS

27220

Manufacturer Part Number
27220
Description
BOOK STAMPWORKS
Manufacturer
Parallax Inc
Datasheet

Specifications of 27220

Accessory Type
Booklet
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Not applicable / Not applicable
For Use With/related Products
StampWorks
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Not applicable / Not applicable
' -----[ Subroutines ]-----------------------------------------------------
Read_DS1620_HR:
Behind the Scenes
Digging deeper into the mechanics of the DS1620 we find that temperature is
derived by using two temperature-controlled oscillators. When one oscillator rolls-
over within a gate period determined by the other, the temperature counter – which
has been preloaded with -55 degrees C – gets incremented. Fractional temperatures
can be determined by looking at the count remaining at the end of a conversion
HIGH Reset
SHIFTOUT DQ, Clock, LSBFIRST, [StartC]
LOW Reset
DO
LOOP UNTIL (done = 1)
HIGH Reset
SHIFTOUT DQ, Clock, LSBFIRST, [RdTmp]
SHIFTIN DQ, Clock, LSBPRE, [tempIn\9]
LOW Reset
HIGH Reset
SHIFTOUT DQ, Clock, LSBFIRST, [RdCntr]
SHIFTIN DQ, Clock, LSBPRE, [cRem\9]
LOW Reset
HIGH Reset
SHIFTOUT DQ, Clock, LSBFIRST, [RdSlope]
SHIFTIN DQ, Clock, LSBPRE, [slope\9]
LOW Reset
tempIn = tempIn >> 1
tempIn.BYTE1 = -tempIn.BIT7
tC = tempIn * 100
tC = tC - 25 + (slope - cRem * 100 / slope)
IF (tC.BIT15 = 0) THEN
ELSE
ENDIF
RETURN
HIGH Reset
SHIFTOUT DQ, Clock, LSBFIRST, [RdCfg]
SHIFTIN DQ, Clock, LSBPRE, [config\8]
LOW Reset
tF = tC */ $01CC + 3200
tF = 3200 - ((ABS tC) */ $01CC)
' get hi-resolution temp
' alert the DS1620
' start conversion
' release the DS1620
' read config register
' wait for conversion
' read raw temperature
' read counter
' read slope
' remove half degree bit
' extend sign bit
' convert to 100ths
' fix fractional temp
' convert pos C to Fahr
' convert neg C to Fahr

Related parts for 27220