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 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

READ  Linear Tech on how to power LEDs and protect them

JLCPCB – Prototype 10 PCBs for $2 + 2 days Lead Time
China’s Largest PCB Prototype Enterprise, 300,000+ Customers & 10,000+ Online Orders Per Day
Get quote online easily:

Leave a Comment

= 4 + 9

Read previous post:
Product How-to: Ultra-low noise linear regulators for powering PLL/VCO and clocking ICs

Wideband communication systems usually require an ultra-low noise regulator to power the VCOs and PLLs. The regulator must also be...

Scroll to top