'you need to disable the timer int before using the 1wire functions, and enable it afterwards. 'i2c can be used with interrupts. But 1wire uses timed loops for the delays and the interrupt will slown them down. 'Mark ' Primer branja temperature, kadar je samo en senzor na 1wire-bus-u $regfile = "m8515.dat" '$regfile = "m16def.dat" '$regfile = "attiny2313.dat" $crystal = 11059200 Config 1wire = Portb.7 'kje se nahaja naš senzor Config Lcd = 16 * 2 'Config Lcdpin = Pin , Db7 = Portc.7 , Db6 = Portc.6 , Db5 = Portc.5 , Db4 = Portc.4 , E = Portc.2 , Rs = Portc.1 'Config Lcdpin = Pin , Db7 = PortB.7 , Db6 = PortB.6 , Db5 = PortB.5 , Db4 = PortB.4 , E = PortB.3 , Rs = PortB.2 'Config Lcdpin = Pin , Db7 = PortB.7 , Db6 = PortB.6 , Db5 = PortB.5 , Db4 = PortB.4 , E = PortB.3 , Rs = PortB.2 Config Lcdpin = Pin , Db7 = Portd.7 , Db6 = Portd.6 , Db5 = Portd.5 , Db4 = Portd.4 , E = Portd.2 , Rs = Portd.1 Const Timer1reload = 10800 Config Timer1 = Timer , Prescale = 1024 Load Timer1 , Timer1reload On Ovf1 Timer1_isr Enable Timer1 Start Timer1 Enable Interrupts 'Add your code here Cls Lcd "DS1820-2.bas" Dim T As Integer T = 0 Cursor Off Noblink 'kurzor ne utripa, je ugasnjen Dim Sekundabit As Bit Do If Sekundabit = 1 Then Reset Sekundabit 1wreset 'reset 1wwrite &HCC 'skip ROM ne bo bral naslove 1wwrite &HBE 'READ Scratchpad mk dobi programe od senzorja T = 1wread(2) 1wreset T = T / 2 Cls : Lcd "T = " ; T ; "C " ' izpis temperature 1wreset 1wwrite &HCC 'skip ROM 1wwrite &H44 'convert temperature End If ' Tukaj lahko vgradimo vso ostalo logiko programa, ne da bi bila ovirana ' z wait ukazi... Loop End Timer1_isr: 'prekinitvena rutina Load Timer1 , Timer1reload Set Sekundabit Return