Hello Srig,
Srig>>I am performing software pwm . the following works on multiple pins at
the same time doing software pwm.
For Duty = 0 to 999
For cycles = 0 to Cycle1
Portb = %00000000
Pauseus 999 - Duty
Portb = %00100000
Pauseus Duty
Next cycles
but what I was trying to do is make three separate pins turn on at the
same time but all three of them need to be on a different intensities.
for instance one has to be on at LED1 = (20%)
LED2 = (30%)
LED3 = (80%)
here is what I have so far.. not sure if it is working but just need
someone to verify that this will work. I was hoping that you would do
this for me.
<<
To make 3 separate pins to turn on at the same time with different intensities, you must use a PIC chip that has three PWM's built into the chip. That I know of, there is only one PIC chip out there that has 3 PWM's. (But could be more)
The software PWM will not work. It is only good for one pin at a time. You will need the chip that has 3 hardware PWM's.
Then your code will be something like the following:
x=256*.2
y=256*.3
z=256*.8
HPWM 1,x,2000
HPWM 2,y,2000
HPWM 3,z,2000
Dwayne
Last edited by Dwayne; - 6th October 2004 at 19:21.
Ability to Fly:
Hurling yourself towards the ground, and missing.
Engineers that Contribute to flying:
Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute
Pilots that are Flying:
Those who know their limitations, and respect the green side of the grass...
Bookmarks