Skip to content

Commit

Permalink
[board] Use external crystal on SAMV71 Xplained Ultra board
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-durand committed Jan 2, 2023
1 parent 698c89d commit 0259ad2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/modm/board/samv71_xplained_ultra/board.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ using namespace modm::platform;

struct SystemClock
{
// 300MHz system clock generated by PLLA from internal Rc 12MHz clock
// 300 MHz system clock generated by PLLA from external 12 MHz crystal
static constexpr uint32_t PllAMult = 25;
static constexpr uint32_t Frequency = 300_MHz;
static constexpr uint32_t Mck = Frequency / 2; // 150 MHz max.
Expand All @@ -35,10 +35,11 @@ struct SystemClock
static bool inline
enable()
{
ClockGen::setFlashLatency<Frequency / 2>(); // Flash runs off MCK
ClockGen::setFlashLatency<Mck>();

ClockGen::enableMainExternalCrystal<12_MHz>(std::chrono::microseconds{1000});
ClockGen::selectMainClockSource(MainClockSource::External);

ClockGen::enableMainInternal(MainInternalFreq::Rc12Mhz);
ClockGen::selectMainClockSource(MainClockSource::Internal);
ClockGen::enablePllA<PllAMult>();
ClockGen::selectMasterClk<MasterClkSource::PLLA_CLK, MasterClkPrescaler::CLK_1, MasterClkDivider::Div2>();
ClockGen::updateCoreFrequency<Frequency>();
Expand Down

0 comments on commit 0259ad2

Please sign in to comment.