Go Down

Topic: i2c oled 6 pins cant connect :/ (Read 174 times) previous topic - next topic

qwerkek

I'm new at arduino
My Oled has 6 pins

-gnd
-vcc
-scl
-sda
-res
-dc

I was searching that but only oleds I found 7pin or 4 pin I didnt found anyone using oled like mine

I have downloaded the adafurit ssd1306 library but I'm not sure which cabe has to connect which pin.Can you help?

thanks

manor_royal

My adafruit 931 has 6 pins, labelled similarly but where you have dc I have 3v3, so not sure what your dc one is.

But anyhoo, I just use 5V and Gnd, and the 2x i2c pins sda and scl.

Works as advertised.

Tip: you'll get better help if you actually give product details and a link to the maker's page.


david_prentice

Connect RES to a GPIO pin.    Declare this in the constructor as the oled_reset pin.
Connect DC to 0V for the regular Slave address.
SDA, SCL to SDA, SCL on your Arduino.

I am always wary of 3.3V modules and 5V logic on a Uno.   Most need level shifters.
Please post a link to your actual display with a truthful photo of the pcb.

David.

olikraus

#3
Jan 15, 2017, 09:11 am Last Edit: Jan 15, 2017, 10:05 am by olikraus
My Oled has 6 pins

-gnd
-vcc
-scl
-sda
-res
-dc

I was searching that but only oleds I found 7pin or 4 pin I didnt found anyone using oled like mine

This might be also a SPI OLED with a missing CS input.

Wire in this way:
-scl --> pin 13
-sda --> pin 11
-res --> pin 8
-dc --> pin 9


Then try the following constructor (U8g2 Library) in one of the U8g2 examples:
U8G2_SSD1306_128X64_NONAME_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ U8X8_PIN_NONE, /* dc=*/ 9, /* reset=*/ 8 );

If this does not work, then connect dc with GND (instead of pin 9) and try this constructor:
U8G2_SSD1306_128X64_NONAME_1_SW_I2C u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* reset=*/ 8 );


Oliver
 

david_prentice

Looking at the Adafruit_SSD1306 examples:
Code: [Select]

...
#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);
...
  display.begin(SSD1306_SWITCHCAPVCC, 0x3D);  // initialize with the I2C addr 0x3D (for the 128x64)
  ...


This is using Digital#4 pin for RES
And Slave address 0x3D for the display (i.e. DC pin = high)

If you wire DC pin to 0V,  you would use:
Code: [Select]

...
#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);
...
  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);  // initialize with the I2C addr 0x3C
  ...


I am not familiar with Oliver's U8g2 constructors,   but I guess there will be one for the hardware I2C pins.

My 6-pin OLED works correctly on the I2C bus.    A lot of early Ebay modules did not ACK the I2C.
Hence the importance of showing a link that has an accurate photo of your actual display.

David.

olikraus

My 6-pin OLED works correctly on the I2C bus.    A lot of early Ebay modules did not ACK the I2C.
Hence the importance of showing a link that has an accurate photo of your actual display.

Yes, this is another difficulty. However u8g2 software emulated I2C will work with these OLEDs.

Hardware I2C is also supported by u8g2 but has a different constructor name (see examples or documentation for this)

Oliver

qwerkek

Looking at the Adafruit_SSD1306 examples:
Code: [Select]

...
#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);
...
  display.begin(SSD1306_SWITCHCAPVCC, 0x3D);  // initialize with the I2C addr 0x3D (for the 128x64)
  ...


This is using Digital#4 pin for RES
And Slave address 0x3D for the display (i.e. DC pin = high)

If you wire DC pin to 0V,  you would use:
Code: [Select]

...
#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);
...
  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);  // initialize with the I2C addr 0x3C
  ...


I am not familiar with Oliver's U8g2 constructors,   but I guess there will be one for the hardware I2C pins.

My 6-pin OLED works correctly on the I2C bus.    A lot of early Ebay modules did not ACK the I2C.
Hence the importance of showing a link that has an accurate photo of your actual display.

David.
while trying to upload ssd1306 128*64_i2c its giving

"
Arduino:1.8.0 (Windows 10), Kart:"Arduino/Genuino Uno"

ssd1306_128x64_i2c:54: error: #error ("Height incorrect, please fix Adafruit_SSD1306.h!");

 #error("Height incorrect, please fix Adafruit_SSD1306.h!");

  ^

exit status 1
#error ("Height incorrect, please fix Adafruit_SSD1306.h!");

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
"

I bought this from https://www.direnc.net/128x64-oled-6pin-is-spi-lcd-display

I'M not sure what to do :/


david_prentice

Looking at my "Adafruit_SSD1306.h" file:
Code: [Select]

#define SSD1306_I2C_ADDRESS   0x3C // 011110+SA0+RW - 0x3C or 0x3D
// Address for 128x32 is 0x3C
// Address for 128x64 is 0x3D (default) or 0x3C (if SA0 is grounded)

/*=========================================================================
    SSD1306 Displays
    -----------------------------------------------------------------------
    The driver is used in multiple displays (128x64, 128x32, etc.).
    Select the appropriate display below to create an appropriately
    sized framebuffer, etc.

    SSD1306_128_64  128x64 pixel display

    SSD1306_128_32  128x32 pixel display

    SSD1306_96_16

    -----------------------------------------------------------------------*/
   #define SSD1306_128_64
//   #define SSD1306_128_32
//   #define SSD1306_96_16
/*=========================================================================*/


It looks as if Adafruit expect their 128x32 display to use 0x3C and their 128x64 display to use 0x3D.

Personally,  I would configure my 128x64 to be 0x3C (as you can see above)
You might find it easier to wire DC high,  and use 0x3D as Adafruit 128x64 examples expect 0x3D.

David.

qwerkek

This might be also a SPI OLED with a missing CS input.

Wire in this way:
-scl --> pin 13
-sda --> pin 11
-res --> pin 8
-dc --> pin 9


Then try the following constructor (U8g2 Library) in one of the U8g2 examples:
U8G2_SSD1306_128X64_NONAME_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ U8X8_PIN_NONE, /* dc=*/ 9, /* reset=*/ 8 );

If this does not work, then connect dc with GND (instead of pin 9) and try this constructor:
U8G2_SSD1306_128X64_NONAME_1_SW_I2C u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* reset=*/ 8 );





That was it . it solve it thanks alot for help.
display was spi. thank you


Oliver
 

david_prentice

#9
Jan 16, 2017, 10:21 am Last Edit: Jan 16, 2017, 10:22 am by david_prentice
Ah-ha.   I am fairly certain that my 6-pin OLED came as I2C.
Hence the importance of showing an accurate photo of the pcb.

I really do not understand how a 6-pin can work on the SPI bus without  a /CS pin.

If you have an I2C 6-pin (which is ACK-able),   you can have multiple I2C devices as Nature intended.
You can even have multiple OLED displays.   Use each DC pin to "select" the appropriate OLED.   (i.e. match the Slave Address)

David.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy