I'm Using a PIC16F737 and want to use the three pwm ports on it:

But i get onlu CCP1 and 3 Working, does anybody have a idea?

I have the following code:

'************************************************* ***************
'* Name : UNTITLED.BAS *
'* Author : [select VIEW...EDITOR OPTIONS] *
'* Notice : Copyright (c) 2006 [select VIEW...EDITOR OPTIONS] *
'* : All Rights Reserved *
'* Date : 9/18/2006 *
'* Version : 1.0 *
'* Notes : *
'* : *
'************************************************* ***************
@ DEVICE HS_OSC

Include "modedefs.bas"

DEFINE OSC 20 ' Gebruikte kristal is 20MHz

DEFINE CCP1_REG PORTC 'Hpwm 1 pin port
DEFINE CCP1_BIT 2 'Hpwm 1 pin bit
DEFINE CCP2_REG PORTB 'Hpwm 2 pin port
DEFINE CCP2_BIT 3 'Hpwm 2 pin bit
DEFINE CCP3_REG PORTB 'Hpwm 3 pin port
DEFINE CCP3_BIT 5 'Hpwm 3 pin bit

Duty1 VAR WORD ' Channel #1
Duty2 VAR WORD ' #2
Duty3 VAR WORD ' #3

Rval CON 256
Gval CON 128
Bval CON 64


'Rval var word
'Gval var word
'Bval var word

' Set CCPx pins to outputs
TRISC.2=0 ' CCP1 output
TRISB.3=0 ' CCP2 output (could also be assigned to RB3)
TRISB.5=0 ' CCP3 output
trisa=%00000111

' Set CCP modules to PWM mode
CCP1CON = %00001100 ' Mode select = PWM
CCP2CON = %00001100 ' Mode select = PWM
CCP3CON = %00001100 ' Mode select = PWM

' Set period up for 1.22kHz PWM freq
PR2 = $7F

' Set TMR2 up for 1:16 prescale & turn it on
T2CON = %00000110 ' TMR2 ON 1:16 prescale

mainloop:


Duty1 = Bval *2
CCP1CON.4 = Duty1.0 ' Setup 10-bit duty cycle as
CCP1CON.5 = Duty1.1 ' a 10-bit word
CCPR1L = Duty1 >> 2

Duty2 = Rval *2
CCP2CON.4 = Duty2.0
CCP2CON.5 = Duty2.1
CCPR2L = Duty2 >> 2

Duty3 = Gval *2
CCP3CON.4 = Duty3.0
CCP3CON.5 = Duty3.1
CCPR3L = Duty3 >> 2

Goto mainloop
End