-
Notifications
You must be signed in to change notification settings - Fork 12
Programming the ATTiny
I assume that you have some familiarity with the Arduino IDE, because we will use it to program the ATTiny. You might ask, why not a real development IDE, but an underlying decision was to make building this thing as simple as possible, and this means the Arduino IDE.
If you have never programmed a bare-bones micro-controller before then the following will be a new experience, but the process is as simple as programming an Arduino Nano, even though there are a few more steps.
Simply download and install the Arduino IDE, then install the additional board definition by https://github.com/damellis/attiny (there should be enough tutorials if you do not yet know how to do it), and then we need an I2C implementation for the USI of the ATTiny. This can be found here: https://github.com/puuu/USIWire
Most probably the compiled software will work with newer version of the libraries and Arduino IDE as well, but I worked with the following version:
- The Arduino IDE version used is 1.8.9
- The ATTiny Board definition provided by https://github.com/damellis/attiny hasn‘t been changed since 2016. No release exists, but I do not assume that it will change anytime soon.
- The USIWire-implementation used is provided by https://github.com/puuu/USIWire, and I use the release 0.1.0.
Interestingly, when I tried the ATTinyCore by https://github.com/SpenceKonde/ATTinyCore, it generated a lot of problems when reading over the I2C. I will follow up on that later, but currently you have to install a board variant and a library instead of the integrated solution. As an interesting side note, the produced firmware was larger and needed more SRAM. Since the current version already is at about 90% of the available flash it might be more prudent to stay with the above solution even if it would be possible to get a running version with the ATTinyCore.