Skip to content

Commit 0259ad2

Browse files
committed
[board] Use external crystal on SAMV71 Xplained Ultra board
1 parent 698c89d commit 0259ad2

File tree

1 file changed

+5
-4
lines changed
  • src/modm/board/samv71_xplained_ultra

1 file changed

+5
-4
lines changed

src/modm/board/samv71_xplained_ultra/board.hpp

+5-4
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ using namespace modm::platform;
2525

2626
struct SystemClock
2727
{
28-
// 300MHz system clock generated by PLLA from internal Rc 12MHz clock
28+
// 300 MHz system clock generated by PLLA from external 12 MHz crystal
2929
static constexpr uint32_t PllAMult = 25;
3030
static constexpr uint32_t Frequency = 300_MHz;
3131
static constexpr uint32_t Mck = Frequency / 2; // 150 MHz max.
@@ -35,10 +35,11 @@ struct SystemClock
3535
static bool inline
3636
enable()
3737
{
38-
ClockGen::setFlashLatency<Frequency / 2>(); // Flash runs off MCK
38+
ClockGen::setFlashLatency<Mck>();
39+
40+
ClockGen::enableMainExternalCrystal<12_MHz>(std::chrono::microseconds{1000});
41+
ClockGen::selectMainClockSource(MainClockSource::External);
3942

40-
ClockGen::enableMainInternal(MainInternalFreq::Rc12Mhz);
41-
ClockGen::selectMainClockSource(MainClockSource::Internal);
4243
ClockGen::enablePllA<PllAMult>();
4344
ClockGen::selectMasterClk<MasterClkSource::PLLA_CLK, MasterClkPrescaler::CLK_1, MasterClkDivider::Div2>();
4445
ClockGen::updateCoreFrequency<Frequency>();

0 commit comments

Comments
 (0)