“Driving an OLED display with an ATtiny10 without using any library to make sure the program fits into the 1kB flash memory.
I tried to fit the code to drive an OLED display into an ATtiny10. Is it possible? Yes! But how much space is left to actually make something useful?
Playing around with the mighty ATtiny10 I asked myself if it was capable to drive an OLED display. Why? Curiosity mainly; and also seems quite a challenge to squeeze all the code in less than 1Kb. So I gave it a go.
I used a 128x32 monochrome OLED display driven by the SSD1306 controller. This can be easily bought for few bucks assembled in handy breakout boards offering a Two-Wire Interface (I2C).
-The OLED Display used-
Needless to say that I needed to write all the code from scratch to fit it in a few kilobytes. I certainly can’t use off-the-shelf libraries: just the Wire library for the I2C protocol occupies almost all the ATtiny10 total flash memory.
So this exercise can be split into two problems:
Implementing the I2C protocol
Initialize the display with the right commands and data”