Edit: Confirmed:
https://forum.arduino.cc/t/ssd1306-oled-display-config/658283
I wouldn't call that 'confirmed' as it was a single reply noting that 'HC' might represent 'IIC' thus I2C to an uneducated Chinese eye, so making the 'HC' side of the solder jumper might put it in I2C mode. There was no followup giving the O.P's success or failure.
Lets refer to the
SSD1306 (IC) datasheet.
N.B. This is not the display datasheet, just the COG or chip-on-flex display controller datasheet so you wont find the ribbon connector pinout in it or details of the display size.From an interfacing point of view, the interesting stuff starts just before section 8, with 'Table 7-1 : MCU Bus Interface Pin Selection' There are THREE interface selection pins BS0-BS2, which select the interface mode.
Taking BS2 as the MSB:
BS2:0 Interface
000 4 wire serial
001 3 wire serial
010 I2C
100 6800 parallel
110 8080 parallelAs you can see its possible to switch between I2C and 4 wire serial by a single solder jumper for SSD1306 pin BS1.
However lets review the connections given in section 8:
8.1.3 MCU Serial Interface (4-wire SPI)
The 4-wire serial interface consists of serial clock: SCLK, serial data: SDIN, D/C#, CS#. In 4-wire SPI mode, D0 acts as SCLK, D1 acts as SDIN. For the unused data pins, D2 should be left open. The pins from D3 to D7, E and R/W# (WR#)# can be connected to an external ground.
and
8.1.5 MCU I2
C Interface
The I2
C communication interface consists of slave address bit SA0, I2
C-bus data signal SDA (SDAOUT/D2 for output and SDAIN/D1 for input) and I2C-bus clock signal SCL (D0). Both the data and clock signals must be connected to pull-up resistors. RES# is used for the initialization of device.
...
b) I2C-bus data signal (SDA)
SDA acts as a communication channel between the transmitter and the receiver. The data and the acknowledgement are sent through the SDA.
It should be noticed that the ITO track resistance and the pulled-up resistance at “SDA” pin becomes a voltage potential divider. As a result, the acknowledgement would not be possible to attain a valid logic 0 level in “SDA”.
“SDAIN” and “SDAOUT” are tied together and serve as SDA. The “SDAIN” pin must be connected to act as SDA. The “SDAOUT” pin may be disconnected. When “SDAOUT” pin is disconnected, the acknowledgement signal will be ignored in the I2C-bus.
If D2 (SDA out) is not linked to D1 (SDA in), the SSD1306 cant ACK any data or address it receives on the I2C bus. The pullup will provide a NACK instead. This is non I2C standard compliant as ACK is usually used to indicate the receiver is present cant can accept more data. Therefore without the D1-D2 link, the SSD1306 cant be seen by
i2cdetect or other I2C scanners as they probe each address in turn looking for an ACK to map the connected devices. You'll also have to configure your I2C library to perform multi-byte writes ignoring the NACKs, rather than aborting on the first NACK.
Note that D2 is only for ACKs, you cant read back any SSD1306 registers or display RAM.
If your display is COG, due to the ITO track resistance, D2 needs buffering with an open drain non-inverting buffer, so it can properly drive SDA low against the pullup current. If its chip-on-flex the low resistance copper tracks mean you don't need a buffer and can simply link D2 and D1.
TLDR: find D2 and link it to D1 for I2C mode to work properly!