[b]Help Controlling LEDS[/b]

Thread Starter

armyman_talha

Joined Jan 16, 2012
3
Help Controlling LEDS

I am new to Microcontrollers and wanted to become more familiar with it so that I can do big projects .... I wanted to know how to control a number of LEDs more than Output ports on Microcontroller ..

For example ,
Microcontroller has 32 I/O pins and i want to control 40 leds , how can I do it .?

I want to know more and more about controlling LEDs like 6x20 led matrix display for whole word display with a software on computer or keypad attached to circuit board .

I am using PIC16f877A and I have made a development board for it and also have a parallel port programmer .

Anyways thanks for reading .
 
Last edited:

CraigHB

Joined Aug 12, 2011
127
I've heard the term before, but never looked it up. Wikipedia has a quick rundown, interesting. Funny they used the guy's first name. Says he's with Maxim, great products.
 

MrChips

Joined Oct 2, 2009
19,383
You don't need any transistors. And really, you don't need any extra components either. But to be on the safe side I would include eight resistors, about 220-ohm, just to limit the current.

You will be able to control each LED and create any pattern you desire. Only one LED will ever be on at a given time but it happens so fast you will think multiple LEDs are on.

Imagine a grid of 8 horizontal wires and 8 vertical wires. The LEDs are wire at the intersection of the grid wires. (The grid wires can be as long as you wish so you can create any physical layout.)

At any given time only one of 8 lines is a source (HIGH) and only one of the other 8 lines is a sink (LOW). Hence only one LED will be lit. You cycle through your pattern fast enough to light all the LEDs as desired.
 

MrChips

Joined Oct 2, 2009
19,383
If you want to make an LED message board, then you can make it 8x32 or 8x64 LEDs etc.

For this you will need one 8-bit port and one 5-bit or 6-bit port driving a 5-to-32 or 6-to-64 decoder.
 

Eric007

Joined Aug 5, 2011
1,152
If you want to make an LED message board, then you can make it 8x32 or 8x64 LEDs etc.

For this you will need one 8-bit port and one 5-bit or 6-bit port driving a 5-to-32 or 6-to-64 decoder.
I will definately discuss something like this in near future when I have time...
Btw I like learning how to do stuffs...I'm always on when it comes to MCU...
 

MMcLaren

Joined Feb 14, 2010
842
At any given time only one of 8 lines is a source (HIGH) and only one of the other 8 lines is a sink (LOW). Hence only one LED will be lit. You cycle through your pattern fast enough to light all the LEDs as desired.
May I ask what kind of brightness you might expect from the 1/64th duty cycle method you're describing? Is that 25 ma "peak" current (if you're lucky) divided by 64 = 0.78 ma "average" current per LED?
 
Last edited:

MMcLaren

Joined Feb 14, 2010
842
If you want to make an LED message board, then you can make it 8x32 or 8x64 LEDs etc.

For this you will need one 8-bit port and one 5-bit or 6-bit port driving a 5-to-32 or 6-to-64 decoder.
Some other multiplexing methods might allow for relatively high performance (higher duty cycle and refresh rate, better brightness, fade-to-black PWM brightness control, etc.) with as little as eight, nine, or ten I/O pins.

 

Attachments

Last edited:

Thread Starter

armyman_talha

Joined Jan 16, 2012
3
There are a couple of ways about doing this.

1. Use shift registers. (You may only need to use 3-4 pins with this this method is a bit slower then others.)

2. LED Driver (They make millions just look at the datasheets! D: )

3. Multiplexing. (It's the brute force approach the method I think your thinking)
http://www.youtube.com/watch?v=lZyc6ulpkyM
Thanks man , Thank you all guys for help
 

Eric007

Joined Aug 5, 2011
1,152
Some other multiplexing methods might allow for relatively high performance (higher duty cycle and refresh rate, better brightness, fade-to-black PWM brightness control, etc.) with as little as eight, nine, or ten I/O pins.

MMclaren...I love that! We gon discuss that later...I must do one of these when I have time...
 
Top