I use dual PWM on the 16F874,16C77 and 16C74 basically the initialization is pretty similar to what you have below, except the following comments My initialization is as follows, CCP1CON = 0x00; CCP2CON = 0x00; CCP1CON = 0b00001100; CCP2CON = 0b00001100; T1CON = 0b00000101; T2CON = 0b01111110; // timer 2 pre/post scaler PR2 = 0xff; // slowest possible pwm freq.. TMR2 = 0x00; Actually driving the pwm outputs is done as follows. void SetPWM2 ( unsigned int w) { CCP2Y = w & 0x01; CCP2X = w & 0x02; CCP2RL= w>>2; } void SetPWM1 ( unsigned int w) { CCP1Y = w & 0x01; CCP1X = w & 0x02; CCP1RL= w>>2; } Hope this helps. >HI All, I am having problems with the following snippet - it sets up the >PWM1 output ok >but I get nothing from the second pwm output. I have even resorted to a chip >swap to check the controller. Adding a BSF to assert the pin works, but the >pwm does not. >any advice gratefully received >thanks >rob symmans > > > > CALL INIT_PORTS > > MOVLW 0XFF ; 00 --> W > BSF STATUS, RP0 ; SELECT BANK 1 > MOVWF PR2 ; LOAD PR2 WITH PERIOD INFO > ; AT 20MHZ PR2=FF GIVES A >1.22KHZ > ; AT 4MHZ PR2=FF GIVES A >3.906KHZ > BCF STATUS, RP0 ; SELECT BANK 0 > MOVLW 0X80 ; LOAD W WITH 0X80 > MOVWF CCPR1L ; DUTY CYCLE IS ~50% OF PWM 1 PERIOD > MOVWF CCPR2L ; DUTY CYCLE IS ~50% OF PWM 2 PERIOD > BSF T2CON, T2CKPS1 ; SET THE TMR2 PRESCALE VALUE > BSF T2CON, T2CKPS0 ; SET THE TMR2 PRESCALE VALUE > BSF T2CON, TMR2ON ; ENABLE TIMER2 > MOVLW 0X0F ; > MOVWF CCP1CON ; SET LOW TWO BITS OF PWM 1 AND TURN IT ON > MOVWF CCP2CON ; SET LOW TWO BITS OF PWM 2 AND TURN IT ON > ; PWM HAS 10-BITS OF >RESOLUTION > >HERE GOTO HERE > >INIT_PORTS > MOVLW B'00000000' > MOVWF TRISC > RETURN > >-- >http://www.piclist.com hint: The list server can filter out subtopics >(like ads or off topics) for you. See http://www.piclist.com/#topics Ray Gardiner ray@dsp.com.au mail from: dsp systems -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.