Tuesday Tooling: ATTinyCore
Tiny, yet mighty!
I have a deep love for the ATTiny85 range of boards. Small, cheap Arduino compatible boards that can power robots or be used to create lighting effects for signs. Normally I would use the Digispark / Digistump library to flash code to my ATTiny85s but recently I had an issue with nucleus, the tool that uploads the code and it forced me to look elsewhere and I then found ATTinyCore.
My current project is to hack a PIR LED light from #Pounderland to control some NeoPixels via an ATTiny85.So what is it?
Maintained by Spence Konde aka Dr. Azzy, ATTinycore is "Arduino support for almost every classic tinyAVR device! Supports ATtiny 1634, 2313/4313, 24/44/84, 441/841, 25/45/85, 261/461/861, 87/167, 48/88, 43 and 828."
In other words we can use ATTinycore to flash Arduino code on to an AVR board, like the ATTiny85.
Hi reader!
So How Do I Install it?
I tested it with Arduino 1.8.15 and first opened File >> Preferences and dropped http://drazzy.com/package_drazzy.com_index.json
into the Additional Board Manager URLs. I then clicked ok.
Then I clicked on Tools >> Boards >> Board Manager.
In the search box I typed ATTinycore and this brought up ATTinycore. Click on Install and after a few moments ATTinycore will be installed on your machine.
The final installation step is pre-emptive, we need to add some udev rules (for Ubuntu / Linux systems) in order for our board to be flashed.
Open a Terminal and use the following command to download the udev rules directly from Github into your /etc/udev/rules.d
directory.
sudo wget https://raw.githubusercontent.com/micronucleus/micronucleus/master/commandline/49-micronucleus.rules -P /etc/udev/rules.d/
Now is a good time to reboot to make sure that the rules are loaded and ready for use.
So How Do I Use it?
Open the Arduino IDE and go to Tools >> Boards and set the board to ATTinycore >> ATTiny85 (Micronucleus / Digispark).
I then opened the standard blink example and altered...
pinMode(LED_BUILTIN, OUTPUT);
to
pinMode(1, OUTPUT);
and then changed two more occurrences of LED_BUILTIN to 1. The builtin LED on the ATTiny85 is attached to GPIO pin 1.
Click on the arrow to flash the code and you will be prompted to insert the ATTiny85 into the USB port. Do this and the code will flash to the board. All done!