Two PIC pins drive six LEDs

This Design Idea 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.

Two PIC pins drive six LEDs

A previous Design Idea [1] shows how to drive four LEDs with two I/O lines. Some other Design Ideas [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 1), 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).

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:

dotmode1.asm acts as a free running dot chaser.

barmode1.asm displays an incremental bargraph.

(Download DI5459PIC2IO6LED.zip.txt by choosing Save As and removing the dummy “.txt”)

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, optimized in size, and take less than 256 words, allowing the user to choose any other pin-limited PIC.

 

For more detail: Two PIC pins drive six LEDs

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter