Introduction: How to Convert Bitmap Graphics for OLED SSD1306 Display Run by ATtiny85

The main goal of this tutorial is to show how to convert monochromatic bit map for HEX file and run by Attiny85 and OLED display SDD1306.

Due to running campaign for Attiny25/45/85 PCB TINY CHEAP VERSATILE Arduino compatible on Indiegogo I receive question how did I do graphics for SDD1306 OLED display.

Instruction in pdf can be downloaded from Awesome PCB web page.

This tutorial will give expanation for this question.

Step 1 - What do we need?

Step 2 – Converting bitmap to HEX

Step 3 - Run AVR Studio

Step 4 – Preparing graphic file

Step 5 - Pacman on the screen

Step 6 - Extras

Step 1: ​ What Do We Need?

Source code for driving ATtiny85 and OLED SSD1306 display.

Software can be download from Bitbucket.org

Monochromatic bitmap HEX converter.

Software can be download from Bitmap convrter to HEX


AVR Studio.

Software can be download from AVR Studio


Monochromatic bitmap

In our case it will be a pacman graphics.



Step 2: Converting Bitmap to HEX

For converting bitmap to HEX we will use LED Assistant. This software allowed us to change bitmap to HEX file.

HEX can be digested by microcontroller.

Load image from dedicated folder.

Our file will be called pacman

After successful load you will see image.

Now you need to save output.

Give a name for file and save.

Step 3: Run AVR Studio

Depend on the AVR studio version GUI can be different.

Currently I'm using Version 4.18 which is still OK for this purpose.

Create new project


Choose AVR Simulator and ATtiny85

Copy source from bitbucket.org to project folder (D:\OLED_SSD1306\OLED_SSD1306)

In AVR Studio mount corelated files

First from subfolder called ssd1306xled_test load main.c

Then from subfolder called ssd1306xled load num2str.cssd1306xled.c and ssd1306xled8x16.c

If everything was done properly all files should be in the Source Files

Double click on main.c

On the main window you will see source code of the main.c file

Before we go further it is worth to check if source code can be compiled.

To do this go to the top bar Build and run function Build

On the bottom line of AVR Studio you will see statu after compilation.

Green lights and 0 warnings – this is our goal.

Step 4: Preparing Graphic File

Now it is time for pacman file prepared in Step 2

Open pacman file with text editor.

You will see char table with hexadecimal value.

This is the representation of bitmap file.

Mark everyhthing from brackets and copy (Ctrl+C)

Now open folder D:\OLED_SSD1306\OLED_SSD1306\ssd1306xled_test

and open file called img0_128x64c1.h

Structer of this file will be similar to pacman file.

Delete everything inside a brakets.

and copy content by (Ctrl+V) from pacman file

Save (Ctrl+S) and close the file.

Now go to AVR Studion and one more time Build and run function Build

After succesful compilation in folder D:\OLED_SSD1306\OLED_SSD1306\default we will find file called OLED_SSD1306.hex

Step 5: Pacman on the Screen

Upload OLED_SSD1306.hex file to Attiny85 via ISP programmer and ready – pacman is on the screen :)

Step 6: Extras

Attiny25/45/85 PCB project is created with the basic idea to provide tiny, cheap and versatile PCB for ATtiny25/45/85 microcontroler, that you can leave it in your project with no regret of losing expensive Arduino board.

Check running campaing on Indiegogo.

Tech spec of the Attiny25/45/85 PCB

  • size: 33.5 x 11.2 mm
  • package: THT DIP8 ATtiny25/45/85
  • package: SMD SO08 ATtiny25/45/85
  • reset switch, top and bottom side.
  • reversible components THT - top side, SMD - bottom side
  • standard 6 pin ISP programming connector.
  • 2 output connector with access for all pins of uC
  • schematic

Comments

author
MihaM7 made it! (author)2016-06-26

Thanks for post bro, but I get an error which says that USINT2DECASCII_MAX_DIGITS is not defined. What excually represent this parameter ? Could you tell me which number should I assign to it.

Best regards,
Mihael

author
AwesomePCB made it! (author)AwesomePCB2016-07-15

Hello Mihael,

I don't know the answer for yorur question. You can ask author of this library here https://hackaday.io/project/2069-the-tinusaur. I hope that could helpe solve this problem you.

Br,
Simon.

author
Raphango made it! (author)2016-05-19

Great! Congratulations!

Just a question, can I do the same thing using the Arduino Environment?

author
AwesomePCB made it! (author)AwesomePCB2016-05-24

Hi,
Thanks :)
Graphics you have to convert like it was described.
I think you can look here to check source for this display for Arduino Enviromet.
Just have a look here
https://learn.adafruit.com/monochrome-oled-breakouts
Hex you can use but you have to put hex in to the uC.

Br, Simon.

author
Raphango made it! (author)Raphango2016-05-24

Thank you!

author
Raphango made it! (author)Raphango2016-05-19

Mind that I already know how to program the tiny using Arduino IDE. I just want to know if it's possible to use the HEX file with it.

Thanks!

author
GavinF2 made it! (author)GavinF22016-05-19

I would say so as hex is used to build graphix in Arduino IDE and This program is essentially the same but made by the manufacturer.

author
Raphango made it! (author)Raphango2016-05-20

Ok, gotta try it someday. Thanks!

About This Instructable

19,555views

43favorites

License:

More by AwesomePCB:How to program ATtiny85 with Arduino UNOHow to program Arduino Pro Mini using Arduino Uno and ArduShield - without the cablesHow to solder pins header
Add instructable to: