26 February 2010

Drive 12 LED$ with one I/O line

Few Design Ideas expand the I/O of a pin-limited microcontroller (references 1 through 4). The circuit in this Design Idea uses an alternative method (Figure 1). It limits external additional parts to one IC, and it drives as many as 12 LEDs in dot-bar or bar-graph mode. You can use the same technique in a dot-bar design
(Figure 2). If you need a seven-segment LED display, you can use the circuit in Figure 3, which shows how to rearrange the circuit according to a classic multiplexed, four-digit common-cathode display. The prototype display uses Kingbright’s (www.kingbright-led.com) SC52-11EWA high-efficiency LEDs, which emit 2000 to 5600 mcd at a forward current of 10 mA. The driver is a 12-stage NXP (www.nxp.com) 74HCT4040 binary counter or a 74HC4040 version for a lower power supply.Listing 1, which you can download at the online version of this Design Idea at www.edn.com/100204dib, contains an assembly-language routine.It generates a precise quantity, Q, of high-frequency pulses, which deliver the number, N, that the outputsof the 74HCT4040 require. The relations are Q52N21 in dot-bar mode and Q52N21 in bar-graph mode.    Listdesignideas

 which is also available at www.edn.com/100204dib, is a full example of using this routine with Microchip’s (www.microchip.com) PIC10F202, a member of the PIC10F series, which is the company’s mostpin-limited microcontrollerfamily.Although the PIC’s internal unique clock frequency is 4 MHz, you’ll noticelittle flicker effect. You can reducethe flicker by using a midrange pin-limited PIC microcontroller, such as the PIC12F629, which has an internal.
clock frequency of 20 MHz. Listing 3, also available at www.edn.com/100204dib, uses a look-up table to convert the desired number into seven-segment code to replace the 12 LEDs with a four-digit display.EDN References Anonymous, “Microcontroller provides low-cost analog-to-digital conversion, drives seven-segment displays,” EDN, May 10, 2007, pg 80, www.edn.com/article/CA6437954. Raynus, Abel, “Squeeze extra outputs from a pin-limited microcontroller,” EDN, Aug 4, 2005, pg 96, www.edn.com/article/CA629311. Jayapal, R, PhD, “Microcontroller’s single I/O-port line drives a bar-graph display,” EDN, July 6, 2006, p 90, www.edn.com/article/CA6347254. Lekic, Nedjeljko, and Zoran Mijanovic,“Three microcontroller ports drive 12 LEDs,” EDN, Dec 15, 2006, pg 67, www.edn.com/article/CA6399101.

Post a Comment