PDA

View Full Version : DC LED Dimming on 3-5 channels using 16F676



financecatalyst
- 4th March 2011, 21:37
I need some help in making a program which can generate pwm on 3-5 pins. These pins will be connected to MOSFETS and they will in turn control a bunch of LEDs.

Is it possible to have a different duty cycle on each pin? I would create it in such a way that once PIC is powered up all 3 or 5 channels have different dutycycles and thus the bunch of LEDs glow at different intensities which keep changing in a loop.

I would like to achieve this with 16F676. I have 12V battery available which will be the power source for the system.

Any ideas?

Thanks in advance

Darrel Taylor
- 4th March 2011, 22:56
Give this a try ...

MIBAM - (Mirror Imaged Bit Angle Modulation)
http://www.picbasic.co.uk/forum/showthread.php?t=10564

sayzer
- 5th March 2011, 07:21
Also, take a look at this one to get some ideas.


<font color="#000000">Begin:
<font color="#000080"><i>' Change these values as desired.
</i></font>RED = <font color="#FF0000">100 </font><font color="#000080"><i>' Red intensity
</i></font>GREEN = <font color="#FF0000">150 </font><font color="#000080"><i>' Green intensity
</i></font>BLUE = <font color="#FF0000">200 </font><font color="#000080"><i>' Blue intensity


' ===== Drive LEDs ===========
</i><b>PWM </b></font>RedPin,RED,<font color="#FF0000">1
</font><font color="#000080"><b>PWM </b></font>BluePin,BLUE,<font color="#FF0000">1
</font><font color="#000080"><b>PWM </b></font>GreenPin,GREEN,<font color="#FF0000">1


</font><font color="#000080"><b>GOTO </b></font>Begin