Forum

Einloggen | Registrieren | RSS  

DS18B20 mit BASCOM AVR (Elektronik)

verfasst von grindstone(R) E-Mail, Ruhrpott, 05.07.2025, 16:13 Uhr
(editiert von grindstone am 05.07.2025 um 16:26)

» dim scp(9) as Byte. Das ist ein Array mit 10 Feldern. Das Feld 0 muss auch
» mitgezählt werden. 0 - 9 ergibt 10 Felder also 10 Bytes.

Ich weiß nicht. Nach diesem Beispiel:

>>>
' Minimalprogramm für Temperaturmessung
Config 1wire = Portc.7

Dim Sep(9) As Byte

1wreset ' Initialisierung
1wwrite &HCC ' überspringe ROM-Befehl
1wwrite &H44 ' Temperaturmessung anstoßen

Waitms 500 ' warten bis Messung fertig

1wreset ' Initialisierung
1wwrite &HCC ' überspringe ROM-Befehl
1wwrite &HBE ' Temperatur auslesen
Sep(1) = 1wread(9) ' Daten in ein Array lesen, beschreibt Sep(1) bis Sep(9)

Wait 1
>>>

( Zu finden auf https://rn-wissen.de/wiki/index.php/Bascom_und_1-Wire )
beginnt der Index bei 1. Das bedeutet, xy liest ein Byte zu wenig aus.

Ausschnitt aus dem Datenblatt:
The core functionality of the DS18B20 is its direct-to-digital temperature sensor. The resolution of the
DS18B20 is configurable (9, 10, 11, or 12 bits), with 12-bit readings the factory default state. This
equates to a temperature resolution of 0.5°C, 0.25°C, 0.125°C, or 0.0625°C. Following the issuance of
the Convert T [44h] command, a temperature conversion is performed and the thermal data is stored in
the scratchpad memory in a 16-bit, sign-extended two’s complement format. The temperature
information can be retrieved over the 1-Wire interface by issuing a Read Scratchpad [BEh] command
once the conversion has been performed. The data is transferred over the 1-Wire bus, LSB first. The
MSB of the temperature register contains the “sign” (S) bit, denoting whether the temperature is positive
or negative.

--
Es ist unter der Würde eines Technikers, die Gebrauchsanweisung zu lesen!



Gesamter Thread:

DS18B20 mit BASCOM AVR - xy(R), 05.07.2025, 11:40 (Elektronik)
DS18B20 mit BASCOM AVR - bigdie(R), 05.07.2025, 12:22
DS18B20 mit BASCOM AVR - xy(R), 05.07.2025, 12:34
DS18B20 mit BASCOM AVR - bigdie(R), 05.07.2025, 15:30
DS18B20 mit BASCOM AVR - Altgeselle(R), 05.07.2025, 13:54
DS18B20 mit BASCOM AVR - xy(R), 05.07.2025, 14:02
DS18B20 mit BASCOM AVR - Altgeselle(R), 05.07.2025, 14:22
DS18B20 mit BASCOM AVR - xy(R), 05.07.2025, 16:26
DS18B20 mit BASCOM AVR - Altgeselle(R), 05.07.2025, 17:11
DS18B20 mit BASCOM AVR - bigdie(R), 05.07.2025, 18:02
DS18B20 mit BASCOM AVR - xy(R), 05.07.2025, 18:03
DS18B20 mit BASCOM AVR - grindstone(R), 05.07.2025, 14:16
DS18B20 mit BASCOM AVR - Pitsch, 05.07.2025, 14:41
DS18B20 mit BASCOM AVR - grindstone(R), 05.07.2025, 16:13
DS18B20 mit BASCOM AVR - xy(R), 05.07.2025, 16:30
DS18B20 mit BASCOM AVR - xy(R), 05.07.2025, 16:29
DS18B20 mit BASCOM AVR - GerK(R), 05.07.2025, 18:41
DS18B20 mit BASCOM AVR - xy(R), 05.07.2025, 18:54
DS18B20 mit BASCOM AVR - simi7(R), 05.07.2025, 20:02
DS18B20 mit BASCOM AVR - xy(R), 05.07.2025, 20:33
DS18B20 mit BASCOM AVR - grindstone(R), 05.07.2025, 20:02
DS18B20 mit BASCOM AVR - xy(R), 05.07.2025, 20:34
DS18B20 mit BASCOM AVR - Gast, 05.07.2025, 20:25
DS18B20 mit BASCOM AVR - xy(R), 05.07.2025, 20:36
DS18B20 mit BASCOM AVR - Gast, 05.07.2025, 21:25
DS18B20 mit BASCOM AVR - xy(R), 05.07.2025, 21:45
Fehler gefunden! - xy(R), 06.07.2025, 00:01
Fehler gefunden! - simi7(R), 06.07.2025, 08:17
Fehler gefunden! - bigdie(R), 06.07.2025, 09:33
Fehler gefunden! - Gast, 06.07.2025, 09:37
Fehler gefunden! - xy(R), 06.07.2025, 10:19