> What is the correct formula for calculating the period value that goes into > the 16C65's PWM generator? This period value simply flips the output bit > value when the value matches TMR2, right? The data book seems out by a > factor of four, in that they forgot to include the "x 4" to get from the > external clock period to the instruction clock period, that latter of which > is the input to the PWM module. > -Ed V. Ed: The period of the PWM signal is defined by PR2 (8 bit) which sets (not flips) the output when it matches TMR2 (8 bit) which is only the 8 m.s.b. of the 10-bit time base of the PWM. The 2 l.s.b are given by the Q-clock or the prescaler, that's why it's not accurate to say that the instr. clock is the input of the PWM module. The duty-cycle is governed by the 10-bit duty cycle register, formed by CCPRxH concatenated with two bits taken from CCPxCON (the latter, unfortunately, being the l.s.b.) When it matches the time base, the output and the timer are reset. IMHO this could have been explained more clearly in Microchip's literature. Regards, Andres Djordjalian adjordj@aleph.fi.uba.ar