Optimizing AVR LCD Libraries

A while ago, [Paul Stoffregen], the creator of the Teensy family of microcontrollers dug into the most popular Arduino library for driving TFT LCDs. The Teensy isn’t an Arduino – it’s much faster – but [Paul]’s library does everything more efficiently.

Even when using a standard Arduino, there are still speed and efficiency gains to be made when driving a TFT. [Xark] recently released his re-mix of the Adafruit GFX library and LCD drivers. It’s several times faster than the Adafruit library, so just in case you haven’t moved on the Teensy platform yet, this is the way to use one of these repurposed cell phone displays.

After reading about [Paul]’s experience with improving the TFT library for the Teensy, [Xark] grabbed an Arduino, an LCD, and an Open Workbench Logic Sniffer to see where the inefficiencies in the Adafruit library were. These displays are driven via SPI, where the clock signal goes low for every byte shifted out over the data line. With the Adafruit library, there was a lot of wasted time in between each clock signal, and with the right code the performance could be improved dramatically.

The writeup on how [Xark] improved the code for these displays is fantastic, and the results are impressive; he can fill a screen with pixels at about 13FPS, making games that don’t redraw too much of the screen at any one time a real possibility.

Hackaday Links Column Banner

Hackaday Links: January 4, 2015

Chips as furniture is now a thing. It started off with a 555 footstool from Evil Mad Scientist and moved on to an EPROM coffee table. Now [msvm] over on the War Thunder forums has constructed a Nixie tube driver table. It’s based on the K155, and as a neat little addition, he’s included a real vintage chip under glass in the table.

Have some tongs, an anvil, and a blowtorch? Make some bottle openers out of framing nails. There’s a lot of variety here in the shapes of the bottle openers.

[Stephen] used a solid state relay he found on eBay to drive some Christmas lights. The SSR failed. That meant it was time to see inside of this relay looked like. The short answer is, ‘a lot of goop and epoxy’, but the traces look big enough to support the current it’s rated for.

Imagine a part of your 3D printer breaks. That’s alright, just print another…. oh, yeah. Well, I guess it’s time to make a bearing bracket out of wood.

The Electronica MK-54 and MK-61 (actually the Электроника МК-54) were incredibly popular Soviet programmable calculators. Now there’s an emulator for them.

[Rue Mohr] found a very cheap TFT display on an Arduino shield. The chip for the display was an SPF5408, a chip that isn’t supported by the most common libraries. He eventually got it to work after emailing the seller, getting some libraries, and renaming and moving a bunch of stuff. If you have one of these displays, [Rue] just saved you a bunch of time.