Getting OneWire and DallasTemperature to work with ATtiny core

I have a feeling there's something basic I'm missing... I'm trying to get OneWire.h and DallasTemperature.h to compile when, in the Arduino software, I set the board to any of the ATtiny84 and ATtiny85 choices. It works fine when putting projects together on the Uno, but transferring those projects to the ATtiny chips isn't working.

Platform: Mac OSX 10.6.8
Software: Arduino 1.0.4
ATtiny core is from Google Code Archive - Long-term storage for Google Code Project Hosting.. (the only one I saw is for Arduino 1.0.1, so that's what I'm using)

Thus far I haven't found any posts on the subject, so I'm wondering if there's an addition to this core I'm missing to make this work. For example, when running the Simple sketch from the DallasTemperature library, the error I'm getting is this:

Applications/ relocation truncated to fit: R_AVR_13_PCREL against symbol `exit' defined in .fini9 section in /Applications/


Maybe this fix for sketches > 4kb could help?

Applications/ relocation truncated to fit: R_AVR_13_PCREL against symbol `exit' defined in .fini9 section in /Applications/

That's a linker bug. You need to update your compiler. Download WinAVR and copy the contents of the 'bin' folder to the corresponding folder in your Arduino installation.

The fix Erni mentions will do the trick :slight_smile:

Indeed, that fixed the issue - thanks!

For others needing to do this, the file does come over as extensionless, and that's ok. When you move it into the intended directory, in the Mac OS it may show up as a TextEdit or a Terminal application, and it may not be recognized as a unix executable file. The trick is to change the file permission to "user executable". This is how I did it:

  1. Get Info on the ld file in your finder window
  2. Copy the file path in the Where: field
  3. Open a Terminal Window
  4. Type "cd" followed by a space and paste the file path text, then hit return
  5. Type "chmod u+x ld" and hit return
  6. Restart your Arduino application and the code should compile.

One more thing... I believe the ATtiny chips (at least the 84 and 85) need to have the 8MHz or higher boards used. I wasn't able to get it to run on 1MHz but it runs swimmingly on 8MHz. Thanks to Jack Christensen for helping me with that one!