PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : DS1621 in 0,1 Schritten auslesen



Haveaniceday
20.04.2008, 15:40
Hallo zusammen,
ich benutze mehrere DS1621 bzw. 1631 die ich über I2C Bus auslese.
Allerdings kann ich momentan nur die vorkommerstellen ordentlich auslesen. Die nachkommer stelle kann nur 2 zustände einnehmen, 0 und 128. Würde aber gerne in 0.1°C Schritten auslesen.
Hat das schonmal einer gemacht? Weil soweit ich weiß kann der DS1621 auf 0,0625°C messen...

LG Hannes

linux_80
20.04.2008, 17:20
Hallo,

der DS1621 kann nur in 0,5° Schritten messen.
Der DS1631 kann eingestellt werden, wieviel Bit zum messen der Temperatur verwendet werden, wenn man das auf 12 Bit einstellt hat man die 0,0625°.


The resolution of the output digital temperature data is user-configurable to 9, 10, 11, or 12 bits, corresponding to temperature increments of 0.5°C, 0.25°C, 0.125°C, and 0.0625°C, respectively. The default resolution at power-up is 12 bits, and it can be changed through the R0 and R1 bits in the configuration register. Note that the conversion time doubles for each additional bit of resolution.

Drifter2006
20.04.2008, 18:07
Hello,


Hallo,

der DS1621 kann nur in 0,5° Schritten messen.



This is not entirely true.
By reading out the Counter and Slope Bytes and performing a calculation you can get temperatures in higher resolutions:



Higher resolutions may be obtained by reading the temperature,
and truncating the 0.5°C bit (the LSB) from the
read value. This value is TEMP_READ. The value left in
the counter may then be read by issuing a READ
COUNTER command. This value is the count remaining
(COUNT_REMAIN) after the gate period has
ceased. By loading the value of the slope accumulator
into the count register (using the READ SLOPE command),
this value may then be read, yielding the number
of counts per degree C (COUNT_PER_C) at that temperature.
The actual temperature may be then be calculated
by the user using the following:
TEMPERATURE = TEMP_READ – 0.25 + (COUNT_PER_C – COUNT_REMAIN) /COUNT_PER_C

But…. Not as high as the DS1631.

Greetings,
Drifter2006

Haveaniceday
20.04.2008, 19:29
Vielen Dank erstmal für die Antworten.

Angenommen ich will jetzt auf 0,25° umstellen, d.h. R1=0, R0=1. Dann würde das "CONFIGURATION REGISTER" folgendermaßen aussehn: 00001100 welches dem hexwert 0xC entspricht, soweit richtig?

Aber wie sende ich jetzt das configurations register? Einzige was mir jetzt einfällt wäre so:


#define accconf AC

i2c_init();
i2c_start(i2ctemp1 + I2C_WRITE);
i2c_write(STARTCONVERT + accconf);
i2c_stop();


Nur wie sage ich ihm dann wie das configurations register auszusehen hat? Also 00001100 (C)




Access Config [ ACh ]
Reads or writes the 1-byte configuration register.

MSb bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 LSb
DONE THF TLF NVB R1 R0 POL* 1SHOT*