OLED Display 0.96" (SSD1315) has wrong I2C Address (0x3c)

One of life’s most puzzling puzzles:

   Is the address 0x78 or is it 0x3C?

Answer: Both of the above, depending on your Point of View.

Data sheets almost always give the I2C device address as a 7-bit number. For these devices, the 7-bit device address depends on the jumper setting, and is either

  • Binary 011 1100 (Hexadecimal 0x3C)

      or
    
  • Binary 011 1101 (Hexadecimal 0x3D)

I note that many of the Data Sheets only give 7-bit binary values and leaves the user to figure out what the Hex values are, depending on how they may be used in an application’s software routines.

Here’s an excerpt from the Data Sheet for an SSD1306:

Either “0111100” or “0111101”, can be selected as the slave address of SSD1306.

Consider the first configuration:

Now on the I2C bus, the first byte after putting the I2C “Start” condition on the bus goes like this:

For beginning a “Write” transaction, the device address is shifted left one bit, giving binary 0111 1000 (hexadecimal 0x78). For a “Write” transaction, the LSB (Least Significant Bit) is left as ‘0’. For a “Read” transaction the LSB is set to ‘1’.

Just about all of the professional (and almost-professional) software libraries that I have used — Circuit Python, Micropython, and lots (and lots) of C/C++ libraries for Raspberry Pi and approximately a gazillion Microchip PIC processors— use the 7-bit address when calling I2C libraries.

On the other hand:

I have seen posts where individuals have written library routines that use 0x78 (binary 0111 1000) as the address parameter in the calling routine, and the library function sets the Least Significant Bit for reading.

Bottom line: If your I2C scan program shows 0x3C, it is consistent with the silkscreen 0x78 label. If you change your board to use the 0x7A position (8-bit binary 0111 1010), (and you did it right) you should see 0x3D as the I2C device address in your I2C scanner program.

Regards,

Dave