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

atsamd21: initial implementation usign TC4/5 #994

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

maximeborges
Copy link

@maximeborges maximeborges commented Nov 11, 2024

Initial implementation of a monotonic timer using half-period counting with TC4/TC5.

Tested on a custom device using an ATSAMD21G16B.

@maximeborges maximeborges marked this pull request as ready for review November 11, 2024 10:16
@Sympatron
Copy link
Contributor

Does this implementation run the timer at 48MHz? If so, why not prescale it to 1MHz? 1µs resolution is plenty for almost any use case and it will generate less overflows and allows for greater intervals to be usable.

@maximeborges
Copy link
Author

Does this implementation run the timer at 48MHz? If so, why not prescale it to 1MHz? 1µs resolution is plenty for almost any use case and it will generate less overflows and allows for greater intervals to be usable.

As a first step for simplicity, since there are currently no RTIC v2 monotonic implementation for the SAMD family (now the RTC implementation seems to be ready to use also).
I would definitely accept PR to add support for other chips in the family to improve this one. I'm a bit constrained by time until the end of the month to polish things myself here, but could help other initiatives.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants