Path: EDN Asia >> Design Ideas >> IC/Board/Systems Design >> MCU moving-dot display interface uses three I/O lines
IC/Board/Systems Design Share print

MCU moving-dot display interface uses three I/O lines

24 Mar 2016  | Abel Raynus

Share this page with your friends

The moving-dot display has some advantages over the bar-graph display: It better indicates the location of a detected object in sonar and radar applications; it needs only one LED's current-limiting resistor instead of several; and it provides the same current for all LEDs, thus providing even brightness. When a new design required adding a seven-LED moving-dot display to an 8bit, low-end microcontroller, a question arose about the corresponding interface. Of course, the most cost-effective approach is to directly connect the LEDs without any extra parts. But this approach needs seven vacant microcontroller-output pins, which microcontrollers with limited I/Os often cannot afford.

Figure: Using the 1-to-8 CD4051 analog demultiplexer you can interface a moving-dot LED display to a low-end microcontroller using just three outputs.

A previous article describes a one-wire interface that applies only to a bar-graph display, not to a dot display (Reference 1). Another tack would be interfacing using serial-to-parallel shift registers or a serial-input Johnson counter. But small microcontrollers often lack a SPI (serial-peripheral interface), and you must use firmware to re-create it (Reference 2). The method in this Design Idea needs three output lines—data, clock, and latch—and requires some firmware and hardware. Exploiting the fact that only one LED in a dot display should light at a time, you can use National Semiconductor's CD4051 1-to-8 analogue demultiplexer (figure). This circuit needs three microcontroller outputs, and the firmware is simple and straightforward. The additional benefit is that the microcontroller now does not limit the LED current and voltage; you can choose them independently.

Listing 1 provides demo firmware illustrating this design. The demo program automatically moves the lit dot back and forth by incrementing and decrementing a modulo-7 counter. Ideally, any three adjacent microcontroller outputs, such as pA0, pA1, and pA2, are available for the A, B, and C inputs of the CD4051. But, this scenario is not always possible. In this application of a low-end, eight-pin MC68HC908QT1 microcontroller, you can use pins pA2 and pA3 only as inputs. You can easily overcome this problem by programming, as Listing 1 shows. This Design Idea applies to any small microcontroller because it uses only a standard instruction set.

1. Jayapal, R, "Microcontroller's single I/O-port line drives a bar-graph display," EDN, July 6, 2006, pg 90.

2. Raynus, Abel, "Squeeze extra outputs from a pin-limited microcontroller," EDN, Aug 4, 2005, pg 96.

About the author
Abel Raynus contributed this article.

This article is a Design Idea selected for re-publication by the editors. It was first published on May 1, 2008 in

Want to more of this to be delivered to you for FREE?

Subscribe to EDN Asia alerts and receive the latest design ideas and product news in your inbox.

Got to make sure you're not a robot. Please enter the code displayed on the right.

Time to activate your subscription - it's easy!

We have sent an activate request to your registerd e-email. Simply click on the link to activate your subscription.

We're doing this to protect your privacy and ensure you successfully receive your e-mail alerts.

Add New Comment
Visitor (To avoid code verification, simply login or register with us. It is fast and free!)
*Verify code:
Tech Impact

Regional Roundup
Control this smart glass with the blink of an eye
K-Glass 2 detects users' eye movements to point the cursor to recognise computer icons or objects in the Internet, and uses winks for commands. The researchers call this interface the "i-Mouse."

GlobalFoundries extends grants to Singapore students
ARM, Tencent Games team up to improve mobile gaming

News | Products | Design Features | Regional Roundup | Tech Impact