-
Notifications
You must be signed in to change notification settings - Fork 228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wire.h fails #118
Comments
Just ran into the same problem. From what I found out, the ATtiny (at least the x5 variants, I don't know the x4 ones) supports TWI but implementation is quite different from the other AVR chips. While ATmega chips support a dedicated TWI module, ATtiny has a "Universal Serial interface" (USI), which can be used to implement TWI and SPI interfaces (and other things). ATmega TWI and ATtiny USI use different registers, so the Wire library will fail to compile for ATtiny. To me it looks like the low level part of the Wire library (twi.c and twi.h) would have to be re-implemented to support ATtiny. |
After looking a bit more I found http://playground.arduino.cc/Code/USIi2c There are several related repositories on GitHub, like https://github.com/adafruit/TinyWireM and https://github.com/rambo/TinyWire and several more. At this point I don't have an idea about which one is suited for which purpose. Another options seems to be the USIWire library https://github.com/puuu/USIWire which is part of the 1.8.3 IDE installation package. |
FYI: The USIWire library worked well for my project, which has to fetch data from an Si7021 humidity sensor. |
I just tried the adafruit TinyWireM library to use an attiny85 as a i2c-master and it did not work. In the end i got it running by just changing this newer core: |
I am using code similar to this (minus Serial). All other tests have worked. The error message I get is quite long, but it is here.
The text was updated successfully, but these errors were encountered: