Wednesday, 22 May 2013 22:03
Digispark DIY: The smallest USB Arduino

Digispark is an ATtiny85 based microcontroller development board come with USB interface. Digispark is very small and inexpensive but less powerful than Arduino. Coding is similar to Arduino, and it use the familiar Arduino IDE for development.
Here is an article on how to making a Digispark, however if you want to purchase a finished product, you can always get it from Digispark's author homepage.
Specification
- Support for the Arduino IDE 1.0 and later (OS X, Windows, and Linux)
- Power via USB or external source - 5 V or 7-35 V (automatic selection)
- On-board 500 mA 5 V Regulator
- Built-in USB
- 6 I/O pins (2 are used for USB only if your program actively communicates over USB, otherwise you can use all 6 even if you are programming via USB)
- 8 KB flash memory (about 6 KB after bootloader)
- I²C and SPI (vis USI)
- PWM on 3 pins (more possible with software PWM)
- ADC on 4 pins
- Power LED and test/status LED
Like Arduino, Digispark require a bootloader to be running on ATTINY85 which will occupied 2KB flash memory, so the total of 8KB flash memory will now become 6KB for programming.
Download bootloader
- Download Micronucleus bootloader for ATTINY85
(Updated on 09 Jul 2016: Please use this link for latest Micronucleus bootloader) - Extract the file (micronucleus-t85-master.zip) to any folder
- Look for bootloader which is locate at micronucleus-t85-master\firmware\releases
Burning bootloader to ATTINY85
It is very important to use the correct fuses bit when burning bootloader to ATTINY85, below list the fuses bit for burning bootloader:
It is very important to use the correct fuses bit when burning bootloader to ATTINY85, below list the fuses bit for burning bootloader:
- Extended: 0xFE
- High: 0xDD
- Low: 0xE1


Installing Digispark USB driver
Digispark require USB driver to be install in computer since it use USB (not USB to serial) to communicate with computer.
- Download Arduino for Digispark which come with USB driver
- Extreat the file (DigisparkArduino-Win32-1.0.4-March29.zip) to any folder
- Execute DigisparkArduino-Win32\DigisparkWindowsDriver\InstallDriver.exe to start installing the USB driver
Digispark schematic
Picture below shows the official schematic for Digispark, and the next schematic is simpler & lesser components which is for testing purposes, the 5V is supply from the USB port of computer.


Connecting Digispark and Upload sketch
- Plug in the Digispark to the USB port of computer
- USB device is detected for first time use and it will prompt for installing Digispark bootloader. Just click on Next button until finish as shown in figure below.

- Run DigisparkArduino-Win32\Digispark-Arduino-1.0.4\arduino.exe to starting Arduino IDE
- Click on Tools>Board>Digispark (Tiny Core) as shown in figure below

Click on Tools>Programmer>Digispark as shown in figure below

Upload an example. Click on File>Examples>Digispark_Example>Start
// the setup routine runs once when you press reset: void setup() { // initialize the digital pin as an output. pinMode(0, OUTPUT); //LED on Model B pinMode(1, OUTPUT); //LED on Model A } // the loop routine runs over and over again forever: void loop() { digitalWrite(0, HIGH); // turn the LED on (HIGH is the voltage level) digitalWrite(1, HIGH); delay(1000); // wait for a second digitalWrite(0, LOW); // turn the LED off by making the voltage LOW digitalWrite(1, LOW); delay(1000); // wait for a second }
Follow procedures below to upload sketch to Digispark.
- Unplug Digispark from computer before you click on the Upload button
- Click on Upload button now
- Plug in Digispark to computer when it prompt for "Plug in device now..."

If you see "running: 100% complete". Congraturation! you have own a working Digispark.

Test the Digispark
Connect a 330ohm resistor & LED to both pin5(Digital 0) and pin6(Digital 1) of ATTINY85. Plug the Digispark to computer, both LED is start blinking now.

Published in
Blog
Tagged under