RSGC ACES: When an ATtiny may be the better option...

 

As you are aware, the heart of the Arduino UNO is the ATmega328P. As you can see from its datasheet it offers a lot of features and, as such, is a reasonable choice for a multipurpose development board.

In situations where an embedded system has a limited task to perform you way wish to consider a different microcontroller from ATMEL's vast product portfolio. The tiny line of uCs have fewer resources but also a much smaller footprint and reduced power requirements, operating with as little as 1.8V.

The ATtiny85 is one such device in this line. Here's a YouTube video that uses your Arduino as the programmer for the ATtiny85. In this introduction, we'll first demonstrate how to program the device using an AVR Pocket Programmer through the Arduino IDE and, later, from the Mac's command line Terminal utility using C. Here's the additional hardware that will simplify the task,

AVR Pocket Programmer AVR Breakout Board ATTiny85

 

ATtiny85 Pinout

 

 

Technique #1. Arduino IDE

  1. Upgrade your Arduino IDE to the latest version (1.6.3 at this time).
  2. Create a folder called hardware in the folder where you save your own personal Arduino sketches.
  3. Download the ATtiny core library for Aduino 1.5 from here.
  4. Copy the tiny folder to the hardware folder created in Step 1.
  5. Go down into the avr folder within tiny and rename the file Prospective Boards.txt to boards.txt.
  6. Open the Arduino IDE and look at the new list of available boards in the Tools menu.
  7. Since we'll be uploading sketches to an ATtiny85 mounted on a breadboard, we need a programmer other than the ArduinoISP. We'll be using the AVR Pocket Programmer from Sparkfun that is USBTinyISP compatible. Select it.
  8. To facilitate the standard 2x3 ISP header we'll use the AVR Breakout Board, also from Sparkfun, to make the pin assignments easier to navigate by distributing the pins to a 1x6 breadboard-compatible configuration.
  9. Set up your breadboard as shown below.

  10. Return to the Arduino IDE and load the Blink sketch. The sketch is designed to alternate the signal on Pin 13 of th ATmega328P. Of course this will hve to be changed for the ATtiny85. Consult the datasheet to determine what pin number on the ATtiny85 the LED above is connected to and modify the sketch. Upooad the sketch and confirm the blinking.
  11. For further development with the ATtiny85, you may want to start with Sparkfun's ATtiny85 tutorial.

Technique #2: Terminal and avr-gcc

  1. TBC...