Skip to content
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

cpu/rpx0xx: add initial pwm support #20473

Merged
merged 3 commits into from
Mar 19, 2024
Merged

Conversation

dylad
Copy link
Member

@dylad dylad commented Mar 15, 2024

Contribution description

This PR adds an initial PWM peripheral driver for RP2040-based board.
PWM IP block is feed by the system clock (fixed) so it is not very flexible but it works as intended.
So far I've only add the LED pin as PWM as it is convenient to check with the osci command from tests/periph/pwm
However, I've also tested locally other pins to check the overall logic.

Testing procedure

Play with tests/periph/pwm on rpi-pico for instance.

Issues/PRs references

None.

@github-actions github-actions bot added Area: boards Area: Board ports Area: cpu Area: CPU/MCU ports Area: Kconfig Area: Kconfig integration labels Mar 15, 2024
@dylad
Copy link
Member Author

dylad commented Mar 15, 2024

With a logic analyzer attached and the following commands:

2024-03-15 16:27:48,435 # init 1 0 20000 100
2024-03-15 16:27:48,437 # The pwm frequency is set to 20161
set 1 0 50
2024-03-15 16:27:55,113 # set 1 0 50
> set 1 0 25
2024-03-15 16:29:35,330 # set 1 0 25
> set 1 0 95
2024-03-15 16:30:33,831 # set 1 0 95

Here are the results:
dc_50
dc_25
dc_95

Copy link
Contributor

@kfessel kfessel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reads good, test results provided

please squash your fixups

dylad added 3 commits March 18, 2024 21:04
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
@dylad dylad force-pushed the cpu/rpx0xx/pwm_support branch from 9092d9a to 8b84fc5 Compare March 18, 2024 20:06
@dylad
Copy link
Member Author

dylad commented Mar 18, 2024

Rebased and squashed.

@dylad dylad added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Mar 18, 2024
@riot-ci
Copy link

riot-ci commented Mar 18, 2024

Murdock results

✔️ PASSED

8b84fc5 boards/rpi-pico: add PWM support in Kconfig

Success Failures Total Runtime
10009 0 10009 07m:19s

Artifacts

Copy link
Contributor

@kfessel kfessel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trusting @dylad tests

@dylad dylad added this pull request to the merge queue Mar 19, 2024
Merged via the queue into RIOT-OS:master with commit 1c036e0 Mar 19, 2024
27 checks passed
@dylad
Copy link
Member Author

dylad commented Mar 19, 2024

Thanks for the review @kfessel !

@dylad dylad deleted the cpu/rpx0xx/pwm_support branch March 19, 2024 11:22
@MrKevinWeiss MrKevinWeiss added this to the Release 2024.04 milestone Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: boards Area: Board ports Area: cpu Area: CPU/MCU ports Area: Kconfig Area: Kconfig integration CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants