>I would like to have a freq of at least 1Mhz. Am I dreaming or is >this possible preferably without external components as there is no >room the existing board design. I think the fastest PWM is OSC/4, 50% duty cycle. I use it to drive charge pumps this way. Set the period to 00000000 10 and set the duty cycle reg to zero: ;this is for a 16C76, other chips with CCP are similar. ;------------------------------------------------------------------- ;Capture / Compare / Pwm 1 CONtrol bits: Set up as constant freq out: ;CCP1CON<7:6> are not implemented, leave at 0. CCP1CON<7:6> =00 ;Duty Cycle 1 Bit 1:Bit0 = 10 CCP1CON<5:4> =10 ;CCP1 Mode: PWM mode, CCP1M<3:0> = 11xx CCP1CON<3:0> = 1100 ;CCP1CON = 00101100b = H'2C' CCP1PWM EQU H'2C' ;to write to CCP1CON ;Init CCP1 to run at 50% duty cycle: ;TRIS RC2 to output BCF TRISC,2 ;let CCP1 drive pin 13 ;Timer 2 is running at Tosc / 4, prescaler 1:1 so LSB of PWM is osc. MOVLW 0 MOVWF PR2 ;Timer 2 period register BCF STATUS, RP0 ;bank 0 for control regs MOVLW 0 MOVWF CCPR1L ;PWM period MSB = 00000000 ;two Tosc high time MOVLW CCP1PWM ;PWM period = 00000000 10 MOVWF CCP1CON ------------ Barry King, KA1NLH Engineering Manager NRG Systems "Measuring the Wind's Energy" Hinesburg, Vermont, USA www.nrgsystems.com