Thursday, November 11, 2010

How to control 12 LEDs with 4 Microcontroller Pins

If you've ever done before all the electronics that will likely be familiar with multiplexing charlieplexing but adds a new dimension. This is a technology commercially developed by Charlie Allen at Maxim hence the name, but you can still use the technique in your own circuits.

Note: The present technique is a bit 'of time, but Maxim is one of the first companies to use in a commercial chip.

Multiplexing means simply sharing or

FDM Frequency Divisionmultiplexing

TDM time division multiplexing

WDM Wavelength Division Multiplexing

Of course the other form of multiplexing that every electronics engineer uses to send signals around a digital circuit using standard logic gates, and although not as glamorous as FDM, TDM and WDM is a fundamental technique for designing digital circuits.

With a logic gate multiplexer normal to have a minimum of two inputs to be selected and output to send acontrolled by a control signal.

The statuses of the output ports as you might expect, is high (logic 1) or low (logic 0), but charlieplexing recognize another state:

High impedance.

Note: This is the third state in addition to 0 and 1 so it is often called the Tri-State.

High impedance indicates that the deactivation of the output circuit so no current can flow in and out of the output pin.

Of course logic gates are high-impedance outputaround for as long as digital circuits are used primarily to open a microprocessor bus where each device is tri-stated to disconnect from the shared bus while another device output data to the bus.

Charliplexing

Charlieplexing use the third State to a pin of a network of devices to disconnect so that no power on that node, and is ideal for the control of a microcontroller, it is easy for the surgery only changed by reprogramming ofmicrocontroller.

One application is the control of many LED charlieplexing with very few pins. LEDs are diodes, so as to reverse the voltage across the LED half that no current. If you have two two LED output pin is connected to the second diode in the opposite direction to the first (and using the current limiting resistors). Set the output pin to 01 'the first LED, while setting the output pin 10 goes to the second LED.

Now add a third output pin and the addition oftwo diodes connected between each pin of the microcontroller as before. You now have six three-state LED and each pin of the microcontroller itself is only two output pins are 'linked', that can each LED individually.

Time to control six LEDs with only 3 pins that normally have 6 individual output pins.

The formula for the number of LEDs you can operate:

LED = n * (n-1)


Two pin x 2 (2-1) = 2
Three pin 3 x (3-1) = 6
4 x four feet (4-1) =12

Advantage Charlieplexing

Very few of many LED control pin.

The disadvantage of Charlieplexing

Only a few groups of LEDs can be switched at the same time.

See Also : Welcome to Refrigerators Store.

No comments:

Post a Comment