PWM frequency library

runnerup:
Yay integer division!
...ehem

I found the bug, I will publish the patch tomorrow afternoon after I have more time to test it.
All 8 bit timers will be set to higher than expected frequencies when set to high frequencies (go figure). I haven't actually checked myself, but according to rothnic the threshold is somewhere between 15KHz and 16KHz.
Due to the nature of the this particular bug, it should not affect PWM duty, only frequency.
Again, I have no idea what is causing that bad resolution reading, my Mega and Uno have no trouble with it.

Sounds good.

Right now I have the 2kHz frequency working ok, but there is an issue with the duty cycle. This is on the 16bit Timer, so with it set at 2kHz it returns 4000 from the Timer1_GetTop call. But, if I do a pwmWrite(10, 2000), I get a Duty cycle of 81.6% in this logic analyzer. This makes me doubt the hardware a bit.

I guess in the end I can get it working with a little trial and error, worst case. Looks like pwmWrite(10, 5000) gets me pretty close to 50%.