Attiny85 (internal 1 MHz) with ds18b20 not working

Hi. My temperature sensor DS18B20 not working with Attiny85 (with internal oscilator 1 Mhz). I used OneWire library and texts displayed in I2C LCD 1602. Display is working rightly and DS18B20 with arduino also work rightly. Programme still displayed "no more address". Please, it works anyone? Can you help me, or send me rightly library Onewire for 1MHz internal oscilator or programme? Thanks for your advices.

The 1 wire protocol (used by the DS18B20) needs specific timings but if your using the Arduino at 1MHz then this speed is not properly supported by the Arduino core so timing delays will be effected. This will probably stop you from reading the device. Can you at least set the tiny85 to internal 8MHz that is supported by the Arduino cores and see if this helps?

Danek is probably right 200% percent.

Another thing you can do is to run the I2C scanner sketch (http://playground.arduino.cc/Main/I2cScanner).

This will scan the I2C bus and report any address found via the serial console.

But again, putting the clock at 8Mhz as suggested by Danek will put you in the right direction ...

dan

Thanks for your advices. I set tiny85 to internal 8MHz and ds18b20 is working rightly. :slight_smile:

Great news! We all love happy endings !!!! :-)

I Know this topic is closed for rather a long time, but I´ve a question considering just this Problem. I am searching for ways to decrease the power consumption of the Attiny and came up with slowing down the controller. My Question is: Is there a way to set the timings in the Attiny so it will communicate with OneWire @ 1 MHz?

It is possible. I.e. you may write the driver yourself. I don't know if there is library ready for this.

I have alredy taken all the commands of the OneWire library i needed and put them into my sketch. I was just wondering if someone has done the transciption before. I´ll try a few adjustments and if it works, post the example here. Wish you all a nice Christmas-time.

Not knowing what your MCU does when not reading the 1-wire might mean this is useless but if your sleeping the MCU between reads then possibly the power saved running at 1MHz is outweighed by the time it stays awake to execute the code compared to an 8MHz MCU.