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

Unconfigured Clock #47

Open
spencerdento opened this issue May 15, 2021 · 1 comment
Open

Unconfigured Clock #47

spencerdento opened this issue May 15, 2021 · 1 comment

Comments

@spencerdento
Copy link

The clock's default configuration results in the delay function lasting twice as long as specified.

https://gist.github.com/9names/ab435db6bdf9056cd285c2710825ae5f
With configuration the led blinks the specified amount of time.
Commenting out lines 14-17 makes the led blink for what seems 2x the amount of time specified.

@9names
Copy link
Contributor

9names commented May 16, 2021

This is not limited to using unconfigured clocks.
Here's a few configurations I tested

Correct delay:
Using external crystal and PLL, 80/40/20 mhz work fine.
While using internal oscillator with Divider::_2 and above (tested up to Divider::_4)
Incorrect delay:
Using internal oscillator and setting PLL to 80mhz (4x delay)
While using internal oscillator with Divider::_1 (2x delay)

I'm sure there's more permutations where delay does not do what you expect.

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

No branches or pull requests

2 participants