Bookmark and Share Printer-friendly version Email to a Friend

Bicolor LED Indicates 10 States

( 01 Jun 2011 )
By Abel Raynus, Armatron International, Malden, Massachusetts

Most microcontroller-based devices have several states of operation. Pushbutton switches often control these states. To minimize costs, many designs use only one switch; the number of presses sets the microcontroller’s state. In the circuit in this Design Idea, lighting an LED indicates the chosen state.

A large selection of bicolor LEDs is on the market in various shapes and colors from Kingbright, Optosupply, and other suppliers. These LEDs provide new opportunities to use just one LED to indicate 10 states. You set the states by pressing a pushbutton switch that connects to a microcontroller’s external interrupt pin (Figure 1). After each push, the interrupt subroutine sets the device to the next state (Figure 2).


FIGURE 1



FIGURE 2



State 0 is standby mode with the LED off. The device waits for you to press a switch. The LED’s color indicates the next three states. For example, a Kingbright WP5A9EGW12.3SF LED yields red, green, and orange. Add blinking to indicate the remaining states. You can independently control the red and the green LEDs, yielding six more combinations of indication (Table 1).


TABLE 1


Using the microcontroller’s internal oscillator as a clock source simplifies the circuit because the oscillator needs no external components and its 5 percent tolerance is sufficient for this application. Firmware sets the built-in pullup resistor for external interrupt input.

The clock speed and the values of the prescaler and time-counter-modulo registers determine the rate of LED blinking. The internal oscillator generates a 12.8MHz clock, resulting in a 3.2MHz bus frequency, with one cycle equal to 0.3125μs. By choosing a prescaler value of 64, a time-counter-modulo register can calculate a cycle of 50 times the timer period in milliseconds. For example, for 1s of blinking, you should set the time-counter modulo to 50,000, or $C350 in hexadecimal.

Using tables rather than polling in programming allows you to significantly reduce the size of firmware (Reference 1).You can download firmware assembly code here. This method is applicable to any microcontroller. You can even increase the number of indicated states by using different blinking rates.

 
Printer-friendly version Email to a Friend
 
Article Rating 
Average Rate: No rating yet
 
Poor Quite Good Good Very Good Excellent
 
 
ADVERTISEMENT
 
Related Content 
 
 
ON-DEMAND WEBCASTS


 
 
Highest Rated  
Feedback Loop  

ADS BY GOOGLE 
 
 
 
ADVERTISEMENT
Press Release 
 
TECHNOLOGY NEWS
 
 
 
PRODUCT NEWS
 
FEATURED SPONSORS
 
 
 
DESIGN CENTERS
 
ADVERTISEMENT
     
Reference Designs 
   
     
 
 
 
 

 

RSS
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   

POLL
What type of environmental regulation do you think will be most beneficial for the tech industry?
Proper recycling and disposal
Push for power efficiency and energy conservation
Chemical/lead regulation
View results


 
     
 
Power Technology E-newsletter 
Power.org Releases Power Architecture 32-bit Application Binary Interface Supplement
EDNA, May 11
POL Regulators Designed for Energy-efficient Computing
EDNA, March 11
Fairchild Revolutionizes Power Savings
EDNA, January 11
Lattice Transforms Board Power and Digital Management
EDNA, November 10
 
Analog E-newsletter 
12V Dual-channel Synchronous Buck Converter Features Integrated FETs
EDNA, February 10
Power MOSFETs features reduced top-side thermal impedanc
EDNA, January 10
 
     
 
KNOWLEDGE CENTER
 
Texas Instruments: DaVinci™ Technology
 
Texas Instruments: Safe Bet Series
 
 
INDUSTRY LINKS
 
Photonics Association (Singapore)
Singapore Industrial Automation Association (SIAA)
Taiwan Semiconductor Industry Association (TSIA)
 
 
OUR SPONSORS
 






Keithley Instruments
With more than 60 years of measurement expertise, Keithley Instruments has become a world leader in advanced electrical test instruments and systems from DC to RF (radio frequency). Our products solve emerging measurement needs in production testing, process monitoring, product development, and research...
 
 
 
     
 

EDN India | EDN Taiwan | EDN Korea | EDN Japan | EDN China | EDN | EDN Europe

 
ABOUT EDN Asia | CONTACT US
   
© 2012 EDN Asia All rights reserved.