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

Clock set feature to add #39

Open
zdjurisic opened this issue Apr 21, 2017 · 2 comments
Open

Clock set feature to add #39

zdjurisic opened this issue Apr 21, 2017 · 2 comments

Comments

@zdjurisic
Copy link

XMega is the first AVR that can set the clock at runtime, rather than burning a fuse. There should be a code (maybe in a form of a library?) that can set the source and the frequency of the clock. Let's discuss a proper way to do it within the scope of XMegaForArduino.

@bombasticbob
Copy link
Contributor

I've considered clock speed reduction code for power savings. problem is that it messes up a lot of things when you do that, from baud rates to PWM to the 'millis()' timer. Good idea, but I've pretty much decided that it's too much for a microcontroller. However, no problem doing an alternate 'core' that supports it, maybe.

basically anything that uses 'F_CPU' to determine the CPU frequency will be affected. And changing it means you have to go back and re-initialize things like serial baud rates while comms are still happening. So yeah, it's a complex thing.

@bombasticbob
Copy link
Contributor

one more thing, it's a good idea, so please don't take it wrong if it really can't be done (easily, without wasting a lot of code space for everything else, etc.).

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

No branches or pull requests

2 participants