Ea oledm128-6 i2c

There is the SCl, the data even chipselect, which was not used, is connected and is measured. However, nothing is shown on the display. According to the data sheet, it was connected https://www.mouser.com/datasheet/2/127/oledm128_6e-1388684.pdf for the I2C 0x78 (0x3C). Does anyone know a solution to what it could be that it doesn't work.

#include <Wire.h>

#define OLED_I2C_ADDRESS 0x3C  // I2C-Adresse des Displays

int cs = 7;

// the setup routine runs once when you press reset:
void setup() {
  pinMode(cs, OUTPUT);
  digitalWrite(cs, HIGH); // cs für Display auf 1
  delay(2);
  digitalWrite(cs, LOW); // cs für Display auf 0
  Wire.begin();        // I2C starten
  delay(400);
  init_OLEDM128();     // OLED initialisieren
  digitalWrite(cs, HIGH); // cs für Display auf 1
}

// Befehl an das OLED senden
void send_command(uint8_t command) {
  Wire.beginTransmission(OLED_I2C_ADDRESS);
  Wire.write(command);
  Wire.endTransmission();
}

// Daten an das Display senden (z.B. Textanzeige) 
void send_data(uint8_t data) {
  Wire.beginTransmission(OLED_I2C_ADDRESS);
  Wire.write(data);
  Wire.endTransmission();
}

// OLED initialisieren
void init_OLEDM128() {
send_command(0x40); //Set Display start line
send_command(0xA0); //Bottom View no Segment remap
send_command(0xC0); //Bottom View COM scan direction normal
send_command(0xA6); //Display normal (RAM)
send_command(0x81);
send_command(0xFF);
send_command(0xD5); 
send_command(0x40); //Clock divider/Oscillator frequency
send_command(0xD9); 
send_command(0x44); //Pre‐charge Period
send_command(0xAF); //Display on
}

// "Hello World!" auf das Display schreiben
void display_text(const char*text) {
  for (uint8_t i = 0; text[i] != '\0'; i++) {                 
    send_data(text[i]); // Zeichen senden
  }
}

void loop() {
 digitalWrite(cs, LOW); // cs für Display auf 0
 display_text("Hello");
 digitalWrite(cs, HIGH); // cs für Display auf 1
}
1 Like

Your description is kind of hard to understand.
Try I2C-scanner to see if it detects your display.
https://playground.arduino.cc/Main/I2cScanner/

1 Like

Would'n it be easier to start with some display library example code?
Is CS needed for something on your display on I2C?

CS is involved in this because it would not have received the data without it ...

CS shouldn't be needed for I2C, just connect it to GND.
You didn't answer for my question about ssd1306 library example...

Yes i tried and it didnt work with the library. And its not the same Display there i need the OLED ssd1306 or a similar.

I know this with this Display ssd1306 it works but with the oledm128 it doesnt work.

1 Like

Oke the CS doesnt need it. After i changed the initalisation a little bit the display just flickers.

// OLED initialisieren
void init_OLEDM128() {
send_command(0x40); //Set Display start line
send_command(0xA0); //Bottom View no Segment remap
send_command(0xC0); //Bottom View COM scan direction normal
send_command(0xA6); //Display normal (RAM)
send_command(0xFF); //81
//send_command(0xFF);
send_command(0xD5); 
//send_command(0x40); //Clock divider/Oscillator frequency
send_command(0xD9); 
//send_command(0x44); //Pre‐charge Period
send_command(0xDB);
//send_command(0x20);
send_command(0xAF); //Display on
}

Your datasheet linked describes it has ssd1306.
Feel free to post your circuit, simple drawing or good photo.

btw nice picture! i love electronics so yeah everything like this... just wow!

Ugly photo. This circuit doesn't enjoy of spaghetti wiring, everything should be neat and short.
Do you have 12.5V VCC and 3V VDD?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.