OLED Display (SH1106).

A forums to allow bugs and problems with Flowcode v7 to be reported and resolved.

Moderator: Benj

Post Reply
gdt
Posts: 71
Joined: Thu Aug 10, 2017 2:04 pm
Has thanked: 25 times
Been thanked: 36 times
Contact:

OLED Display (SH1106).

Post by gdt »

Hi,
I don't know if this is a bug but I bought this display driven by SH1106 controller and unfortunately it has I2C Addresses bits at 0x78 and 0x7A (like SSD1306), differently than the component in FC7 gLCD_SH1106_I2C1 which uses 0x3C and 0x3D.

Would it be possible to select these addresses?
Also this is a 4 pin components and the Reset pin is missing.

Regards
Giuseppe
Attachments
SH1106_128x64_I2C_OLED_f.jpg
SH1106_128x64_I2C_OLED_f.jpg (12.93 KiB) Viewed 3738 times
SH1106_128x64_I2C_OLED_b.jpg
SH1106_128x64_I2C_OLED_b.jpg (16.26 KiB) Viewed 3738 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 Display (SH1106).

Post by Benj »

Hi Giuseppe,

I believe the addresses we use include the bit shift for the least significant R/W bit. It just makes the code slightly more efficient as you'r not doing the bit shift at run time.

0x3C = 0b00111100
0x3D = 0b00111101

0x78 = 0b01111000
0x7A = 0b01111010

Is the reset pin missing from the display or component? If it's missing from the component then you can simply drive the reset signal from VCC or from a free output pin, drive the pin high and then wait a few hundred milliseconds before communicating with the display.

If it's missing from the display then it's probably just been hard wired to VCC for you. Just attach the component pin to an unused I/O pin. Maybe we can make this optional if you have no free pins on your device.

gdt
Posts: 71
Joined: Thu Aug 10, 2017 2:04 pm
Has thanked: 25 times
Been thanked: 36 times
Contact:

Re: OLED Display (SH1106).

Post by gdt »

Hello Benj,
thanks for replay!
First of all the display is sold having an SSH1106 driver but I believe it's a typo since I found only the attached SH1106 datasheet.
Also this driver is for a 132x64 pixels (the FC component is 128x64 and cannot be changed).

The RST is missing in the display. As you can see it has 4 pins: GND, VCC, SCL and SDA.
If I leave the Reset to "Unconnected" then FC doesn't compile giving errors:

..........................................................................................................
.
.
.
Build date: Sep 13 2017
Part Support Version: 1.44
Copyright (C) 2017 Microchip Technology Inc.
License type: Node Configuration

Test_OLED(SSH1106_I2C)_128x64_PIC18LF26K80_v1.c:
1872: FCP_SET(FCP_NULL, 0);
^ (171) wrong number of preprocessor macro arguments for "FCP_SET" (2 instead of 5) (warning)
1876: FCP_SET(FCP_NULL, 1);
^ (171) wrong number of preprocessor macro arguments for "FCP_SET" (2 instead of 5) (warning)
Test_OLED(SSH1106_I2C)_128x64_PIC18LF26K80_v1.c: FCD_006e1_gLCD_SH1106_I2C1__Initialise()
1872: FCP_SET_FCP_NULL(0, , , );
^ (361) function declared implicit int (warning)
^ (195) expression syntax
(194) ")" expected ^
(195) expression syntax ^
1876: FCP_SET_FCP_NULL(1, , , );
^ (195) expression syntax
(194) ")" expected ^
(195) expression syntax ^
(908) exit status = 1
(908) exit status = 1

C:\Program Files (x86)\Microchip\xc8\v1.44\bin\xc8.exe reported error code 1

FINISHED
..........................................................................................................



Then I have to attach the Reset to a pin (RC2) to get an hex file.
Here is a flowchart to test it. The same chart using an SSD1306 I2C 128x32 works fine.

Please note that if I download to chip the hex file even the LED doesn't flash (Test_OLED(SSH1106_I2C)_128x64_PIC18LF26K80_v1).
If I delete all macros related to the display and I leave the LED (Test_LED_PIC18LF26K80_v1) it blinks as expected.

Any help is very appreciated.
Thanks
Giuseppe
Attachments
SH1106.pdf
(709.42 KiB) Downloaded 271 times
Test_OLED(SSH1106_I2C)_128x64_PIC18LF26K80_v1.fcfx
(14.1 KiB) Downloaded 295 times
Test_LED_PIC18LF26K80_v1.fcfx
(9.44 KiB) Downloaded 238 times

gdt
Posts: 71
Joined: Thu Aug 10, 2017 2:04 pm
Has thanked: 25 times
Been thanked: 36 times
Contact:

Re: OLED Display (SH1106).

Post by gdt »

All,
just to say that after some troubleshooting I realized that my display was faulty! :x
I used a new one and everything was fine.
However if you don't have a spare pin in the PIC to attach to Reset (this display has 4 pins: GND, VCC, SCL, SDA) find attached a component without Reset pin.

Regards
Giuseppe
Attachments
128x64.png
(79.57 KiB) Downloaded 1533 times
gLCD_SH1106_I2C.fcpx
(11.14 KiB) Downloaded 247 times

Post Reply