Thanks a lot for the kind assistance: HPWM works very well.
I also follow the indicated links and I found this code:
TRISC.2 = 0 ' CCP1 (PortC.2 = Output)
PR2 = 25 ' Set PWM Period for approximately 38KHz
CCPR1L = 13 ' Set PWM Duty-Cycle to 50%
CCP1CON = %00001100 ' Mode select = PWM
T2CON = %00000100 ' Timer2 ON + 1:1 prescale
Question: Why I do have a frequency equivalent to 10 times 38 KHz ( about 384 KHz ! ) ?
I did declare osc= 40 Mhz too.
Thanks for any clarification,
regards,
Ambrogio
Bookmarks