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

MAX32670 MXC_TMR_Init CTRL1_CLKSEL_A/B mismatch #823

Closed
jlj-ee opened this issue Dec 8, 2023 · 2 comments · Fixed by #829
Closed

MAX32670 MXC_TMR_Init CTRL1_CLKSEL_A/B mismatch #823

jlj-ee opened this issue Dec 8, 2023 · 2 comments · Fixed by #829
Assignees
Labels
bug Something isn't working

Comments

@jlj-ee
Copy link
Contributor

jlj-ee commented Dec 8, 2023

At least for the MAX32670, MXC_TMR_Init does not seem to properly configure the peripheral in 32 bit mode if the clock source is anything other than the default MXC_TMR_APB_CLK (MXC_TMR_CLK0).
Specifically, CTRL1_CLKSEL_B doe not get set to match CTRL1_CLKSEL_A, so if any clock source other than the default is used (e.g. IBRO/MXC_TMR_CLK2), CLKSEL_B will be different than A and 32 bit mode will not work properly unless the field is set manually after calling MXC_TMR_Init.

see e.g. MXC_TMR_RevB_Init

@Jake-Carter
Copy link
Contributor

Thanks for reporting @jlj-ee, just opened a PR with the fix. If you wouldn't mind testing it I'd greatly appreciate it!

@jlj-ee
Copy link
Contributor Author

jlj-ee commented Dec 15, 2023

Thanks for the heads up @Jake-Carter! The fix works well, at least for the particular scenario where it was initially encountered (IBRO clock source for PWM in 32b mode).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants