david_prentice:
Surely Frame Rate depends on how fast you send the 1024 bytes from SRAM buffer to the OLED.
The SSD1306 hardware I2C @ 400kHz means 23ms. i.e. 40 FPS is a practical limit.Yes, the Arduino Wire library could be improved. e.g. non-blocking
digitalWrite() is not relevant to hardware I2C at all.Of course Oliver wants to support users who choose to mis-wire their I2C devices.
Providing a bit-banged alternative that uses digitalWrite() means it can run on ANY Arduino target.Whereas the SSD1306 I2C interface is restricted to 400kHz, the SPI interface is 10MHz.
In theory, you should be able to achieve dramatic Frame Rates.David.
I'm doing this experiment to see how far I can push the I2C interface of the SSD1306 and the AVR. I'm at the point now where I'm "uglifying" the code to get speed improvements. I'm keeping it in C++, but monitoring the compiler output to make sure it does what I want. For example, it's ignoring my "inline" requests for certain functions, so I'm going to brute force inline them instead. Of course the SPI interface can achieve higher speeds, but the I2C interface is talking to the same chip (and is the more popular version of this display configuration). I'm up to 129FPS and there's still more room for improvement.