Zibb

Design Idea

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

A moving-dot LED-display interface to a microcontroller uses only three output pins.

Abel Raynus, Armatron International, Malden, MA; Edited by Charles H Small and Fran Granville -- EDN, 5/1/2008

The moving-dot display has some benefits 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 8-bit, 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.

A previous Design Idea 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 analog demultiplexer (Figure 1). 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.


References
  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.


Reed Business Information Resource Center

Featured Company


Related Resources

ADVERTISEMENT

ADVERTISEMENT

Related Content

 

By This Author


ADVERTISEMENT

Knowledge Center


Events

Microchip Worldwide Embedded Designer’s Forum
Dates: 10/6/2009 - 2/15/2010
Location: 120 Locations Worldwide

Microprocessor Test and Verification (MTV'09)
Dates: 12/7/2009 - 12/8/2009
Location: Austin, TX

Oxford University Practical RF/Microwave Design Short Course
Dates: 1/18/2010 - 1/22/2010
Location: Oxford, United Kingdom

Oxford University Digital Signal Processing Short Course
Dates: 1/25/2010 - 1/27/2010
Location: Oxford, United Kingdom

Oxford University Digital Signal Processing Implementation Short Course
Dates: 1/28/2010 - 1/28/2010
Location: Oxford, United Kingdom

Submit an EventSubmit an Event




Technology Quick Links

EDN Marketplace


©1997-2009 Reed Business Information, a division of Reed Elsevier Inc. All rights reserved.
Use of this Web site is subject to its Terms of Use | Privacy Policy

Please visit these other Reed Business sites