I'm using the power control module of a PIC18F4431 to control some Constant current sources for some high power leds. For these CCS devices a "1" = "off" so I though to myself why not use the complementary mode on the PWM module then on my even channels I'll get 1's and on the odds 0's. Wrote a little code to ramp the leds up and down but the even channels are staying at full power while the odds are ramping as expected. If i put it into independent mode all leds ramp together so it isn't something I've snafu'd on the ccs connections.

Here's the code, any idea where I'm going wrong ?

define OSC 20
Duty Var Word

PORTB = 0 ' clear port
TRISB = %11000000 ' PWM0,1,2,3,4,5 outputs

' set up PWM
DTCON = 0 ' 0 dead-time
PTCON0 = %00001000 ' 1:1 postscale, 1:16 prescale, free running mode
PTCON1 = %10000000 ' PWM time base is ON, counts up
PTPERL = $E8 '
PTPERH = $07 ' PTPER = $07E8
PWMCON0 = %01000011 ' PWM 0 to 5 outputs enabled , complementary
PWMCON1 = 1 ' updates enabled and overrides sync
OVDCOND = %11111111

RAMP:
For Duty = 2024 To 0 STEP-1 '
PDC0L = Duty.LowByte
PDC0H = Duty.HighByte
PDC1L = Duty.LowByte
PDC1H = Duty.HighByte
Pause 5
Next Duty

For Duty = 0 To 2024 '
PDC0L = Duty.LowByte
PDC0H = Duty.HighByte
PDC1L = Duty.LowByte
PDC1H = Duty.HighByte
Pause 5
Next Duty

GoTo RAMP

End

Thanks, Andrew