Skip to content

fade_led sample doesn't work with pwm_nrfx driver #10037

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

Closed
JoeHut opened this issue Sep 17, 2018 · 4 comments
Closed

fade_led sample doesn't work with pwm_nrfx driver #10037

JoeHut opened this issue Sep 17, 2018 · 4 comments
Assignees
Labels
bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug

Comments

@JoeHut
Copy link
Contributor

JoeHut commented Sep 17, 2018

I tried to change the fade_led sample to support the pwm_nrfx driver introduced in v1.13. This results in a fail to set the pwm period.
Reason: The default in the pwm_nrfx driver for prescalers is 0, which means that a 16MHz clock is applied. The sample therefore sets a period of 320,000 cycles but the driver only supports max 32,768 cycles, so the clock has to be reduced to a frequency of 1MHz to make the sample work. This seems to be odd since the software based pwm driver supports 50us as period with a 16MHz clock.

My question basically is just, whether this is intended and the prescaler should be adjusted if support for the pwm_nrfx driver is added to the samples or if there is something wrong.

@nashif nashif added the bug The issue is a bug, or the PR is fixing a bug label Sep 17, 2018
@nashif nashif added the priority: medium Medium impact/importance bug label Sep 30, 2018
@nashif
Copy link
Member

nashif commented Jan 30, 2019

@carlescufi can you please assign?

@carlescufi
Copy link
Member

Added @pdunaj as well since we have similar functionality downstream

@anangl
Copy link
Member

anangl commented Feb 1, 2019

This 32,767 cycles limit is no longer present in the pwm_nrfx driver. Since commit 2d5ea10, the PWM prescaler is modified accordingly to find a fit for the requested period length, precisely this part of code does this.
I think this issue can be closed as resolved by #11726.

@anangl
Copy link
Member

anangl commented Feb 12, 2019

Fixed by #11726.

@anangl anangl closed this as completed Feb 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug
Projects
None yet
Development

No branches or pull requests

5 participants