Page 1 of 1

OLED 128x64 with SH1106

Posted: Mon Apr 13, 2015 8:26 pm
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

Re: OLED 128x64 with SH1106

Posted: Thu Apr 16, 2015 4:18 pm
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 542 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

Re: OLED 128x64 with SH1106

Posted: Thu Apr 16, 2015 6:14 pm
by mohandino
OK BenJ

I'll try when I have received the screen

thanks

Re: OLED 128x64 with SH1106

Posted: Thu Apr 23, 2015 4:55 pm
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

Re: OLED 128x64 with SH1106

Posted: Thu Apr 23, 2015 5:50 pm
by Benj
That sounds right to me :D

Re: OLED 128x64 with SH1106

Posted: Thu May 14, 2015 6:06 pm
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

Re: OLED 128x64 with SH1106

Posted: Fri May 15, 2015 9:11 pm
by STibor

Re: OLED 128x64 with SH1106

Posted: Mon May 18, 2015 7:12 pm
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.

Re: OLED 128x64 with SH1106

Posted: Tue Jun 16, 2015 9:05 am
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