Skip to content

Commit 9eb0b7c

Browse files
committed
lpc175x bugfix setup main pll
1 parent 557c703 commit 9eb0b7c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

targets/core/nxp/lpc175x/system.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,11 +219,11 @@ namespace klib::core::lpc175x::io::system {
219219
static_assert(PreDivider > 0, "Invalid pre-divider");
220220

221221
// calculate the fcco frequency using the oscilator and multiplier
222-
constexpr static uint32_t partial_freq = (Freq * 2 * Multiplier) / klib::exp2(static_cast<uint32_t>(PreDivider));
222+
constexpr static uint32_t partial_freq = (Freq * 2 * Multiplier) / klib::exp2(static_cast<uint32_t>(PreDivider - 1));
223223

224224
static_assert(
225-
(Multiplier == 1) || (partial_freq >= 156'000'000 && partial_freq <= 320'000'000),
226-
"Invalid Fcco output. PLL frequency needs to be between 156 and 320mhz"
225+
(Multiplier == 1) || (partial_freq >= 275'000'000 && partial_freq <= 550'000'000),
226+
"Invalid Fcco output. PLL frequency needs to be between 275 and 550mhz"
227227
);
228228

229229
// calculate the final frequency

0 commit comments

Comments
 (0)