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
ESP8266: I2C transmission rate stays at 100kHz #80
Comments
As suggested above, adding this to Adafruit_SSD1306 worked for me. My drawing went from 112ms to 30ms...9fps to 30fps! Thanks @KarateBrot !! Now my ECG heart monitor is graphing my heartbeat smoothly!
Trying to set in setup() didnt work. The Adafruit lib (or Wire) resets it back to 100k. |
It only worked for me if I put the function call at the end of the |
Library v1.2 incorporates faster I2C transfers. |
Adafruit_SSD1306.cpp, line 461 - 464
When using ESP boards these lines seem to get ignored so the I2C rate stays at 100 kHz.
The problem here is that Adafruit_SSD1306::display takes way too long to transmit data with 100 kHz and therefore yielding only ~10 fps on my display which is way too slow. You can actually see every frame building up. 🐌
I tried this on a WeMos D1 Mini (4MB) and on a NodeMCU.
How I fixed it
In
void setup(){}
I insertedWire.setClock(400000L);
to successfully get 400 kHz on my ESP boards and ~30 fps on my display.Possible solution
Add code to Adafruit_SSD1306.cpp, line 465:
Additionally:
In this case an 800 kHz transmission rate seems to be the maximum. By calling
Wire.setClock(800000L);
~60 fps can be achieved on SSD1306 OLEDs using an ESP8266. That's nearly a sixfold increase in drawing speed! compared to what's possible out of the box right now.The text was updated successfully, but these errors were encountered: