I2C on the ATtiny85

Hello,

Do you know if the TinyWire library also supports the ATtiny84? Thank you very much.

Pedro Santos

i want to use the DS1307 with the attiny85 but i cant understand the example you provided. can you tell me how i can get the seconds, minutes and hours in to individual integers.

Pedro_Santos:
Do you know if the TinyWire library also supports the ATtiny84? Thank you very much.

Yes, I have had success running on an ATtiny84.

tigerbomb8:
i want to use the DS1307 with the attiny85 but i cant understand the example you provided. can you tell me how i can get the seconds, minutes and hours in to individual integers.

Attached is the code I use to connect the DS1307 and a dfrobot I2C LCD to the attiny85 at 8mhz internal.

10k pullups on the SDA and SCL lines.

The base DS1307 code I got from tronixstuff. My liquidcrystal I2C library is modified to handle the DFrobot display. Other displays can have significant variations in function so the display part won't work for you straight up.

clock_i2c_lcd.zip (2.22 KB)

hey when verifying the example code i get this error "C:\Users\Owner\Documents\Arduino\libraries\TinyWireM\USI_TWI_Master.cpp:329: error: 'USIPF' was not declared in this scope"

how do i fix this
and what do i need to change to run it at 8MHz

There's a good chance you have arduino version issues and attiny core issues.

The reference you're missing is in the following file in my arduino environment.
\hardware\tools\avr\avr\include\avr\iotnx5.h

I'm using the Google Code Archive - Long-term storage for Google Code Project Hosting. core exclusively now after encountering far too many issues burning fuses and general compiling with the high-low tech core.

I also followed coding badly's instructions for updating the AVR core and editing some of the files to get my environment correct first. Subsequently I have a hybrid 0022/1.0 arduino environment.

Unfortunately getting the environment correct is the first step. Setting yourself up to burn the fuses to 8mhz is a good first goal. If you can successfully do that you're environment should be right from then on.

Search the forum for attiny85 and 8mhz and you'll get there.

thanks for the help i will get on to it now.

I'm using a ATtiny85 using a Arduino Duemilanove as an ISP. The cores i'm using are located here: Google Code Archive - Long-term storage for Google Code Project Hosting. ... i believe it's being referred to as the "google" cores.

I'm trying to communicate with 4 blinkm's over i2c using a ATtiny85 and the TinyWireM lib. I've already been able to do this using my Arduino to communicate over i2c with these blinkm's with the builtin Wire lib and everything works ... so I know that the blinkm's are functioning properly.

My code is here: gist:dae96d4658745cd966ec · GitHub ... It seems that the "change color" command is making it to the blinkm's but not the "stop script" command.

If anyone can help me out that'd be greatly appreciated.

Do you have pull ups on the I2C lines?

yes I have a 4.7K on pins 5 and 7. i've also re-fused the attiny85 back to 1mhz instead of 8mhz.

Hi, I've read you're article in playground and i try to use TiniWireS to communicate with my AtTiny85 to an ArduinoUNO.

I've no problem to send from the Master (Arduino) and receive something from Slave. But when i use the function TinyWire.send(x), where x is 'byte' i can't see anything on the Arduino. If i try with Wire.available() it returns 'FALSE'

I'm sorry for my elementary english, i hope you can understand my problem.
Someone could help me?

Andrea