Hi,
The PWM Period register has 12 bits of resolution and the PWM period is defined as (PTPER+1) * Prescaler / (Fosc/4)
In your original code you have the prescaler set to 1:1 and you're setting PTPER to 65535 but again, only the low 12 bits are used which equals 4095. Plug that into the formula and you'll get 4096/2000000=0.002048. That's a PWM period of 2.048ms or a frequency of 488.28Hz.
/Henrik.
Bookmarks