C library for SSD1306 OLED Driver
Go to file
2021-07-21 07:25:16 +02:00
img Delete ssd13006_v20.png 2021-07-21 07:01:43 +02:00
lib Remove @var unsigned int set_area 2021-07-21 07:25:16 +02:00
LICENSE Initial commit 2020-10-13 10:44:23 +02:00
main.c Update main.c 2021-07-21 07:22:58 +02:00
main.hex Rebuild logic -> use 'cacheMemLcd' array which is depicted with UpdateScreen function 2021-07-20 10:59:08 +02:00
Makefile Before new version 2021-07-19 15:06:29 +02:00
README.md Replace image with version 2.0 2021-07-21 07:03:27 +02:00

C Library for SSD1306 0.96" OLED display

SSD1306 Description

Detailed information are described in Datasheet SSD1306.

Library

C library is aimed for driving SSD1306 0.96" OLED display 128x64 through TWI's Atmega328p.

Versions

Dependencies

Font.c can be modified according to application requirements with form defined in font.c. Maximal permissible horizontal dimension is 8 bits.

Usage

Prior defined for MCU Atmega328p / Atmega8 / Atmega16. Need to be carefull with TWI ports definition.

PORT Atmega16 Atmega8 / Atmega328
SCL PC0 PC5
SDA PC1 PC4

Tested

Library was tested and proved on a SSD1306 0.96″ OLED Dispay with Atmega328p.

Init OLED Sequence

Init sequence OLED display was defined according to page 64 (next to last page) of Datasheet SSD1306.

// +---------------------------+
// |      Set MUX Ratio        |
// +---------------------------+
// |        0xA8, 0x3F         |
// +---------------------------+
//              |
// +---------------------------+
// |    Set Display Offset     |
// +---------------------------+
// |        0xD3, 0x00         |
// +---------------------------+
//              |
// +---------------------------+
// |  Set Display Start Line   |
// +---------------------------+
// |          0x40             |
// +---------------------------+
//              |
// +---------------------------+
// |     Set Segment Remap     |
// +---------------------------+
// |       0xA0 / 0xA1         |
// +---------------------------+
//              |
// +---------------------------+
// |   Set COM Output Scan     |
// |        Direction          |
// +---------------------------+
// |       0xC0 / 0xC8         |
// +---------------------------+
//              |
// +---------------------------+
// |   Set COM Pins hardware   |
// |       configuration       |
// +---------------------------+
// |        0xDA, 0x02         |
// +---------------------------+
//              |
// +---------------------------+
// |   Set Contrast Control    |
// +---------------------------+
// |        0x81, 0x7F         |
// +---------------------------+
//              |
// +---------------------------+
// | Disable Entire Display On |
// +---------------------------+
// |          0xA4             |
// +---------------------------+
//              |
// +---------------------------+
// |    Set Normal Display     |
// +---------------------------+
// |          0xA6             |
// +---------------------------+
//              |
// +---------------------------+
// |    Set Osc Frequency      |
// +---------------------------+
// |       0xD5, 0x80          |
// +---------------------------+
//              |
// +---------------------------+
// |    Enable charge pump     |
// |        regulator          |
// +---------------------------+
// |       0x8D, 0x14          |
// +---------------------------+
//              |
// +---------------------------+
// |        Display On         |
// +---------------------------+
// |          0xAF             |
// +---------------------------+

Functions

Demonstration