DS18B20 Programm

Gast #296886
Lesenswert?
• ▲
▼
Hallo Leute,

ich habe vor, einen DS18B20 an einen Mega32 zu hängen. Lt. Datenblatt
kann der 0,5°C genau. Jetzt habe ich ein Programm gefunden, das 0,1°C
kann.

Kann mir einer das ein wenig erklären?
Dann gibt es noch eine Aussage in Datenblatt.

"The core functionality of the DS18B20 is its direct-to-digital
temperature sensor. The resolution of the
temperature sensor is user-configurable to 9, 10, 11, or 12 bits,
corresponding to increments of 0.5C,
0.25C, 0.125C, and 0.0625C, respectively. The default resolution at
power-up is 12-bit. The DS18B20
powers-up in a low-power idle state; to initiate a temperature
measurement and A-to-D conversion, the
master must issue a Convert T [44h] command. "
...
"The DS18B20 output temperature data is calibrated in degrees
centigrade; for Fahrenheit applications, a
lookup table or conversion routine must be used. The temperature data
is stored as a 16-bit sign-extended
two’s complement number in the temperature register (see Figure 2). The
sign bits (S) indicate if the
temperature is positive or negative: for positive numbers S = 0 and for
negative numbers S = 1. If the
DS18B20 is configured for 12-bit resolution, all bits in the
temperature register will contain valid data.
For 11-bit resolution, bit 0 is undefined. For 10-bit resolution, bits
1 and 0 are undefined, and for 9-bit
resolution bits 2, 1 and 0 are undefined. Table 2 gives examples of
digital output data and the
corresponding temperature reading for 12-bit resolution conversions.
"
Gruss

Dirk
Angehängte Dateien:

Antwort schreiben

Hinweis: der ursprüngliche Beitrag ist mehr als 6 Monate alt. Bitte hier nur auf die ursprüngliche Frage antworten, für neue Fragen einen neuen Beitrag erstellen.

Formatierung
  • [c]C-Code[/c]
  • [vhdl]VHDL-Code[/vhdl]
  • [code]Code in anderen Sprachen, ASCII-Zeichnungen[/code]
  • [math]Formel in LaTeX-Syntax[/math]
  • [[Titel]] – Link zu einem Artikel
  • Verweis auf einen anderen Beitrag: Rechtsklick auf dessen Beitrags-ID (#8078628), „Adresse kopieren“, in den Text einfügen

Mehr zur Formatierung

Längeren Sourcecode als Anhang, nicht in den Text. JPG nur für Fotos und Scans; Zeichnungen und Screenshots als PNG oder GIF. Siehe Bildformate.

Schon registriert? Anmelden

Wird nicht angezeigt. Wir schicken dir einen Link; sobald du damit bestätigst, erscheint dein Beitrag.

Mit dem Abschicken legst du einen kostenlosen Account an und erkennst die Nutzungsbedingungen und die Datenschutzerklärung an.