![]() |
[Hardware] USB-Temperatur-Sensor-Tester-fuer-DS18B20
Liste der Anhänge anzeigen (Anzahl: 5)
Der vorgestellte USB-Temperatur-Sensor-Tester-fuer-DS18B20 ist ein
HID: Human Interface Device oder HIT - wie man will... Das briefmarkengrosse Platinchen für max. 4 Sensoren vom Typ DS18B20 kostet weniger als 10 EUR. Die Hardware und Software gibt es hier: ![]() Ich habe eine andere Software für WINDOWS angepasst. Quelle: ![]() Die wichtigste Procedure ist einfach:
Delphi-Quellcode:
Im Anhang ist der komplette Sourcecode + EXE.
// Callback procedure to capture incoming data
procedure HIDreader(Report: THIDReport; NumBytes: byte); stdcall; var InStr, HexStr, wertstr: AnsiString; I: Integer; wert : Single; begin InStr := ''; for I := 0 to NumBytes - 1 do InStr := InStr + CHR(Report.Data[I]); if Report.Data[1]=1 then Form1.InputWindow.clear; MM('Sensors found: '+ INTTOSTR(Report.Data[0])); MM('SensorNr: ' + IntToStr(Report.Data[1])); MM('Received: '+ INTTOSTR(NumBytes)+' Bytes'); Wert:= (Report.Data[4]+ 256 * Report.Data[5]) / 10; wertstr:= FormatFloat('0.0', wert)+' °C'; case Report.Data[1] of 1 : Form1.S1.Caption:= wertstr; 2 : Form1.S2.Caption:= wertstr; 3 : Form1.S3.Caption:= wertstr; 4 : Form1.S4.Caption:= wertstr; end; HexStr := ''; for I := 1 to Length(InStr) do HexStr := HexStr + IntToHex(ORD(InStr[I]), 2) + ' '; MM(HexStr); MM('------------------------------------------------'); end; Beschreibung: ATMEL 90USB 162-16AU - ![]() Microcontroller: AT90USB162 16 kByte Flash 16 MHz Taktfrequenz 512 Byte EEprom 64 Byte-Packet Byte 0: Anzahl Sensoren Byte 1: Sensor-Nummer Byte 2: Anzahl USB-Temperatur-Reader Byte 4 + 5: Temperatur-Wert mit 1 Dezimalstelle Bytes 8-15: 64Bit-Unique number des Temperatursensors ![]() Übernahme: 2001: „Dallas Semiconductor“ aus Dallas, Texas ![]() ![]() ![]() "Each DS18B20 has a unique 64-bit serial code, which allows multiple DS18B20s to function on the same 1-Wire bus. The DS18B20 digital thermometer provides 9-bit to 12-bit Celsius temperature measurements and has an alarm function with nonvolatile user-programmable upper and lower trigger points. The DS18B20 communicates over a 1-Wire® bus that by definition requires only one data line (and ground) for communication with a central microprocessor. It has an operating temperature range of -55°C to +125°C and is accurate to ±0.5°C over the range of -10°C to +85°C. In addition, the DS18B20 can derive power directly from the data line ("parasite power"), eliminating the need for an external power supply. Interface Timing Communication with the DS18x20/DS1822 is achieved through the use of "time slots", which allow data to be transmitted over the 1-Wire bus. Every communication cycle begins with a reset pulse from the microcontroller followed by a presence pulse from the DS18x20/DS1822" Infos: ![]() ![]() |
AW: [Hardware] USB-Temperatur-Sensor-Tester-fuer-DS18B20
Nettes Projekt aber weshalb ist die wichtigste Prozedur so unvorteilhaft?
Man kann doch nicht in der gleichen Prozedur Daten von USB auslesen, die Daten dekodieren und dann auch noch auf "Form1" ausgeben. Die Datenerhebung und die Anzeige der Daten müssen vollständig voneinander isoliert werden. |
AW: [Hardware] USB-Temperatur-Sensor-Tester-fuer-DS18B20
![]() ![]() Zitat: "mikroPascal PRO for AVR is a full-featured Pascal compiler for Atmel® AVR devices. Pascal is a popular programming language that encapsulates strong data types, very nice syntax, and has probably the best balance between simplicity and control. It has intuitive IDE with docking support, rich with features, advanced text editor, many available tools, libraries and examples. Compiler uses advanced SSA optimization algorithms that reduce your generated code by an average of 20%. It is definitely an affordable solution and an excellent choice." ![]() |
AW: [Hardware] USB-Temperatur-Sensor-Tester-fuer-DS18B20
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 22:44 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz