spyder0069:
Thank you for the response. The display is identical looking the black pcb a few posts up. After much tinkering I was able to figure it out.
The display can be SPI or I2C. I was trying to do I2C and for that the modifications are to remove R4 and jumper R3 and R5.
I had the normal 4.7k pullups on the SDA and SCL.
In order for the display to function:
10K pullup on the RST. THIS DISPLAY REQUIRES THE RESET. Pick an IO of your choice.
In I2C mode the DC line is your address. The displays I received are x78 or x7A. If you pull DC low it will be at x78 and tied high is x7A (not the x3C that have been reported elsewhere).
The CS line seem to not matter if its floating or tied low but I have tied to ground. Here is my sample code that works (ESP32). Hopefully it will help someone else out as this was hours of head scratching for me. LoL
#include "U8g2lib.h"
#include <Wire.h> //Library for I2C interface
//HW i2C is 22 for SCL and 21 for SDA
U8G2_SSD1309_128X64_NONAME0_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ 23);
byte mycounter=0;
String mystring;
void setup() {
delay(1000);
//u8g2.setI2CAddress(0x78); //if DC is pulled low
u8g2.setI2CAddress(0x7A); //if DC is pulled high
u8g2.setBusClock(1500000);
u8g2.begin();
u8g2.setFont(u8g_font_6x10);
}
void loop() {
drawOLED_1();
delay(1000);
if(mycounter<200){
mycounter=mycounter+1;
}else{
mycounter=0;
}
}
void drawOLED_1(void) {
//char buffer[10];
u8g2.clearBuffer(); // clear the internal memory
u8g2.setFont(u8g2_font_ncenB08_tr);
u8g2.drawStr(0, 10, "LINE1");
u8g2.drawStr(0, 20, "LINE2");
u8g2.drawStr(0, 30, "LINE3");
u8g2.drawStr(0, 40, "LINE4");
mystring=String(mycounter);
u8g2.setCursor(0, 50);
u8g2.print(mystring);
u8g2.sendBuffer();
}
Bought the same display, tried exact steps above, no worky. It does announce itself as 0x3C on the bus when RES is pulled up with 10K, but that's about as far as it goes. I connected it to pin D6 on Nano and have put "6" as reset pin in your code, not sure if that part is correct.