The high-performance, low-power Microchip 8-bit AVR® RISC-based microcontroller combines 8 KB ISP Flash memory, 512B EEPROM, 512B SRAM, six general purpose I/O lines, 32 general purpose working registers, one 8-bit timer/counter with compare modes, one 8-bit high-speed timer/counter, USI, internal and external Interrupts, 4-channel 10-bit A/D converter, programmable watchdog timer with internal oscillator, three software selectable power saving modes, and debugWIRE for on-chip debugging. The device achieves a throughput of 20 MIPS at 20 MHz and operates between 2.7-5.5 volts.

By executing powerful instructions in a single clock cycle, the device achieves throughputs approaching one MIPS per MHz, balancing power consumption and processing speed.

The ATtiny85 is a microcontroller in a similar vein to the but with much less IO pins, smaller memory and a smaller form factor. In fact, when we talk about the ATtiny85 we refer to the IC itself rather than the board. The ATtiny85 can be used as a bare chip on a breadboard, as long as you can supply the correct power for the device.

Despite the small package, the ATtiny85 comes with a remarkable number of ways in which we can interface. At the most basic level, we have 5V logic digital I/O pins, three of which can also be used as analog pins for use with components such as the TMP36 sensor. Four of the available pins can also be used with Pulse Width Modulation (PWM). Also available is I2C and SPI for use with other types of sensors and devices.

Step 1: Introduction

As per the datasheet, it has 8 KB of flash, an 8-MHz internal RC oscillator that can be used as the default clock & 512 bytes of EEPROM and SRAM.

In achieving a throughput of 20 MIPS, it takes 20 MHz and operates between 2.7-5.5V.

It also has two 8-bit timers or counters, one high-speed, with four pulse-width modulations (PWM) outputs, and a four-channel 10-bit ADC.

An ADC converter with a 10 bit & programmable watchdog timer is added to the device which makes it suitable for resetting the device in case it gets stuck in an infinite loop and sensor interfacing.

Although it consists of 8 pins only, it can perform almost every function that a simple microcontroller can do. We will get a better idea of its functionality in the pinout specification.

What does the number 85 in ATtiny85 represents?

In the ATtiny series, the first digit that comes after ATtiny represents the flash memory in kibibyte (KiB). Thus, an ATtiny85 consists of 8KiB flash memory.

The second digit represents the model type. You can expect more powerful and newer models to have higher numbers. Here you can see that ATtiny85 is a 2005 model.

Step 2: Editing

Installing the software

We shall be using the Arduino IDE to write the code for this project. So if not already installed, download a copy from the Arduino website and install.

Open the Arduino application and click on File >> Preferences and past the following into the Additional Boards Managers URLs: dialog.

http://digistump.com/package_digistump_index.json

Next, go to Tools >> Board >> Boards Manager and from the drop-down menu select “Contributed”.

Select the “Digistump AVR Boards” and click Install.

The install process will take some time, but once completed the installation should trigger an auto install of the drivers for the board.

If the driver install fails to run after adding the board to your list, open the command prompt and enter the following command. Remember to change the USERNAME to match your own!

C:\Users\**YOUR USERNAME**\AppData\Local\Arduino15\packages\digistump\tools\micronucleus\2.0a4\post_install.bat

This will install the drivers for the ATtiny85, and there may be a red cross in the post install screen, but we can confirm that the instal is correct.

To use the ATtiny85 in the Arduino IDE we need to set it as our board.

Go to Tools >> Board >> and select Digispark (Default - 16.5MHz) don’t...

Read more »