OLED 128x64 with SH1106

Please add any feature requests for Flowcode version 6 here

Moderator: Benj

Forum rules
Only feature requests will be considered here. General questions should not be posted in this forum.
Post Reply
mohandino
Posts: 22
Joined: Fri Jun 29, 2007 9:41 pm
Has thanked: 1 time
Contact:

OLED 128x64 with SH1106

Post by mohandino »

Hello,

I've a OLED screen 1.3" with the SH1106 driver.

I've seen your gLCD_SSD1306_i2c.fcpx, i think you can make an SSD1106 ( SH1106 ) for FC V6.

In some forums, there is a modification to do that :

On file : u8g_dev_ssd1306_128x64.c

Find line 183:

Code:

0x000, /* set lower 4 bit of the col adr to 4 */

Change this to
Code:

0x002, /* set lower 4 bit of the col adr to 4 */

I can't modifie gLCD_SSD1306_i2c.fcpx, perhaps you can make an I2C and SPI component ?

Thanks in advance
Attachments
u8g_dev_ssd1306_128x64.c
(11.12 KiB) Downloaded 505 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: OLED 128x64 with SH1106

Post by Benj »

Hello,

Here is the source for the SSD1306 I2C component. You should be able to make the changes you need, change the component GUID and create yourself a new component.
glcd_SSD1306_I2C.fcfx
(88.77 KiB) Downloaded 528 times
If you get anywhere with it then you can share the component and we will put it into the build.

Some help on creating components is available from the Component Creation section of this page: http://www.matrixtsl.com/wiki/index.php ... p_Overview

This page specifically has some good videos to help get you started: http://www.matrixtsl.com/wiki/index.php ... a_Property

mohandino
Posts: 22
Joined: Fri Jun 29, 2007 9:41 pm
Has thanked: 1 time
Contact:

Re: OLED 128x64 with SH1106

Post by mohandino »

OK BenJ

I'll try when I have received the screen

thanks

mohandino
Posts: 22
Joined: Fri Jun 29, 2007 9:41 pm
Has thanked: 1 time
Contact:

Re: OLED 128x64 with SH1106

Post by mohandino »

Hello BenJ,

I've read the source code and the modification to do is :
There is only one small difference between SSD1306 and SH1106: The SH1106 controller has an internal RAM of 132x64 pixel. The SSD1306 only has 128x64 pixel.

First problem for standard 128x64 OLEDs with SH1106 controller is: How is the 128x64 window mapped into the 132x64 RAM?
It seems, that the 128x64 OLED is centered in most cases within the 132x64 area, that means pixel (2,0) in ram is pixel (0,0) on the display.
source : http://forum.arduino.cc/index.php?topic=256374.0
I think that i can modifie the source at SendData(pixel_width - 1) to SendData(pixel_width +1)

Can you confirm it to me ?

thanks
Last edited by mohandino on Thu Apr 23, 2015 8:25 pm, edited 1 time in total.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: OLED 128x64 with SH1106

Post by Benj »

That sounds right to me :D

mohandino
Posts: 22
Joined: Fri Jun 29, 2007 9:41 pm
Has thanked: 1 time
Contact:

Re: OLED 128x64 with SH1106

Post by mohandino »

Hello BenJ,

I've tested your 1306_i2c code and the oled screen work very slow.

With adafruit test file, it work without "lag"

any idea ?

thanks


mohandino
Posts: 22
Joined: Fri Jun 29, 2007 9:41 pm
Has thanked: 1 time
Contact:

Re: OLED 128x64 with SH1106

Post by mohandino »

OK, so, my project is for an arduino nano.

I changed this file "AVR_CAL_I2C.c"

and i put #define MX_I2C_DELAY delay_us(1);
in line 75

Now the screen work faster but i can't make a scroll fonction....

to Benj : My Oled SSH1106 in I2C mode wont work. I'll try a with the SPI.

thanks for your help.

viki2000
Posts: 190
Joined: Mon Jul 07, 2014 9:38 am
Has thanked: 30 times
Been thanked: 77 times
Contact:

Re: OLED 128x64 with SH1106

Post by viki2000 »

Do you have any positive results with the OLED SH1106 and I2C?
What OLED type do you use?
How about SPI? How did you connect it? Do you use Arduino or another microcontroller?
I use PIC18F4550. If it is working for you, could you share the code or component for SPI and I2C? Or maybe some photos, diagrams with connections?
Below is a link to a new set of questions related with OLED SH1106:
http://www.matrixtsl.com/mmforums/viewt ... 509#p68509

Post Reply