Witam , wymyśliłem sobie urządzonko w teorii ale w praktyce mam taki problem: podłączam do ATMEGA 8 po 1wire Ds 1820 lub 1990 i nie mam nawet zmiennej err=0 tylko ciągle 1 . Jest rezystor 3.3kom od + do DQ (uruchomieniówka od BTC) , schemat podłączenia jest tak banalny że nie wiem co może być nie tak .
$regfile = "m8def.dat"
$crystal = 8000000
Config Lcd = 16 * 2
Config Lcdpin = Pin , Db4 = Portc.3 , Db5 = Portc.2 , Db6 = Portc.1 , Db7 = Portc.0 , E = Portc.4 , Rs = Portc.5
Config 1wire = Portb.0
Declare Sub Odcz_temp
Dim Temperatura(2) As Byte
Dim A As Byte
Deflcdchar 0 , 7 , 5 , 7 , 32 , 32 , 32 , 32 , 32
Do
Cls
For A = 1 To 8
Waitms 100
1wreset
Lcd A
Lowerline
Lcd Err
Upperline
Next
Loop
End
$regfile = "m8def.dat"
$crystal = 8000000
Config Lcd = 16 * 2
Config Lcdpin = Pin , Db4 = Portc.3 , Db5 = Portc.2 , Db6 = Portc.1 , Db7 = Portc.0 , E = Portc.4 , Rs = Portc.5
Config 1wire = Portb.0
Declare Sub Odcz_temp
Dim Temperatura(2) As Byte
Dim A As Byte
Deflcdchar 0 , 7 , 5 , 7 , 32 , 32 , 32 , 32 , 32
Do
Cls
For A = 1 To 8
Waitms 100
1wreset
Lcd A
Lowerline
Lcd Err
Upperline
Next
Loop
End