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.
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…
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: