![]() If you run this code on an AVR pre-configured for 8Mhz and 3.3v, you'll see performance of half the values I measured. I've seen info indicating that they're meant to run at only 3.3v, and other info showing that they're safe from 3.3 to 5V. I connected the GPIO lines and Vcc directly to the SSD1306. The code I created is not necessarily practical, nor the 'right' way to do it, but I wanted to see how fast I could get it in C/C++ without having to write it in AVR assembly language.Ĭaution: For this experiment, I'm running the AVR at 16Mhz with a Vcc of 4.5V. ![]() The SSD1306 OLED controller also supports a 10Mhz SPI interface, so I assumed that the I2C interface on these displays could probably be driven faster than "spec" and not have any major issues. TinyWireM), but I wanted to see how much code is necessary to talk to a write-only I2C device and how well I could optimize it. ![]() There are several public domain libraries available (e.g. The ATtiny85 doesn't have I2C hardware built in, so it needs to be emulated in software using GPIO pins. I have already written a SSD1306 library for both Linux and Arduino, but I wanted to drive the display from an ATtiny85 and learn about the I2C protocol in the process. ![]() At 400Khz, using the I2C hardware and the Wire library, I was able to refresh the display around 23.5 frames per second (FPS) with my code. The 3.4Mhz version uses a slightly different protocol. The I2C standard recently added some higher speeds (1Mhz and 3.4Mhz). An I2C clock rate of around 800Khz is also possible on AVR MCUs, but not supported directly by the Wire library. These are the 2 standard speeds supported by most AVR Arduinos. The default speed for I2C is 100Khz and the "fast" mode is 400Khz. The majority of the ones sold expose a two wire interface (TWI) aka I2C. The SSD1306 OLED displays are very popular with hobbyists due to their low cost and easy interfacing.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |