Path: EDN Asia >> Design Centre >> IC/Board/Systems Design >> Driving six LEDs with two PIC pins
IC/Board/Systems Design Share print

Driving six LEDs with two PIC pins

23 Jun 2014  | Benabadji Noureddine

Share this page with your friends

This article demonstrates a new method of driving six LEDs with only two I/O lines from a microcontroller, and so is particularly suitable for any pin-limited chip. It uses a pair of I/O lines combined with a pair of complementary bipolar transistors. More than one LED can appear to be lit by multiplexing.

A previous article [1] shows how to drive four LEDs with two I/O lines. Some other articles [2-5] use additional logic, which increases cost and size.

Note that VDD must be between 2V & 3V: for example, if LED2 is ON (table), LED4 and LED6 will also light if VDD is too high. You can choose any general purpose low power transistors, but to keep the same brightness for each LED, choose transistors with low VCE(sat).

Table: LED drive logic table. Avoid (0,0) and (1,1).

For testing, a PIC10F200 was chosen as it is the smallest and simplest 6-pin microcontroller. For pedagogical purposes, the firmware has been provided as two separate and simple assembler sources.

Note that in either mode, only one LED is driven at a time, with a minimum amount of current (down to 2mA with high brightness LEDs), and uses periodic bursts of short pulses. The assembler sources are fully commented, optimised in size, and take less than 256 words, allowing the user to choose any other pin-limited PIC.

1. Decoder lights the way (EDN | February 19, 2009)

2. Microcontroller drives logarithmic/linear dot/bar 20-LED display (EDN | January 18, 2007)

3. Squeeze extra outputs from a pin-limited microcontroller (EDN | August 4, 2005)

4. Microcontroller's single I/O-port line drives a bar-graph display (EDN | July 6, 2006)

5. Drive 12 LEDs with one I/O line (EDN | February 4, 2010)

To download the PDF version of this article, click here.

Want to more of this to be delivered to you for FREE?

Subscribe to EDN Asia alerts and receive the latest design ideas and product news in your inbox.

Got to make sure you're not a robot. Please enter the code displayed on the right.

Time to activate your subscription - it's easy!

We have sent an activate request to your registerd e-email. Simply click on the link to activate your subscription.

We're doing this to protect your privacy and ensure you successfully receive your e-mail alerts.

Add New Comment
Visitor (To avoid code verification, simply login or register with us. It is fast and free!)
*Verify code:
Tech Impact

Regional Roundup
Control this smart glass with the blink of an eye
K-Glass 2 detects users' eye movements to point the cursor to recognise computer icons or objects in the Internet, and uses winks for commands. The researchers call this interface the "i-Mouse."

GlobalFoundries extends grants to Singapore students
ARM, Tencent Games team up to improve mobile gaming

News | Products | Design Features | Regional Roundup | Tech Impact