Go Down

Topic: Suggestion: Make analogwrite compatible with 8,9,10-bits PWM (Read 1 time) previous topic - next topic

lampmaker

I stumbled upon a problem when I switched to IDE 0022:

http://arduino.cc/forum/index.php/topic,55289.msg396321.html

analogWrite is now incompatible with 9 or 10-bits PWM.   

suggestion is to implement multiple PWM modes (higher bit resolution, different prescalers, perhaps even different PWM modes -fast vs phase correct) in the Arduino code.   
Default settings could be what it is today, but it shouldn't be too hard to implement a few switches for advanced users.





westfw

Quote
analogWrite is now incompatible with 9 or 10-bits PWM.   

Are you on a MEGA?  The normal arduino only has one 16-bit timer; I don't see how the 8 bit timers are supposed to support 9 or 10bit PWM.

In any case, changing timer modes and expecting the predefined functions that use those timers to continue to operate correctly seems ... overly optimistic.

Go Up