From 9f13512c0327a050d9f2710c476ec93d88c51079 Mon Sep 17 00:00:00 2001 From: ayabusa Date: Fri, 19 Apr 2024 11:39:52 +0200 Subject: [PATCH] added some thing for the clock (see TODO)(broken) --- numworks_port/src/Laplace/clock.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/numworks_port/src/Laplace/clock.c b/numworks_port/src/Laplace/clock.c index 0ad6416..7027ead 100644 --- a/numworks_port/src/Laplace/clock.c +++ b/numworks_port/src/Laplace/clock.c @@ -24,6 +24,17 @@ void init_clock(){ * SSCGEN = 1 */ RCC->SSCGR = 0b10000000000000110010000011111010; + // clear PLL_M, PLL_N ,PLL_Q and PLLSRC in PLLCFGR + RCC->PLLCFGR &= ~(0b00001111010000000111111111111111); + // Set the specified value to PLLCFGR + /* PLL_M = 8 = 0b1000 + * PLL_N = 384 = 0b110000000 + * PLL_Q = 8 = 0b1000 + * PLL_SRC = HSE = 1 */ + RCC->PLLCFGR |= 0b00001000010000000110000000001000; + + // Now we can enable PLL + RCC->CR |= RCC_CR_PLLON; } /* OLD