Comments (2)
I don't have a pro micro. I ran your example on a Leonardo for 20 minutes with no problem.
Your display may be very sensitive to timing of signals on the I2C bus. I suspect there are many USB interrupts with the ATmega32U4.
AvrI2c does not disable interrupts while doing I2C operations. Wire handles transfers in an ISR with interrupts disabled.
AvrI2c uses 400 kHz I2c by default. You could try 100 kHz by editing this line in SSD1306Ascii.h and set AVRI2C_FASTMODE TO zero.
/** AvrI2c uses 400 kHz fast mode if AVRI2C_FASTMODE is nonzero else 100 kHz. */
#define AVRI2C_FASTMODE 1
Another possibility is to disable interrupts during I2C writes by adding noInterrupts() and interrupts() to the write function in SSD1306AsciiAvrI2c.h like this.
void writeDisplay(uint8_t b, uint8_t mode) {
noInterrupts(); // Disable interrupts <<--ADD
if ((m_nData && mode == SSD1306_MODE_CMD)) {
m_i2c.stop();
m_nData = 0;
}
if (m_nData == 0) {
m_i2c.start((m_i2cAddr << 1) | I2C_WRITE);
m_i2c.write(mode == SSD1306_MODE_CMD ? 0X00 : 0X40);
}
m_i2c.write(b);
if (mode == SSD1306_MODE_RAM_BUF) {
m_nData++;
} else {
m_i2c.stop();
m_nData = 0;
}
interrupts(); // Enable Interrupts <<-- ADD
}
from ssd1306ascii.
thanks so much for this turning off fast mode fixed the issue i have been chasing for a week.
from ssd1306ascii.
Related Issues (20)
- When using a display with more than 64 pixels in the Y direction, the lcdHeight parameter is ignored. HOT 6
- Changing I2C pins HOT 1
- Arduino Pro Micro 32U4 and oled.clear(); HOT 1
- Some functions seem to need pixels as a parameter and not row/column character numbers? HOT 3
- Is there any function that returns data from the display? (to verify the display is somewhat functional in init) HOT 2
- Compile Error with Teensy 2.0 HOT 2
- How would one add a new font to the driver? HOT 1
- Full Ascii character set - e.g.: Umlauts in Germany HOT 8
- Trying to Determine Biggest Text for 128 x 32 HOT 1
- oled.println(); not going in new line on display HOT 3
- Is there a way to programmatically determine what Font is current? HOT 5
- Ticker Text demo question / maybe issue HOT 5
- How to use u8g2_font_unifont_t_chinese Chinese character library HOT 2
- degrees celsius symbol HOT 3
- Software i2c HOT 4
- 70x42 OLED ? HOT 8
- Begin() return error if OLED not connected/found. HOT 2
- Text height HOT 2
- Two oled 128x32 sharing the same address 0x3C connected to ESP32
- Compiling error with Arduino nano every (ATMega4809) HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ssd1306ascii.