Programming Avr328 SSD1306 OLED Inside of Arduino Without Arduino IDE With MysmartUBS Light
by nikkischulz6 in Circuits > Microcontrollers
232 Views, 0 Favorites, 0 Comments
Programming Avr328 SSD1306 OLED Inside of Arduino Without Arduino IDE With MysmartUBS Light
- I asked myself if there is a library for programming the avr328 to control the SSD OLED 1306 with i2c.
- Yes there is one, or there are maybe some more.
- so today I randomly picked one library and tried to run it:
https://github.com/Matiasus/SSD1306
Hardware Setup
- check the datasheet of arduino
- check the connection of OLED
- connect scl and sda and use 2 pull up resistors and gnd and vin
- connect the my smart usb to the icsp = in circuit serial programming - pin
- the nose is directed inside the arduino
- connect the arduino board with USB
Software Setup
- Goto: https://github.com/Matiasus/SSD1306
- clone the repository
- open it with visual studio code
the author gives two hints depending of what OLED you are using you have to change following lines:
- 128x64 version
- command argument SSD1306_SET_MUX_RATIO set to 0x3F (ssd1306.c)
- command argument SSD1306_COM_PIN_CONF set to 0x12 (ssd1306.c)
- END_PAGE_ADDR set to 7 (ssd1306.h)
- 128x32 version
- command argument SSD1306_SET_MUX_RATIO set to 0x1F (ssd1306.c)
- command argument SSD1306_COM_PIN_CONF set to 0x02 (ssd1306.c)
- END_PAGE_ADDR set to 3 (ssd1306.h)
- In the make file change following line to:
# AVRDUDE PROGRAMMER
AVRDUDE_PROG = stk500
- open a terminal and press make
- a hex file will be created
- for me make flash didnt work but you can do it of course or use for example avrdudess :
- https://blog.zakkemble.net/avrdudess-a-gui-for-avrdude/