adafruit / ArduinoCore-samd

114 stars 116 forks source link

SAMD21 Overclock #340

Closed dojyorin closed 1 year ago

dojyorin commented 1 year ago

I would love to see the small but powerful SAMD21 become even more powerful with overclocking. The SAMD51 was overclockable from 120MHz to 200MHz.

A quick survey of the SAMD21 shows that there is a DFLL that delivers 48MHz and a DPLL that can deliver up to 96MHz. So it looks like the SAMD21 CPU can run up to 96MHz (barring voltage and silicon limitations).

For example, is a clock source like the one in the figure below worth considering?

flowchart LR

OSC32K["Internal/External OSC\n32.768 kHz"]
DFLL["DFLL\n48 MHz"]
DPLL["DPLL\n48 ~ 96 MHz"]

GCLK0["GCLK0\nDIV: 1\n(48 ~ 96 MHz)"]
GCLK1["GCLK1\nDIV: 1\n(32.768 KHz)"]
GCLK4["GCLK4\nDIV: 48\n(1 MHz)"]
GCLK5["GCLK5\nDIV: 1\n(48 MHz)"]

CPU["CPU\n48 ~ 96 MHz"]
USB["USB\n48 MHz"]

OSC32K --> GCLK1 --> DFLL
DFLL --> GCLK4 & GCLK5
GCLK5 --> USB
GCLK4 --> DPLL --> GCLK0 --> CPU

ref: https://next-hack.com/index.php/2020/02/12/overclocking-an-arduino-zero-or-any-atsamd21