-
Notifications
You must be signed in to change notification settings - Fork 7.6k
drivers: pwm: nrfx: Add option to glitch free 100% duty cycle #90781
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
danieldegrasse
merged 2 commits into
zephyrproject-rtos:main
from
nordic-krch:pwm_idleout
Jun 10, 2025
Merged
drivers: pwm: nrfx: Add option to glitch free 100% duty cycle #90781
danieldegrasse
merged 2 commits into
zephyrproject-rtos:main
from
nordic-krch:pwm_idleout
Jun 10, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fyi @mstasiaknordic |
The following west manifest projects have changed revision in this Pull Request:
✅ All manifest checks OK Note: This message is automatically posted and updated by the Manifest GitHub Action. |
mstasiaknordic
approved these changes
May 30, 2025
kl-cruz
previously approved these changes
Jun 2, 2025
anangl
previously approved these changes
Jun 3, 2025
|
Add property which indicates that PWM instance supports IDLEOUT feature. Add property to all instances that supports it. Signed-off-by: Krzysztof Chruściński <[email protected]>
IDLEOUT presence in PWM means that there are 3 sources from which PWM pin can be driven: - GPIO setting when PWM peripheral is disabled. - IDLEOUT setting when PWM is enabled. - PWM Sequence when it is in use. IDLEOUT setting cannot be changed after enabling PWM so it is configured to the initial state of the pin. It means that if duty cycle is 100%, GPIO output is set to 1 but initial pin state was 0 (IDLEOUT setting) there will be a glitch between disabling a PWM sequence and disabling a PWM peripheral. By default, PWM driver tries to disable PWM peripheral if all channels are 0% or 100% duty cycle to safe power. When IDLEOUT feature is present there will be a short glitch on channels with 100% duty cycle. In order to avoid that CONFIG_PWM_NRFX_NO_GLITCH_DUTY_100 option is added (enabled by default). When option is enabled 100% duty cycle is achieved by PWM sequence and not by driving a GPIO pin. It will consume more power in cases where all channels are 0% or 100% with at least one channel set to 100% duty cycle. Signed-off-by: Krzysztof Chruściński <[email protected]>
@anangl can you re-approve? hal_nordic was merged. |
nika-nordic
approved these changes
Jun 10, 2025
anangl
approved these changes
Jun 10, 2025
kl-cruz
approved these changes
Jun 10, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
IDLEOUT presence in PWM means that there are 3 sources from which PWM pin can be driven:
IDLEOUT setting cannot be changed after enabling PWM so it is configured to the initial state of the pin. It means that if duty cycle is 100% and pin is normal, GPIO output is set to 1 but initial pin state was 0 (IDLEOUT setting) there will be a glitch between disabling a PWM sequence and disabling a PWM peripheral.
By default, PWM driver tries to disable PWM peripheral if all channels are 0% or 100% duty cycle to safe power. When IDLEOUT feature is present there will be a short glitch on channels with 100% duty cycle.
In order to avoid that
CONFIG_PWM_NRFX_NO_GLITCH_DUTY_100
option is added (enabled by default). When option is enabled 100% duty cycle is achieved by PWM sequence and not by driving a GPIO pin. It will consume more power in cases where all channels are 0% or 100% with at least one channel set to 100% duty cycle.