Hackster.io gives professionals and hobbyists the resources they need to build hardware, the easy way. Start building.

Trinket Firmware Exorcism

Body of a Trinket - Soul of a Digispark.


Warning: Digispark uses Attiny85 PIN#1 as I/O - remove RESET button functionality


The Trinket 5V and the Digispark share the same hardware design, right down to the LED being on PB1. Personally, 
I prefer the Trinket hardware over the Digispark, but the Digispark has a totally different ecosystem and is stackable, 
but for this article only the hardware design similarities will be exploited. 

Digispark inherits most of it's personallity from the littlewire project, http://littlewire.cc/ and having been around longer there is a significant following of users. In addition to a pedigree heritage, there is a ready set of libraries available for the Digispark. I have used several with the Trinket without modifications with perfect success. So, with the bootloader of the Digispark a weebit smaller and the availability of a simple-to-use uploader program, micronucleus.exe (Windows,) I figured I should do a little Frankenstein doctoring and flash the Trinket hardware with the Digispark bootloader software. The results is excellent (or, said properly, my results were excellent.) 

Micronucleus https://github.com/micronucleus  is a simpler tool than AVRDUDE, that is if one must be at the command line and upload the HEX anyway. One simply types "micronucleus CompiledFileName.hex" and you then plug in the Digispark after-the-fact! Micronucleus is polling for the connection so there is a 60 second window ... an eternity if you have been trying to hit the Trinket timing. Simply download micronucleus.exe and store it somewhere in your path, I put mine with my other Arduino stuff here: C:\Program Files\arduino_105\hardware\tools\avr\bin and then you can open a command window to your OS, CD to the Arduino GUI temporary directory and upload the HEX. This is not even painful and I have tested it on Win-Vista 32-bit with Arduino 1.0.5 without issue. Of course, the standard disclaimer of your results 
may differ is appropriate. 

Digispark offers 100% Arduino GUI integration, but you must download the entire Arduino modified distribution (at least this was true with Arduino 1.0.4 "digi" flavor but they were working on 1.0.5 in 4Q13, so check it out.)

  • You MUST install the Digispark boards.txt file and core files, just like the Trinket. When this is successful, you will see the 4 Digispark entries under Arduino - Tools - Boards. You must compile with a Digispark board selected, not Trinket. 
  •  There is NO need to compile and upload... simply do a Verify (check mark) in the GUI. If you have your Arduino Preferences set to Show Verbose Output during compilation, then you will see the path in the console window. 
For example: I selected the Fade Sketch from the Examples in Arduino 1.0.5 and selected the board: Digispark 16MHz. I changed the LED to be on PB1 (int led = 1; ) and compiled using the Verify option in the GUI (just the checkmark.) 
Binary sketch size: 904 bytes (of a 6,012 byte maximum) 

I then opened a Command window and navigated to the directory with the HEX file. (On windows, just open Explorer and type %temp% and press Enter.) Navigating to the build directory, I type; 
dir *.hex 

Directory of C:\Users\owner\AppData\Local\Temp\build7518571963010665540.tmp 
10/07/2013 11:53 AM 2,575 Fade.cpp.hex 
1 File(s) 2,575 bytes 
0 Dir(s) 102,306,967,552 bytes free

  •  To upload, type:  micronucleus fade.cpp.hex 
Sample of successful upload: 
> Please plug in the device ... 
> Press CTRL+C to terminate the program. 
> Device is found! 
connecting: 20% complete 
connecting: 23% complete 
connecting: 27% complete 
connecting: 30% complete 
connecting: 34% complete 
connecting: 40% complete 
> Device looks like ATtiny85! 
> Available space for user application: 6012 bytes 
> Suggested sleep time between sending pages: 8ms 
> Whole page count: 94 
> Erase function sleep duration: 752ms 
parsing: 40% complete 
parsing: 60% complete 
> Erasing the memory ... 
erasing: 60% complete 
erasing: 70% complete 
erasing: 80% complete 
> Starting to upload ... 
writing: 80% complete 
writing: 90% complete 
writing: 95% complete 
writing: 96% complete 
writing: 96% complete 
writing: 97% complete 
writing: 98% complete 
writing: 99% complete 
writing: 100% complete 
>> Micronucleus done. Thank you! 


Overview of procedures

Caveat Emptor
This is a one-way street.  Installation of the Digispark firmware and appropriate fuse settings will prevent you from re-flashing the converted Trinket back to an un-converted Trinket UNLESS you have a HV-programmer. 

I wrote a piece for Adafruit back in 4Q13 on how to assist in reflashing the Trinket firmware.  The piece is here:

A very similar procedure using the Jig can be accomplished for the Exorcism... er, Trinket --> Digispark conversion.

The Digispark firmware is:

Ray's scripts that may be useful for Windows

Download ray_s_scripts_that_may_be_useful_for_windows.


Created on 2014-01-20
Users who respect this project Respect project
Thumb luis nogueira cunha D11764d743848a8e497c137c6bfca1f5

Comments and feedback

Be the first to comment!
Projects Tools Ask an expert Add project Sign up / Login


Embed the widget on your own site

Trinket Firmware Exorcism

Trinket Firmware Exorcism

by Ray Burnette

Body of a Trinket - Soul of a Digispark.

2524 2 0

Add the following snippet to your HTML: