Displays We Love Hacking: SPI And I2C

I’ve talked about HD44780 displays before – they’ve been a mainstay of microcontroller projects for literal decades. In the modern hobbyist world, there’s an elephant in the room – the sheer variety of I2C and SPI displays you can buy. They’re all so different, some are LCD and some are OLED, some have a touchscreen layer and some don’t, some come on breakouts and some are a bare panel. No matter which one you pick, there are things you deserve to know.

These displays are exceptionally microcontroller-friendly, they require hardly any GPIOs, or none extra if you already use I2C. They’re also unbelievably cheap, and so tiny that you can comfortably add one even if you’re hurting for space. Sure, they require more RAM and a more sophisticated software library than HD44780, but with modern microcontrollers, this is no problem at all. As a result, you will see them in almost every project under the sun.

What do you need for those? What are the requirements to operate one? What kind of tricks can you use with them? Let’s go through the main aspects.

Continue reading “Displays We Love Hacking: SPI And I2C”

Driving An OLED Screen With A 6502 Single-Board Computer

Twenty years ago, if you wanted an LCD for a project, you’d probably end up with something salvaged from a mobile phone or an HD44780 character display. These days, little OLEDs can be had for a few bucks and they’ve taken the maker world by storm. [Anders Nielsen] has recently been experimenting with driving these displays from the vintage 6502 CPU, and he’s even got scrolling operation down pat.

The best part is that [Nielsen] is doing all this on a single-board computer running his own assembly code. That’s right – there’s no compilers here. It’s bare metal coding at it’s best. The build uses a 6507 chip running at 1 MHz, paired with a 6532 RIOT and just 128 bytes of RAM—a similar setup to the Atari 2600.

The video explains how the code stacks up and drives the display, achieving the scrolling effect. It makes a huge difference to usability, especially compared to chunking pages at a time to the postage stamp-sized screen. He demonstrates a legitimate usage case too, using the setup as a serial terminal for a Raspberry Pi.

The 6502 architecture still looms large in the collective consciousness; we’ve been talking about programming it in assembly for years. Video after the break.

Continue reading “Driving An OLED Screen With A 6502 Single-Board Computer”

All About USB-C: Talking Low-Level PD

In this USB-C series, we’ve covered quite a bit of USB-C – things that are well known, things that should be  better known, and a couple things that just appeared online for the first time. We’ve covered almost everything in some depth except USB Power Delivery. I’ve described the process a bit in the “Power” article, but that was mostly about how to use PD by simply buying the right solution. However, that’s not enough for a hacker. Let’s see if we can make our own PD trigger board. Continue reading “All About USB-C: Talking Low-Level PD”

Character VFD Becomes Spectrum Analyzer

These days, streaming services are a great way to listen to music or podcasts on your computer or on the go. However, they lack one feature of the MP3 players and streamers of old: visualizations! [mircemk] is a fan of those, and has built a hardware spectrum analyzer that pumps with the music.

The build relies on a 20×2 character VFD display that looks great, with high brightness and excellent contrast. It can be easily driven from a microcontroller, as it has a controller on board compatible with the typical HD44780 command set. On Arduino platforms, this means the display can easily be driven with the popular LiquidCrystal library.

The Arduino Nano inside takes in the audio signal via its analog inputs. It then processes the audio with the fix_fft library, which runs a Fast Fourier Transform in order to figure out the energy level of each frequency bin in the audio spectrum for both the left and right channels. This data is then sent to the screen for display. It’s impressively fast and smooth, with the display dancing along with the beat nicely as [mircemk] tests it out with some tunes.

If it looks familiar, it’s because it’s an updated version of a prior project from [mircemk]. We saw it previously as a VU meter that pulsed with the beat, an altogether simpler visualization but still a cool one. Video after the break.

Continue reading “Character VFD Becomes Spectrum Analyzer”

ESP32 composite library with LVGL demo. (Credit: aquaticus)

Generating Composite Video On ESP32 With LVGL GUI

RCA connector mounted to ESP32 board. (Credit: aquaticus)
RCA connector mounted to ESP32 board. (Credit: aquaticus)

Just because a microcontroller doesn’t have a dedicated video peripheral doesn’t mean it cannot output a video signal. This is demonstrated once again, this time on the ESP32 by [aquaticus] with a library that generates PAL/SECAM and NTSC composite signals. As a finishing touch on the hardware side, [aqaticus] added an RCA jack is an optional extra. The composite signal itself is generated on GPIO 25, with the selection from a wide number of PAL and NTSC resolutions.

In addition, LVGL support is integrated: this is an open-source library that provides a cross-platform way to provide graphical UIs for embedded platforms. Using this combination any ESP32 can generate a fully graphical UI on a monochrome or color display to add some extra flair and functionality to an ESP32 project.

Currently, this library does not support color output, but hopefully this will be added in the future. Even so, together with simple VGA output using a DAC, this library provides yet another way to add analog video output to ubiquitous MCUs like the ESP32. Even if these MCUs are not going to be decoding any video formats at a reasonable speed, adding a UI that’s more user-friendly than an HD44780-based display and a few buttons can really elevate the user experience.

VFD Character Display Turned Into Audio VU Meter

Humans love visualising music, whether it’s in the form of an inscrutable equation drawing squiggles in Winamp, or a simple VU meter pulsing with the beat. This build from [mircemk] is of the latter variety, repurposing a VFD display to do the job.

The project is built around a VFM202MDA vacuum fluorescent display, which provides that lovely green-blue glow we all know and love, driven by a PT6314 driver chip. This has the benefit that it can be readily driven by a microcontroller in much the same way as the familiar HD44780 character LCD driver chip. With some minor tweaks, the character set can be modified to allow the display to become a surprisingly-responsive VU meter.

An Arduino Nano runs the show, with an envelope follower circuit feeding a signal for the left and right channels into the analog inputs of the microcontroller. The Arduino then measures the voltage on those inputs and feeds the necessary commands to the PT6314 driver to update the display.

The resulting VU meter has 38 bars per channel, and is highly responsive. The fast flickering of the meter bars in response to the music make it compelling to watch, and the era-appropriate enclosure the project is built in adds plenty to the aesthetic.

We’ve seen other VU meter builds before too, like this one that uses a little physics knowledge to create a more realistic analog-like needle meter. Video after the break.
Continue reading “VFD Character Display Turned Into Audio VU Meter”

Remoticon 2021 // Joey Castillo Teaches Old LCDs New Tricks

Segmented liquid crystal displays are considered quite an old and archaic display technology these days. They’re perhaps most familiar to us from their use in calculators and watches, where they still find regular application. [Joey Castillo] decided that he could get more out of these displays with a little tinkering, and rocked up to Remoticon 2021 to share his findings.

[Joey’s] talk is a great way to learn the skills needed to reverse engineer a typical segment LCD.
[Joey] got his start hacking on these displays via his Sensor Watch project –  a board swap for the venerable Casio F-91W wristwatch, with the project now available on CrowdSupply. It kits out the 33-year-old watch design with a modern, low-power ARM Cortex M0+ microcontroller running at 32 MHz that completely revolutionizes what the watch can do. Most importantly, however, it repurposes the watches original segmented monochrome LCD.

Segment LCDs are usually small monochrome devices made out of glass, that have the benefit of using very little power in their operation. They come with a fixed layout, which cannot be changed – so they’re often designed specifically for a given purpose. A calculator will have segments laid out to display numbers, often in the usual 7-segment fashion, while a watch may add dedicated segments for displaying things like “AM,” “PM,” or “ALARM.” Continue reading “Remoticon 2021 // Joey Castillo Teaches Old LCDs New Tricks”