The DS1620 is a digital thermometer. The chip has an internal temperature conversion table so the user does not have to make a separate table. Temperatures between -55 and 125 degrees Celsius can be measured by the DS1620 in units of 0.5 degrees.
Const Device = CB220 Const iorst = 7 Const ioclk = 6 Const iodq = 5 Dim i As Integer Delay 100 High iorst ' init ds1620 ShiftOut ioclk,iodq,0,12,8 ShiftOut ioclk,iodq,0,3,8 Low iorst High iorst ShiftOut ioclk,iodq,0,&hEE,8 Low iorst Do High iorst ShiftOut ioclk,iodq,0,&haa,8 i = ShiftIn(ioclk,iodq,4,9) i = i debug dec i,cr Low iorst Delay 100 Loop
The final value received must be divided by 2 to obtain the correct temperature.