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

[BearlyML'24, DSP'24] PLL Drivers #3

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

[BearlyML'24, DSP'24] PLL Drivers #3

wants to merge 2 commits into from

Conversation

AdamAngle
Copy link
Collaborator

@AdamAngle AdamAngle commented Dec 17, 2024

Haven't gotten around to making hal driver yet, but this at least can get others up and running with PLL fairly quickly. Working on getting the RCC overall driver over before merge.

Example usage:

CLOCK_SELECTOR->SEL = 0; // Switch away from previous run's PLL
PLL->PLLEN = 0; // Disable PLL
PLL->MDIV_RATIO = 1;
PLL->RATIO = 10;  // 500MHz (50MHz * 10)
PLL->FRACTION = 0;
PLL->ZDIV0_RATIO = 1;
PLL->ZDIV1_RATIO = 1;
PLL->LDO_ENABLE = 1;
PLL->PLLEN = 1; // Enable PLL with new settings
PLL->POWERGOOD_VNN = 1; // Specify power is, indeed, good
PLL->PLLFWEN_B = 1;
CLOCK_SELECTOR->SEL = 1; // Switch main clock mux to PLL

@AdamAngle AdamAngle marked this pull request as draft December 17, 2024 00:33
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.

1 participant