PDA

View Full Version : How many LEDs could a wood chuck light



AvionicsMaster1
- 12th November 2010, 23:01
I've got a 12f683 and want to run 16 LEDs off it. I want one LED to be on for about 2 seconds then move on to the next. What is the easiest and cheapest way to hook them up?

I'd swear I saw an article that the maximum number of LEDs one could hook to a PIC was defined by 2 raised to the number of pins available. That would mean a 12f683 is capable of controlling 64 LEDs (2 to the 6th).

Is that true?

mackrackit
- 12th November 2010, 23:28
Tip #2 should be what you need.
http://www.picbasic.co.uk/forum/content.php?r=218-Microchip-Tips-and-Tricks

Mike, K8LH
- 16th November 2010, 01:00
Adding column drivers to a Charlieplexed matrix allows lighting multiple LEDs in each column to increase duty cycle and brightness. If you're only going to light one LED at a time you can eliminate the column driver transistors.

With Charlieplexing you get N(N-1) outputs (N = number of pins)...

Regards, Mike

AvionicsMaster1
- 30th November 2010, 14:20
Using the circuit from Tip #2 with the LEDs on the ICSP pins I get a wrong chip selected error. On the 12f683 I have GP0 on pin 7 and GP1 on pin 6. Pin 4 is pulled high with a 500 ohm resistor. It seems the programmer is only picky about pin 7 being used.

Tip #2 should be what you need.
http://www.picbasic.co.uk/forum/content.php?r=218-Microchip-Tips-and-Tricks

How can I connect LEDs and the ICSP header on the same pins?

As usual, your thoughts are surely better than mine.

mackrackit
- 30th November 2010, 14:57
Sometimes a resistor in series from the programing pins to the application circuit works, sometimes diodes.
The sure fire way is to use a removable jumper to disconnect the programing pins from everything else while programing.

If you are using the PicKit2, the PicKit2 User Guide briefly mentions this.

El_AMPo
- 18th December 2010, 06:35
Remember that most 12Fs usually have an input only pin (mclr/gp3) but yes with charlieplexing and driving your leds at a higher current / lower pulse width should do the trick.

Anyway if you want more and more outputs, just use a 74HC595 connected to the 12F combined with shiftout command for an unlimited number of them if your timing allows them to refresh