E-LAB Computers
 

My LM75 / DS75 Unit

  • 1
  • 2
  • Seite 2 von 2
mc-electronic
Benutzer
Avatar
Geschlecht: keine Angabe
Herkunft: Sauerland NRW
Beiträge: 372
Dabei seit: 03 / 2008
Betreff:

Re: My LM75 / DS75 Unit

 · 
Gepostet: 26.04.2010 - 13:22 Uhr  ·  #13
Hi Avra, hello Neil,

I have shortened the calculations of the LM/DS 75 a little. Since the data comes in in 2-complement, I use an integer for reading in and I suggest the following routine: This way the decimals AND the negative temperatures are covered automatically. (tested it in my fridge..)

Code
Initialize Sequence:

   I2Cout(cLM75adr,1,$00);  // Initialize the DS75 with 
                            // $60 = 12 Bit, $40 = 11 Bit, 
                            // $20 = 10 Bit, $00 = 9 Bit
   I2Cout(cLM75adr,0);      // Set default reading to temperature register



function GetTemperature (lLM75adr : Byte): Float;    // We read the temperature of the I²C chip here
Var
   lTmp : Integer;
Begin
   I2Cinp(lLM75adr,lTmp);    // Load the 2-Complement  directely into an Integer.
   lTmp := Swap (lTmp);      // Now swap Lo- and Hibyte (they come in reverse order)
   Return(float(lTmp)/256);  // and calculate the temperature
End;
mc-electronic
Benutzer
Avatar
Geschlecht: keine Angabe
Herkunft: Sauerland NRW
Beiträge: 372
Dabei seit: 03 / 2008
Betreff:

Re: My LM75 / DS75 Unit

 · 
Gepostet: 29.04.2010 - 17:03 Uhr  ·  #14
Finally the results:

I have exchanged the 3 worst LM75 with DS75 and I run those with 9 Bit. The jitters are gone, the temperature readings are stable now. So, in my 10 identical devices I have 3 with the DS75 and 7 with LM75 (which give good stable readings)

The problem were the LM75 chips themselves. So, for future purpose I will use the DS75 instead of the LM75. However, I must use the AVRco Soft I2C Driver now instead of the hardware I2C interface of the ATMega.

Again, thank you all for the support!

Michael
  • 1
  • 2
  • Seite 2 von 2
Gewählte Zitate für Mehrfachzitierung:   0

Registrierte in diesem Topic

Aktuell kein registrierter in diesem Bereich

Die Statistik zeigt, wer in den letzten 5 Minuten online war. Erneuerung alle 90 Sekunden.