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

The Importance of PCB Design in Consumer Products

April 25, 2024
Explore the importance of PCB design and how Fusion 360 can help your team react to evolving consumer demands.

PCB Design Mastery for Assembly & Fabrication

April 25, 2024
This guide explores PCB circuit board design, focusing on both Design For Assembly (DFA) and Design For Fabrication (DFab) perspectives.

What is Design Rule Checking in PCBs?

April 25, 2024
Explore the importance of Design Rule Checking (DRC) in manufacturing and how Autodesk Fusion 360 enhances the process.

Unlocking the Power of IoT Integration for Elevated PCB Designs

April 25, 2024
What does it take to add IoT into your product? What advantages does IoT have in PCB related projects? Read to find answers to your IoT design questions.

Comments

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