Skip to content

Commit af0263a

Browse files
committed
More accurate approximation for multiplication factor of PLL to make 48Mhz.
Fix #223
1 parent e6868b2 commit af0263a

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
SAMD CORE 1.6.17
2+
3+
* More accurate approximation for multiplication factor of PLL to make 48Mhz. Thanks @joverbee
4+
15
SAMD CORE 1.6.16 2017.08.23
26

37
* Is now possible to use PWM on D7 (though it can't be used with PWM on D12 at the same time). Thanks @Adminius

cores/arduino/startup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ void SystemInit( void )
148148

149149
SYSCTRL->DFLLMUL.reg = SYSCTRL_DFLLMUL_CSTEP( 31 ) | // Coarse step is 31, half of the max value
150150
SYSCTRL_DFLLMUL_FSTEP( 511 ) | // Fine step is 511, half of the max value
151-
SYSCTRL_DFLLMUL_MUL( (VARIANT_MCK/VARIANT_MAINOSC) ) ; // External 32KHz is the reference
151+
SYSCTRL_DFLLMUL_MUL( (VARIANT_MCK + VARIANT_MAINOSC/2) / VARIANT_MAINOSC ) ; // External 32KHz is the reference
152152

153153
while ( (SYSCTRL->PCLKSR.reg & SYSCTRL_PCLKSR_DFLLRDY) == 0 )
154154
{

0 commit comments

Comments
 (0)