Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
LinkBack Thread Tools Display Modes
Old 5th December 2004, 12:29 PM   (permalink)
Default PIC power supply for LEDs

hi!

i connected 16 LEDs to the ports B and D of a PIC18F458 and switch them on and off with self-programmed PWM. the problem is that it seems that the two ports don't supply the same current (or voltage) for the LEDs. does anybody know hot that is so or how to solve this problem?
thanks!
i2c2k is offline  
Old 5th December 2004, 12:40 PM   (permalink)
Default Re: PIC power supply for LEDs

Quote:
Originally Posted by i2c2k
hi!

i connected 16 LEDs to the ports B and D of a PIC18F458 and switch them on and off with self-programmed PWM. the problem is that it seems that the two ports don't supply the same current (or voltage) for the LEDs. does anybody know hot that is so or how to solve this problem?
thanks!
How are the LED's wired?, and what value current limiting resistors are you using?.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is online now  
Old 5th December 2004, 03:20 PM   (permalink)
Default

the leds are wired following:
port-pin ... led-anode ... led-cathode ... resistor-net ... GND
i used 330R resistors. did that help you?
i2c2k is offline  
Old 5th December 2004, 03:31 PM   (permalink)
Default

Quote:
Originally Posted by i2c2k
the leds are wired following:
port-pin ... led-anode ... led-cathode ... resistor-net ... GND
i used 330R resistors. did that help you?
Presumably you used one 330 ohm per LED?. This gives about 10mA current per LED, PIC specs are usually about 30mA maximum per I/O pin, so you could have three off each I/O pin. However, the device also has a maximum current for the entire device, 16 LED's at 10mA is 160mA, which (without checking) I'm pretty sure is well over this maximum limit.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is online now  
Old 5th December 2004, 04:17 PM   (permalink)
Default

You can use transistor or IC like ULN2003 to drive LEDs, it will draws current from the power supply directly, instead of PIC.
StupidDum is offline  
Old 5th December 2004, 06:28 PM   (permalink)
Default

well, using the ULN2003 would solve my problem but i have limited space for my project.
when i connect only 1 led on a port-d-pin it doesn't illuminate with more bightness. so there might be a problem somewhere else maybe.
i2c2k is offline  
Old 5th December 2004, 06:35 PM   (permalink)
Default

Quote:
Originally Posted by i2c2k
well, using the ULN2003 would solve my problem but i have limited space for my project.
when i connect only 1 led on a port-d-pin it doesn't illuminate with more bightness. so there might be a problem somewhere else maybe.
Perhaps you ought to post a circuit of what you're doing, so we can see exactly what's going on?.

Have you had a scope on the LED's, obviously with a lower PWM they will be less bright, so perhaps they are getting less than you thought?.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is online now  
Old 6th December 2004, 02:52 AM   (permalink)
Default

Try to increase your pulse width.
StupidDum is offline  
Old 6th December 2004, 10:32 PM   (permalink)
Default

the pulsewidth is not linked up with the problem because the led on port D doesn't glow properly when it's just switched on.
i think you can easily imagine what connections i've made: power supply, crystal, port b and d connected to LEDs. it's a straightforward thing.
besides, PWM doesn't work this way. the shortest pulse width is too long for proper operation unfortunately so i can forget it all.
does anybody know another mthod to control the brightness (at least in two brightness-steps) of each of 16 LEDs without consuming too much space?
i2c2k is offline  
Old 7th December 2004, 07:12 AM   (permalink)
Default

Quote:
Originally Posted by i2c2k
besides, PWM doesn't work this way. the shortest pulse width is too long for proper operation unfortunately so i can forget it all.
does anybody know another mthod to control the brightness (at least in two brightness-steps) of each of 16 LEDs without consuming too much space?
There's no better way, PWM is simple and cheap to do, and works perfectly.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is online now  
Reply

Bookmarks

Thread Tools
Display Modes





All times are GMT. The time now is 04:43 PM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

eXTReMe Tracker