How to control duty cycle precision? #3
-
The RP2040 allows 16 bit precision for PWM. How do I control the PWM precision with this library? Specifically, I need to get 16 bit duty cycle precision. Can you explain? The API calls seem to take a float for duty cycle, but no way to specify the precision. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Currently, the Arduino rp2040-related mbed cores (mbed_nano, mbed_rp2040) don't provide a way to specify the resolution, and I believe, as common sense, they will use the best 16-bit resolution. The DC is using You can reduce, IMO not what you'd like, the precision by using fake mapping such as
|
Beta Was this translation helpful? Give feedback.
Currently, the Arduino rp2040-related mbed cores (mbed_nano, mbed_rp2040) don't provide a way to specify the resolution, and I believe, as common sense, they will use the best 16-bit resolution.
The DC is using
float
to provide the better precision.You can reduce, IMO not what you'd like, the precision by using fake mapping such as
analogWrite()
by