Posts | Comments

Planet Arduino

Archive for the ‘SSD1306’ Category

After covering a few of his builds at this point, we think it’s abundantly clear that [Igor Afanasyev] has a keen eye for turning random pieces of antiquated hardware into something that’s equal parts functional and gorgeous. He retains the aspects of the original which give it that unmistakable vintage look, while very slickly integrating modern components and features. His work is getting awfully close to becoming some kind of new art form, but we’re certainly not complaining.

His latest creation takes an old-school “Monopak” electronic flash module and turns it into a desk clock that somehow also manages to look like a vintage television set. The OLED displays glowing behind the original flash diffuser create an awesome visual effect which really sells the whole look; as if the display is some hitherto undiscovered nixie variant.

On the technical side of things, there’s really not much to this particular build. Utilizing two extremely common SSD1306 OLED displays in a 3D printed holder along with an Arduino to drive them, the electronics are quite simple. There’s a rotary encoder on the side to set the time, though it would have been nice to see an RTC module added into the mix for better accuracy. Or perhaps even switch over to the ESP8266 so the clock could update itself from the Internet. But on this build we get the impression [Igor] was more interested in playing with the aesthetics of the final piece than fiddling with the internals, which is hard to argue with when it looks this cool.

Noticing the flash had a sort of classic TV set feel to it, [Igor] took the time to 3D print some detail pieces which really complete the look. The feet on the bottom not only hold the clock at a comfortable viewing angle, but perfectly echo the retro-futuristic look of 50s and 60s consumer electronics. He even went through the trouble of printing a little antenna to fit into the top hot shoe, complete with a metal ring salvaged from a key-chain.

Late last year we were impressed with the effort [Igor] put into creating a retro Raspberry Pi terminal from a legitimate piece of 1970’s laboratory equipment, and more recently his modern take on the lowly cassette player got plenty of debate going. We can’t wait to see what he comes up with next.

A good deal of the projects we cover here at Hackaday are not, in the strictest sense, practical endeavors. If we required that everything which graced our digital pages had a clear end result, the site would be in a rather sad state of affairs. Sometimes it’s enough just to do something for the challenge of it. But more often than not, you’ll learn something in the process which you can use down the line.

That’s precisely what pushed [Laurence Bank] to see how well he could optimize the frame rate on the popular SSD1306 OLED display. After several iterations of his code, he was able to achieve a blistering 151.5 FPS, with apparently still some room for improvement if he’s feeling up to the challenge. But considering his first attempt was only running at 5.5 FPS, we’d say he’s already more than earned his hacker cred on this one.

A few different tricks were used to achieve such incredible performance gains. To start with, while the official I2C specification says you’re supposed to wait for an acknowledgment back from the device when communicating with it, [Laurence] realized the SSD1306 didn’t actually care. He could continuously blast commands at the display without bothering to wait for an acknowledgment. He admits there are problems with this method, but you can’t argue with the results.

To really wring all the performance out of the system he could, [Laurence] donned his Assembly Cap and examined how the Arduino IDE compiler was interpreting his code. He identified a few areas where changing his C code would force the compiler to generate faster output. He notes that this wouldn’t normally be required when working with more advanced compilers, but that the Arduino toolchain needs its hand held occasionally.

This isn’t the first time we’ve seen somebody try and push more pixels through the very same OLED display, and it’s interesting to see the two very different approaches to the same goal.


High Speed SSD1306 Library

arduino, arduino due, arduino hacks, Direct Memory Access, dma, i2c, ILI9341, more, OLED, SAM3X8E, SPI, SPI.h, SSD1306 Commenti disabilitati su High Speed SSD1306 Library 

[Lewin] wrote in to tell us about a high speed library for Arduino Due that he helped develop which allows interfacing OLED displays that use the SSD1306 display controller, using DMA routines for faster display refresh time.

Typically, displays such as the Monochrome 1.3″ 128×64 OLED graphic display , are interfaced with an Arduino board via the SPI or I2C bus. The Adafruit_SSD1306 library written by [Limor Fried] makes it simple to use these displays with a variety of Arduinos, using either software or hardware SPI. With standard settings using hardware SPI, calls to display() take about 2ms on the Due.

[Lewin] wanted to make it faster, and the SAM3X8E on the Due seemed like it could deliver. He first did a search to find out if this was already done, but came up blank. He did find [Marek Buriak]’s library for ILI9341-based TFT screens. [Marek] used code from [William Greiman], who developed SD card libraries for the Arduino. [William] had taken advantage of the SAM3X8E’s DMA capabilities to enable faster SD card transfers, and [Marek] then adapted this code to allow faster writes to ILI9341-based screens. All [Lewin] had to do was to find the code that sent a buffer out over SPI using DMA in Marek’s code, and adapt that to the Adafruit library for the SSD1306.

There is a caveat though: using this library will likely cause trouble if you are also using SPI to interface to other hardware, since the regular SPI.h library will no longer work in tandem with [Lewin]’s library. He offers some tips on how to overcome these issues, and would welcome any feedback or testing to help improve the code. The speed improvement is substantial. Up to 4 times quicker using standard SPI clock, or 8 times if you increase SPI clock speed. The code is available on his Github repo.

Filed under: Arduino Hacks

Using a neat little OLED-display with an Arduino

arduino, display, LCD, OLED, SSD1306 Commenti disabilitati su Using a neat little OLED-display with an Arduino 


by Kalle Hyvönen:

I needed a display for a project of mine and was just going to use a regular HD44780 -based text LCD display, until I spotted some very neat looking TINY OLED-displays from eBay. The displays are monochrome 128×32 pixel displays with a 4-wire SPI bus and they are around 30x11mm in size (the actual display area is under an inch diagonally!). The exact type of the displays is UG-2832HSWEG04. I found a datasheet for the displays and a datasheet for the actual display controller (SSD1306) and they seemed easy enough to use so I ordered a two of them for just $13.

Using a neat little OLED-display with an Arduino - [Link]

  • Newsletter

    Sign up for the PlanetArduino Newsletter, which delivers the most popular articles via e-mail to your inbox every week. Just fill in the information below and submit.

  • Like Us on Facebook