loading
I like using an ATtiny84 or ATtiny85 on my projects. They can save a few pennies and make the design a little smaller. The best instruction for setting up these chips to be used with the Arduino IDE is on the MIT, High Low Tech, website http://highlowtech.org/?p=1695. They show you how to wire the chip to an Arduino for burning the bootloader and uploading sketches.

The chips work similar to the Arduino Uno with a some limitations. I found that advice on the web was sometimes confusing or in a few cases wrong. You are left to figure the rest out on your own.

I put together details on some aspects. I hope you find there is enough detail to make using a ‘tiny easy.

Step 1: Problems With Counting

When you use an ATtiny84 or ATtiny85, you are most likely using a breadboard or circuit of your own design. Unlike an Arduino Uno, that has the pins at the headers numbered to match the pin numbers in the Arduino IDE, you will have to wire your ‘tiny to the actual physical pins.

The physical pins and the pin numbers in the software are very different. For example, on an ATtiny84, physical pin 1 is for Vcc while, in the software, digital pin 1 is actually physical pin 12. You have to understand from context which pin (physical or software) is being talked about (hint, most references are for the software pin). It is best to refer to a diagram as you go through the explanation.

To add more confusion, the analog pins can have different numbers than the digital pins at the same physical location. This is happens with the ATtiny85. For example, the physical pin 7 is both the digital pin 2 and the analog pin 1. Digital pin 1 is the physical pin 6, and it has no analog input. (I only hope that the chip designers saved the company a lot of money for the confusion this can cause.)

This situation is due to the chip designers and not caused by the Arduino software. The pin numbers are based on how port B and the ADC is mapped. Pin 7 is PB2 (digital pin 2) and ADC1 (analog pin 1).

<p>Thx so much for this tutorial. I was able to hook my Arduino up to my ATtiny85 (ony 1 wire, TX from Arduino to pin 4 (that's PB4) used the Software serial lib from Arduino, and it worked like a champ! </p>
<p>How can i fix error with SoftwareSerial on attiny84 board??<br></p><p>SoftwareSerial.h:92:</p><p>error: conflicting return type specified for 'virtual size_t SoftwareSerial::write(uint8_t)'</p><p>Arduino/hardware/tiny/cores/tiny/Print.h:71:</p><p>error: overriding 'virtual void Print::write(uint8_t)'</p>
<p>Sorry about the SoftwareSerial issue. I haven&rsquo;t keep up with any changes to the Arduino software. You may have to check with the Arduino forums for more info on your issue.</p>
<p>Hi,</p><p>Great tutorial. However, I am not getting clean data on the serial. I am using Arduino RX pin connected with Pin 3 of ATTINY85. Any thoughts?</p>
<p>If you have two things not talking you have to first make sure that <br>each by themselves is working. For example, does your attiny85 send <br>clean data to the serial monitor?</p><p>You also need a common ground. See step 6. </p>
<p>hello,</p><p>the ANTENNA = 1should be replaced by ANTENNA = 2</p><p>const int ANTENNA = 1; // this is physical pin 7, connect wire as antenna</p><p>should be:</p><p>const int ANTENNA = 2; // this is physical pin 7, connect wire as antenna</p>
<p>Thanks for the correction. I fixed step 4.</p>
<p>Hi there, I have a question regarding 'Step 6'. Have you confirmed that common power and ground is required? Have you tried separate power sources, but only have common ground? (What I mean is the only wires connected are TX, RX, and GND)</p>
<p>I did not test with using just a common ground. </p><p>It is possible that only a common ground is required. The same ground <br>would have to be run to the second power source. That would give <br>everything a common reference, but I have not tried it. </p><p>Let me know if you try it and it works.</p>
Ooo im gana use this to communicate with an ESP8622 wifi module. How cool!?
Yes, having the same thought, that mean we can control another 3 pins on attiny85
<p>Very good! =D Thanks!</p>
<p>Useful...! Thanks!</p>

About This Instructable

54,187views

55favorites

License:

Bio: We sell DIY kits for electronics. Please check out our website: http://www.jouletime.com/
More by JouleTime:How to Get Started With I2C - Wonderful World of Inter IC Communication Best? Electonic Parts Kit Ever! ADALP2000 by Analog Devices Soldering SMD (Surface Mounted Devices) - Using BriteBits 
Add instructable to: