Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OLED initialization using I2C failes sometimes #2

Open
nebomuk opened this issue Sep 10, 2021 · 4 comments
Open

OLED initialization using I2C failes sometimes #2

nebomuk opened this issue Sep 10, 2021 · 4 comments

Comments

@nebomuk
Copy link

nebomuk commented Sep 10, 2021

Used hardware:
SSD1306 based OLED display and Arduino Nano. Display is connected via I2C.

Sometimes, the OLED display stays black after starting the t-rex-duino app.
I could not identify the specific reason in the source code for this but I found the following workaround:

When initializing the display with another SSD1306 library before the custom I2C code of the t-rex-duino app is executed, the display works properly.
For example when putting

Adafruit_SSD1306 display = Adafruit_SSD1306(...);
display.begin();

in the first lines of the setup(); function, the OLED display always turns on.

Is it possible that there's some kind of initialization bytes missing in the custom I2C SSD1306 code of the t-rex-duino app?

@AlexIII
Copy link
Owner

AlexIII commented Sep 10, 2021

Hi! Thanks for your comment.
Yes, it is possible that the initialization procedure is incomplete. There's a few different 'flavors' of 1306 controllers and they slightly differ from one another. Universal libraries such as Adafruit account for that. I only tasted the code with a single display I have on hands. I'll try to look into the Adafruit library, but without having the exact same display to experiment on, it is unlikely I can guess what exact init command is missing.

bulatovv added a commit to bulatovv/t-rex-duino that referenced this issue Oct 24, 2023
@rtek1000
Copy link

In order to use SH1106/SSD1306 you will need to add two 470 ohm resistors to the display board. You can add these resistors right on top of 10k resistors that already present (or replace them).

Hi @AlexIII , Where was this information obtained? This value of 470 ohms seems to be very low.

@AlexIII
Copy link
Owner

AlexIII commented Nov 23, 2023

@rtek1000 What do you mean "very low"? It's perfectly safe and necessary in this case, since the i2c bus is significantly overclocked.

@rtek1000
Copy link

@rtek1000 What do you mean "very low"? It's perfectly safe and necessary in this case, since the i2c bus is significantly overclocked.

Ok, there is a calculator that might be useful:

(3.3V, 400pF, HS (1.7MHz/3.4MHz): Pull up resistor range 0.967 KOhm < Rp < 0.472 KOhm; Rp can be replaced by external current source pull-ups to meet the rise time requirements)

Link: https://atman-iot.com/blog/i2c-pull-up-calculator/

Note: There are interesting resources about this in the footer too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants