Share it

Follow me

Twitter

Google+

LinkedIn

ATtiny85 vs ATmega328

I'll quickly compare ATtiny85 microcontroller to ATmega328 microcontroller (the one which powers Arduino Uno rev 3) and explain how to use Arduino IDE to burn sketches.

 

Some facts about ATtiny85

ATtiny85 microcontroller is an AVR microcontroller, like the ATmega328 which powers Arduino UNO boards. This means that is possible, with the right support files, to upload programs made with Arduino IDE, with some restrictions which I'll talk about later.

First, I'll compare ATtiny85 and ATmega328 to show you the main differences.

You can see below a photo comparing size of the microcontrollers (from left to right):

  • Standard plastic card (for scale).
  • Arduino Uno board.
  • ATmega328 microcontroller.
  • ATtiny85 microcontroller.
  • 2 euros coin (25mm, for scale).

Arduino and ATtiny85

  ATiny85 ATmega328
Pin number 8 28
Max frequency 1 or 8 MHz (with internal oscillator) / up to 20 MHz (with external oscillator) 1 or 8 MHz (with internal oscillator) / up to 20 MHz (with external oscillator)
Flash size (kB) 8 32
SRAM size (bytes) 512 2048
EEPROM size (bytes) 512 1024
ADC channels (Analog to Digital Converter) 4 (3 available without disabling reset fuse ) 6
PWM channels 2 6
Digital channels (including ADC and PWM) 6 (5 available without disabling reset fuse ) 23 (20 exposed on Arduino Uno)
I2C connectivity yes (via USI - Universal Serial Interface) yes
SPI connectivity yes (via USI - Universal Serial Interface) yes
UART connectivity (a.k.a. serial) no yes
† Disabling reset fuse allows you to use pin 1 as an ADC or digital channel, but disable the possibility to program the microcontroller. If you accidentally disable reset fuse, you can follow these steps to enable it again.

As you may see, ATtiny85 is rather memory and I/O limited compared to standard Arduino board. You then have to make some choices if you want to build your project. You can choose to add more digital I/O with the use of a MCP23008 or MCP23017 port expander (with I2C connectivity), but it will be against the idea of a limited size project.

A more problematic issue is the lack of an UART connectivity to upload programs. Standard Arduino boards use this connectivity through an USB <--> UART adapter to upload programs to the microcontroller. With an ATtiny85, you have to other possible solutions:

  • Buy an AVRUSB programmer: ATtiny85 chip is plugged into its support, programmer is plugged into an USB port of your computer, then you can upload programs from Arduino IDE.
  • Buy an Arduino UNO board and use it (at least) as an AVR programmer. The method is pretty easy and perfectly documented here : Programming an ATtiny w/ Arduino 1.0. You can see below an Arduino board programming an ATtiny85 chip.



comments powered by Disqus