File "ds1620.h"
Full Path: /home/analogde/www/68hc11/ds1620.h
File size: 2.21 KB
MIME-type: text/plain
Charset: utf-8
5a0
HTTP/1.1 200 OK
Date: Sat, 18 Jun 2005 20:10:32 GMT
Server: Apache/1.3.26 (Unix) Debian GNU/Linux mod_perl/1.26 mod_ssl/2.8.9 OpenSSL/0.9.6g PHP/4.1.2
Last-Modified: Wed, 08 Jan 2003 19:35:58 GMT
ETag: "15ce60f-773-3e1c7d9e"
Accept-Ranges: bytes
Content-Length: 1907
Keep-Alive: timeout=15, max=98
Connection: Keep-Alive
Content-Type: text/x-chdr
// **********ds1620.h
// Jonathan W. Valvano 1/15/02
// Interface between MC68HC812 and DS1620
// Copyright 2002 by Jonathan W. Valvano, valvano@uts.cc.utexas.edu
// You may use, edit, run or distribute this file
// as long as the above copyright notice remains
// See Valvano, Embedded Microcomputer Systems, Chap 3
// bit status Configuration/Status Register meaning
// 7 DONE 1=Conversion done, 0=conversion in progress
// 6 THF 1=temperature above TH, 0=temperature below TH
// 5 TLF 1=temperature below TL, 0=temperature above TL
// 1 CPU 1=CPU control, 0=stand alone operation
// 0 1SHOT 1=one conversion and stop, 0=continuous conversions
// temperature digital value (binary) digital value (hex)
// +125.0 C 011111010 $0FA
// +64.0 C 010000000 $080
// +1.0 C 000000010 $002
// +0.5 C 000000001 $001
// 0 C 000000000 $000
// -0.5 C 111111111 $1FF
// -16.0 C 111100000 $1E0
// -55.0 C 1100
1d3
10010 $192
// DS1620 MC68HC812A4
// 1 DQ PS5
// 2 CLK PS6
// 3 RST PS7
// 4 GND ground
// 5 TCOM not connected
// 6 TLOW not connected
// 7 THIGH not connected
// 8 Vcc +5 V with bypass cap to ground
void DS1620_Init(void); // ritual for DS1620
void DS1620_Start(void); // start conversion
void DS1620_Stop(void); // stop conversion
void DS1620_WriteConfig(char data); // write
0
config=data
void DS1620_WriteTH(int data); // write TH=data
void DS1620_WriteTL(int data); // write TL=data
unsigned char DS1620_ReadConfig(void); // read config/status
unsigned int DS1620_ReadTH(void); // read TH
unsigned int DS1620_ReadTL(void); // read TL
unsigned int DS1620_ReadT(void); // read temperature