PWM frequency library

runnerup:
I was able to reproduce the frequency errors for timer 2 and timer 1 (55555 when set to 20000 and 31620 and 15.7K) in Atmel Studio. Sounds like a truncation issue. I was not able to reproduce the resolution errors. I ran the code test code on my Uno and Atmel Studio it looks clean.

I might have something tomorrow afternoon (east coast USA time) for the frequency problem, I will keep looking into the resolution problem.

Thanks, yeah not sure what is going on with the resolution reporting. I'll keep messing with it.

I did find a nice little free logic analyzer that hooks up to an arduino to test this stuff out. I confirmed that I'm seeing 2kHz on Timer1(Pin 10), and 55.556kHz on Timer2(Pin 3). http://i.imgur.com/aRGS8.png

If anyone comes across this and wants to check their PWM signals out, try this: http://letsmakerobots.com/node/31422 . I'm running it no problems with my Mega, but needed to use version 0.9.5 of the analyzer for it to work with the Arduino plugin.