I would like to build a RGB led controller with a pic16f627. The problem is that it only has one PWM channel. It has 3 timers as well, Tmr0,Tmr1 and Tmr2.
Is there a way to use PWM on 2 other channels using software? The pic must also be able to accept serial data while PWM is on.
Is there another task you'd like to perform with the microcontroller? If not you have plenty of room to implement PWM in software. What C compiler do you use?
JeanTech, There are probably a few qualifiers for using software PWM.
(1) What is the desired frequency (PWM period)?
(2) How many duty cycle "steps" or "levels" do you require?
(3) What is the mcu clock speed (4, 8, 12, 16 MHz)?
(4) How many channels? Three for a single RGB LED?
Generating 256 duty cycle steps with a 1000-Hz period translates to a step time of around 4-usecs. This can be difficult to achieve in software on a 4-MHz PIC.
I have developed a method recently using BAM (Bit Angle Modulation) which could provide a 2-usec "step" size and a 1953-Hz (512-usec) period on a 4-MHz PIC but I haven't found an easy way to reproduce the driver in C. Sorry!
May I ask if you are related to the JeanTech that produces computer cases?