ESP32 Display Is Worth A Thousand Words

The ESP32 is the successor to the wildly popular ESP8266. There seems to be no end to what the chips can do. However, despite all the wireless communication capabilities, the module doesn’t have a display. [G6EJD] wanted to connect an ILI9341 TFT display and he put the code and information on GitHub. You can also see a video of his work, below.

Since the display uses a serial interface, there isn’t much wiring required. The Adafruit GFX library does the heavy lifting, utilizing the SPI library for the actual communications. The first demo shown on the hardware can pull weather data decoded. If you want more details on the display’s operation, check out [G6EJD’s] YouTube channel and you’ll find other videos that go into more detail.

We’ve seen these displays married to an ESP8266 with an integrated PCB, too. There’s a choice of libraries, and perhaps we’ll see a similar range of choice for the ESP32.

Continue reading “ESP32 Display Is Worth A Thousand Words”

The Other Kind Of Phone Hacking

While it’s true that your parts bin might have a few parts harvested from outdated devices of recent vintage, there’s not much to glean anymore aside from wall warts. But the 3×48-character LCD from [Kerry Wong]’s old Uniden cordless landline phone was tempting enough for him to attempt a teardown and reverse engineering, and the results were instructive.

No data sheet? No problem. [Kerry] couldn’t find anything out about the nicely backlit display, so onto the logic analyzer it went. With only eight leads from the main board to the display module, it wasn’t likely to be a parallel protocol, and the video below shows that to be the case. A little fiddling with the parameters showed the protocol was Serial Peripheral Interface, but as with other standards that aren’t exactly standardized, [Kerry] was left with enough ambiguity to make the analysis interesting. Despite a mysterious header of 39 characters, he was able in the end to drive the LCD with an Arduino, and given that these phones were usually sold as a bundle with a base and several handsets, he ought to have a nice collection of displays for the parts bin.

With how prevalent this protocol has gotten, [Kerry]’s post makes us want to get up to speed on the basics of SPI. And to buy a logic analyzer too.

Continue reading “The Other Kind Of Phone Hacking”

Easy-Peasy Heart Monitor

If you’re at all into medical hacks, you’ve doubtless noticed that the medical industry provides us with all manner of shiny toys to play with. Case in point is a heart-monitoring IC that’s so brand new, it’s not even available in all of the usual distributors yet. [Ashwin], who runs a small prototyping-supplies company, ProtoCentral, has been playing around with the new MAX30003 ECG chip, and the results look great.

The punchline is that the four-to-five dollar chip does everything for you, including analog filtering, wander removal, and even detecting the pulse rate. Using the chip is simple: you plug in two electrodes on one end, and you get the waveform data out over SPI on the other, with little or no work to do on the microprocessor side. The Arduino in the examples is just passing the SPI data straight to the laptop, with no processing going on at all.

[Ashwin] is selling these as breakout boards, but everything is open source, from the hardware to the GUI, so check it out if you’re interested in building your own. In particular, the circuit is just a voltage regulator and five volt level shifter.

Everything we know about electrocardiography projects, we learned from this presentation, and it looks like the devil is in the (many) details, so it’s nice to offload them to custom silicon whenever possible. We just think it’s awesome that we can scoop up some of the giant medical industry’s crumbs to play around with.

SPI On Embedded Linux

Are you already comfortable working with Serial Peripheral Interface (SPI) parts and looking for a challenge? We suspect many of you have cut your teeth on 8-bit through 32-bit microcontrollers but how much time have you spent playing with hardware interfaces on embedded Linux? Here a new quest, should you choose to accept it. [Matt Porter] spoke in detail about the Linux SPI Subsystem during his presentation at FOSDEM 2017. Why not grab an embedded Linux board and try your hand at connecting some extra hardware to one of the SPI buses?

The hardware side of this is exactly what you’d expect from any embedded SPI you’ve worked on: MOSI, MISO, a clock, and a slave select. [Matt] gives a succinct overview of SPI and reading datasheets. Our own [Elliot Williams] has done an excellent job of digging through the basics and most common gotchas if you need to get up to speed on all the SPI basics.

