Pages: [1]   Go Down
Author Topic: Suggestion: Make analogwrite compatible with 8,9,10-bits PWM  (Read 1166 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 16
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.




Logged

SF Bay Area (USA)
Online Online
Tesla Member
***
Karma: 124
Posts: 6647
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: [1]   Go Up
Jump to: