HPWM uses the *hardware* PWM module. It will not work on RB3. DEFINE HPWM2_TIMER 2 DEFINE CCP1_REG PORTC DEFINE CCP1_BIT 2 ' RC2/CCP1 DEFINE HPWM1_TIMER 2 DEFINE CCP2_REG PORTC DEFINE CCP_BIT 1 ' RC1/CCP2 TRISC.1=0 TRISC.2=0 CCP1CON = %00001100 'PWM mode CCP2CON = %00001100 'PWM mode HPWM 1,55,2000 ' RC2/CCP1 = 2kHz @ 50% duty HPWM 2,127,2000 ' RC1/CCP2 = 2kHz @ 21% duty ^_____ change this value to adjust duty cycles -Bruce http://www.rentron.com > >>Show how you've set up the CCPxCON and CCPRx registers. > > > Using Pic Basic Pro el crappo.... > > DEFINE HPWM2_TIMER 2 ' timer 2 select > DEFINE CCP1_REG PORTC > DEFINE CCP1_BIT 2 > > DEFINE HPWM1_TIMER 2 > DEFINE CCP2_REG PORTB > DEFINE CCP_BIT 3 > > > and initialization registers > > CCP1CON = %00001100 'PWM mode > CCP2CON = %00001100 'PWM mode > > __________________________________________________ > the following applies to change the duty cycle and output pulse > > HPWM 1,255,2000 > > Jason > > > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist