Get A Dual-Programmable LED Flasher "For Free"

Feb. 2, 2004
There are many ways to design LED flashers using transistors, op amps, 555 timers, or even relays. And specialized ICs exist for driving LEDs, such as the LX1990...93 from Microsemi Integrated Products. But all of these approaches need extra...

There are many ways to design LED flashers using transistors, op amps, 555 timers, or even relays. And specialized ICs exist for driving LEDs, such as the LX1990...93 from Microsemi Integrated Products. But all of these approaches need extra hardware, meaning extra cost and space on the pc board.

When a design already uses a microcontroller (MCU), it would be beneficial to build an LED flasher exclusively in software—without using any external components. Such a solution is extremely flexible. You can program any period and duration of flashing, ranging from a fraction of a second to hours. In the case of two or more LEDs, you can choose any sequence of lighting: blinking together, one by one, etc. You would only require one or several vacant MCU pins.

Any MCU can be employed. In our design, we used the 8-bit low-end MC68HRC908JK1 from Motorola (see the figure). According to the project requirements, the flasher can generate two sequences determined by the switch, SW. When the switch is closed, LED1 and LED2 should flash simultaneously at a one-second rate. When the switch is open, they alternate flashing at the same rate. The LEDs are LTL-4231T-R1, with a built-in resistor from LiteOn.

The timer interrupt service routine (TISR) is available in the online version of this Design Brief at www.elecdesign.com. The TISR doesn't interfere with the main MCU program because it only takes about 30 µs (with fOSC = 4.85 MHz ) to be executed. Slightly modifying the program can supply any other flashing time rate and sequence—for example, the "running light."

Sponsored Recommendations

What are the Important Considerations when Assessing Cobot Safety?

April 16, 2024
A review of the requirements of ISO/TS 15066 and how they fit in with ISO 10218-1 and 10218-2 a consideration the complexities of collaboration.

Wire & Cable Cutting Digi-Spool® Service

April 16, 2024
Explore DigiKey’s Digi-Spool® professional cutting service for efficient and precise wire and cable management. Custom-cut to your exact specifications for a variety of cable ...

DigiKey Factory Tomorrow Season 3: Sustainable Manufacturing

April 16, 2024
Industry 4.0 is helping manufacturers develop and integrate technologies such as AI, edge computing and connectivity for the factories of tomorrow. Learn more at DigiKey today...

Connectivity – The Backbone of Sustainable Automation

April 16, 2024
Advanced interfaces for signals, data, and electrical power are essential. They help save resources and costs when networking production equipment.

Comments

To join the conversation, and become an exclusive member of Electronic Design, create an account today!