Blog

All the Colors – Advanced Human Interface Design Using Smart RGB LEDs

All the Colors – Advanced Human Interface Design Using Smart RGB LEDs

Figure_3

Technokrat is a young company founded by four electrical engineering graduates, providing a fresh and agile approach to development, product design, manufacturing and consulting. As a partner, Computer Controls supports Technokrat by making Test Equipment affordable, even as an initial investment. This gives Technokrat the opportunity to provide valuable services to its clients.

A client of Technokrat asks for a human interface solution to be designed and integrated in a medical automotive device. One of the client’s design requests is to integrate a substantial amount of individual RGB LEDs between various control elements, giving the user a modern and minimalist feedback in contrast to e.g. an LCD display.

Due to mechanical constraints, it quickly becomes clear that using discrete RGB LEDs is not a viable approach due to the sheer amount of routing and the necessity of multiple driver ICs. Also, the resulting BOM cost is not very appealing for the client.

Therefore, we shifted our focus to so-called “intelligent LEDs” or “smart LEDs”. These LEDs feature an integrated controller chip that is directly bonded to the LED dies as can be seen in Figure 1. They can be daisy-chained and controlled digitally with a serial data stream.

Figure_1

Unfortunately, these LEDs are only available in the Chinese market. This often means that manufacturers can’t be identified clearly, or are changing often, datasheets are of (very) questionable quality and assuring constant product quality (or even getting the exact same product) can be difficult. These issues can, however, be managed with some experience in overseas supply chain management and some extra development effort to compensate for weak data sheets. On the bright side, the resulting BOM costs make the client grin broadly.

From a technical view, the LEDs are a bit tricky as well. They are controlled by a single NRZ data stream as shown in Figure 2, with quite stiff timings. Each LED consumes the first 24 bits of the data it receives and forwards everything else to its output. Therefore, a virtually unlimited number of LEDs can be daisy-chained, at the cost of decreasing refresh rate. A special reset code has to be sent between frames.

To make things harder, there are multiple datasheets for the same LED, stating different bit timings. Multiple slightly different versions of the embedded controller IC exist which mainly differ in bit timing. It’s not clear which controller IC you get in your LEDs. As a fun fact, none of the timings in the IC datasheets matches the datasheet we got from the LED supplier. So better be prepared to play with timings.

Figure_2

Before the implementation starts, an important question arises: How to generate the NRZ data stream? Most implementations use hand-tweaked assembler code for bit-banging, which is not very elegant, resource-hungry and time consuming to implement.

To generate serial data streams efficiently from memory (using DMA), usually SPI and USART peripherals are used. At first glance it doesn’t look like these peripherals can generate the required timings. That’s where creative engineering starts: Using a very high SPI bitrate, effectively oversampling the stream, the correct timing can be approximated by transmitting corresponding bit patterns.

At this point, the Keysight DSOX2014A provided valuable service for analyzing the data stream and tweaking the bit patterns until they were received correctly by the LEDs. 

The deep memory of the DSOX2014A is very helpful in such situations, allowing triggering and capturing of a whole data frame while still allowing zooming in on individual bits as can be seen in Figure 3. Using the split zoom feature, individual bit times can be easily analyzed while the whole data block is still shown on the screen.

Figure_3-1

To be honest, there are some prior implementations using SPI peripherals on the internet. However, in another application on the same project, the SPI peripheral was not available anymore. So, as a bonus, an implementation using a UART peripheral was made as well.

In principle, while being the same thing, using UART poses additional challenges: The start and stop bits are hardware generated and can’t be influenced by the user. Embedding these start and stop bits into the data stream in such a way that they don’t interfere with the data is another task which requires careful tweaking of many parameters. The Keysight DSOX2014A makes this task just a lot more enjoyable.

Technokrat provides state of the art electrical engineering, product design, manufacturing and consulting – all from one single source. Based in Zürich, we offer rapid prototyping as well as development for market and polishing of existing product designs.

Technokrat-logo
Share

Related Posts

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *