Use your own software PWM
Hi,
Darrel once made a multi output soft PWM routine which is interrupt based and works as intended from a PWM signal. Search the forum....
I did a software PWM for a UPS but it is primarily in assembly.
The concept is pretty simple.- On every tick increment a counter with it.
- Match with your PWM value sets or resets the output.
- Counter overflow, sets or resets the output.
Would run in the background
Or better though select a chip with hardware PWM.
From the PBP manual
Quote:
f you want continuous PWM output and the PICmicro MCU has PWM hardware, HPWM may be used instead of PWM.
Pin is made an output just prior to pulse generation and reverts to an input after generation stops. The PWM output on a pin looks like so much garbage, not a beautiful series of square waves. A filter of some sort is necessary to turn the signal into something useful. An RC circuit can be used as a simple D/A converter:
It is better to handle the LEDs by current since the brightness (lux) is a function of the current through the chip. It is pretty easy to kill LUMILEDS with overvoltage causing current overshoots.
Good Luck