The fun details in the talk start at about 18:30 into the video when [Matt] jumps into the Linux side of SPI. You need a controller driver and a protocol driver. The controller driver is responsible for dealing with the pins (actual hardware) and the protocol driver handles the job of making sense of the SPI packets (messages containing any number of transfers) going in or out. In other words, the controller drive just want bits and pushes them in or out on hardware, the protocol driver makes those bits meaningful to the Linux system.

Adding SPI devices (think devices like LCDs and sensors) to your own embedded systems means telling the OS the particulars about that hardware, like max speed and SPI mode. There are three ways to handle this but the Device Tree is the preferred method for modern systems. This paves the way for the controller driver which implements an API set that the Linux SPI subsystem will use to work with your new hardware.

Protocol drivers follow the standard Linux driver model and are pretty straight forward. With these two drivers in place the new device is hooked into the OS and opens up common SPI API calls: spi_async(), spi_sync(), spi_write(), and spi_read(), and a few others.

Continue reading “SPI On Embedded Linux”

3D Printering: Trinamic TMC2130 Stepper Motor Drivers

Adjust the phase current, crank up the microstepping, and forget about it — that’s what most people want out of a stepper motor driver IC. Although they power most of our CNC machines and 3D printers, as monolithic solutions to “make it spin”, we don’t often pay much attention to them.

In this article, I’ll be looking at the Trinamic TMC2130 stepper motor driver, one that comes with more bells and whistles than you might ever need. On the one hand, this driver can be configured through its SPI interface to suit virtually any application that employs a stepper motor. On the other hand, you can also write directly to the coil current registers and expand the scope of applicability far beyond motors.

Continue reading “3D Printering: Trinamic TMC2130 Stepper Motor Drivers”

What Could Go Wrong: SPI

Serial Peripheral Interface (SPI) is not really a protocol, but more of a general idea. It’s the bare-minimum way to transfer a lot of data between two chips as quickly as possible, and for that reason alone, it’s one of my favorites. But that doesn’t mean that everything is hugs and daffodils. Even despite SPI’s simplicity, there are still a few ways that things can go wrong.

In the previous article in this series, inspired by actual reader questions, I looked into troubleshooting asynchronous serial connections. Now that you’ve got that working, it’s time to step up to debugging your SPI bus! After a brief overview of the system, we’ll get into how to diagnose SPI, and how to fix it.

Continue reading “What Could Go Wrong: SPI”

Hackaday Prize Entry: Adding HDMI To Small Displays

LCDs come in a lot of sizes, and there’s a lot written about pushing pixel data out to larger displays. Smaller LCDs, like the 4, 5 and 7 inch variety, aren’t used much, because no one seems to know how to drive the things. For [Joe]’s Hackaday Prize Entry, he’s creating an open source interface for tiny LCDs, making it easy and cheap to add one to everything with an HDMI port.

[Joe]’s Open LCD Interface comes on two boards, with the first providing connections to an LCD, all the power circuitry required, and a bunch of pads to break out every IO line. The second part of the puzzle is a decoder that takes HDMI signals and drives a small LCD.

HDMI decoders are nothing new to the world of hobby electronics – there are multiple projects that give the BeagleBoard a display through HDMI. Even Adafruit sells one of these converters. [Joe]’s board has another trick up its sleeve, though: it can give any microcontroller a high-resolution display, too.

There’s another module that connects to [Joe]’s breakout board that turns the LCD into an SPI display. This means any microcontroller can drive a high-resolution display. It’s fast, too: in the video below, [Joe]’s SPI display can push pixels at least as fast as any other microcontroller-based display we’ve seen.

It’s a great project, and a by opening up the doors to millions of cheap LCDs on eBay and Alibaba, [Joe] has a great entry for the Hackaday Prize on his hands.

Continue reading “Hackaday Prize Entry: Adding HDMI To Small Displays”