Gast
#280603
Hallo! Ich habe einen DS1820 an einem mega 16 angeschlossen. ich kann die temperatur ohne probleme auslesen aber wenn sie über 75 grad steigt liefert der sensor nur noch müll. alle bits die gelesen werden sind 1. auch TH und TL. weis jemand was ich falsch mache?? danke $regfile = "m16def.dat" '$crystal = 800000 Config Lcdpin = Pin , Db4 = Portc.3 , Db5 = Portc.5 , Db6 = Portc.6 , Db7 = Portc.7 , E = Portc.2 , Rs = Portc.0 Config Lcd = 16 * 2 Config Portc = Output Initlcd Cls Config 1wire = Portd.6 Deflcdchar 0 , 28 , 20 , 28 , 32 , 32 , 32 , 32 , 32 Dim Bd(9) As Byte Dim I As Byte Dim T As Integer Dim Tz As Byte Dim Ar(8) As Byte T = 0 Cursor Off Noblink Cls Do For I = 1 To 8 Dim J As Byte J = I - 1 Ar(i) = Lookup(j , Dta1) Next 1wreset 1wwrite &H55 1wwrite Ar(1) , 8 1wwrite &H44 'Wait 1 1wreset 1wwrite &H55 1wwrite Ar(1) , 8 1wwrite &HBE T = 1wread(2) 1wreset T = T / 2 Cls : Lcd "T = " ; T ; "C " Loop End Dta1: Data 16 , 154 , 44 , 1 , 1 , 8 , 0 , 14