Jump to content

PWM for LEDs


*jOi~
 Share

Recommended Posts

friends,

i've been searching this forum far and wide, and whilst i can find a huge number of references to using PWM to control the brightness of LEDs, i haven't been able to find anything beyond "it's possible", and "i used it in my box".

i was curious to know if anyone had any sample code as to how it is done in the firmware/application, and what the potential number of PWM'd LEDs I could hope to get from one core.

originally i had planned to run a matrix, though after various experiments, im much more worried about maximum brightness, and the prospect of building a ridiculous number of DOUT modules is actually kind of endearing.

I would like to do ~200 LEDs, and am quite prepared to chain a number of core modules together to do this.

any thoughts?

trent

Link to comment
Share on other sites

if you want to address a huge number of LEDs have a look at this: 

http://www.midibox.org/forum/index.php?topic=5626.0

As far as PWM for dimming the LEDs is concerned, it depends if you want to dim each of them individually or if you just need to adjust overall brighness or RGB balance. I am currently working on a (hopefully) very stable solution for the latter problem, based on some additional hardware and a small modification of the DOUT board. Will post results if successful...

Cheers, Robert

Link to comment
Share on other sites

i have seen that page before, though somehow i always manage to lose the bookmark.. thanks for the redirection.

i am trying to dim each LED individually, so I would be incredibly interested in the solution you speak of - please keep me/us posted.

as an aside i'd just like to say how much of a kick i get out of having my questions answered by mr. Henke himself.. thanks

trent

Link to comment
Share on other sites

Hi Trent,

I'm not very sure about the things I'm going to say, because I haven't really worked with DOUTs so far:

MIOS does not support setting a PWM conveniently through a method (though I agree it would be very handy if this would exist - eg: [tt]MIOS_DOUT_PWMSet_Pin(percentage)[/tt] :)

Therefore (if you want to use MIOS), I think the trick is to use the ShiftRegister methods and set up a pattern with on/off values to create your pulses kinda "manually". I don't know if the PIC has an internal PWM function that could be accessed by asm; but I guess the approach there shouldn't be so different.

I hope I'm not talking rubbish, so if anyone knows better, feel free to add your comments.

Best,

Michael

Edit:

Ah, forgot what I really wanted to say: I recently stumbled upon a project using super bright "z power 3 watt LED" that is controllable by 5Vs. The Guy sais it's brighter than 12 normal super bright LEDs:

http://tobe.nimio.info/led_mood_lamp.php

Not sure though about the requirements of the Power Supply :-\

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...