Hi.
I have a TIMER0 interrupt that only increment a volatile int cnt++; and change the status of a volatile boolean Flag1ms=true;
This two variables are used to refresh in the loop{} some outputs states to produce a specific pattern of pulses and to pool a rotary encoder pin status.
If i do a Serial.print of the encoder status on the serial monitor, the output signals are perfectly stable in the oscilloscope and the changes on the rotary encoder and the push button are precise in the serial monitor.
If i try to do the same in the OLED_1306 with libraries OLED_I2C.h and OLED_I2C.cpp my signals go crazy and some pulses are missing.
My question is why the TWI influence the interrupts while serial doesn't?
Thank you for your time, and yes i have read:
OLED_I2C manual,
Gammon Forum : Electronics : Microprocessors : Interrupts, and
Atmel-7810-Automotive-Microcontrollers-ATmega328P_Datasheet, point 21.6
perhaps there is a way to use pool instead of interrupt for the I2C.
MENUTEST08.ino (16.1 KB)