0
\$\begingroup\$

Just out of curiosity I would like to write my own oled display SSD1306 I2C driver using arduino nano board and atmel studio 7.

I analyzed the Adafruit I2C initialization which sends byte 0x00 after sending slave address 0x78.

I read the SSD1306 datasheet but something still is not clear to me. It's about bit7 and bit6 of each received byte.

The datasheet states:

  • If the Co bit (bit7) is set as logic “0”, the transmission of the following information will contain data bytes only.

  • The D/C# bit (bit6) determines the next data byte is acted as a command or a data. If the D/C# bit is set to logic “0”, it defines the following data byte as a command. If the D/C# bit is set to logic “1”, it defines the following data byte as a data which will be stored at the GDDRAM. The GDDRAM column address pointer will be increased by one automatically after each data write."

    My question is: what happens if both bits are set to zero? It seems like a contradiction.

    • bit7 is zero : so next databytes should be non display memory related databytes
    • bit6 is zero : so next databyte will be a command

It seems from the Adafruit initialization that the next byte will be a command...

I Hope someone can help me out.

\$\endgroup\$
1
\$\begingroup\$

Co is a continuation bit. If set to 1, the controller expects another control byte in this I2C write cycle. If set to 0, the controller will not expect to receive another control byte in this I2C write cycle.

  • Co = 0, D/C = 0: Next byte(s) are command (non-graphics) data, after which I2C stop condition is expected
  • Co = 1, D/C = 0: Next byte(s) are command (non-graphics) data, after which another control byte is expected
  • Co = 0, D/C = 1: Next byte(s) are graphs data, after which I2C stop condition is expected
  • Co = 1, D/C = 1: Is illegal combination (I think)
\$\endgroup\$
  • \$\begingroup\$ Great, I could not deduce this from the datasheet. Thanks! \$\endgroup\$ – HenkvW Dec 10 '18 at 18:02
  • \$\begingroup\$ @HenkvW - Hi, Your reply indicates that your question has been answered. If so, please mark this answer as "accepted", as explained in the help center here: "What should I do when someone answers my question?". That will tell the website "back-end" that this question has been answered, removes it from the "unanswered" list and prevents readers getting further "nags" to answer it. Thanks :-) \$\endgroup\$ – SamGibson Dec 10 '18 at 21:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.