ATSAMD21G18A clock frequencies

Dear friends,

I would ask you. The microcontroller ATSAMD21G18A, I know that can works at 48MHz but, it needs an external oscillator? o it can works at 48MHz using internal oscillator?

Thanks for your time, friends.

The SAMD has several (complicated) oscillator options, and can run either with an external crystal, or an internal oscillator without a crystal. For example, the Adafruit "trinket m0" board runs without a crystal. An Arduino zero has a 12MHz crystal, and internal logic multiplies that by 4 to get 48MHz.

Hi @OSCARRAMIREZ

The SAMD21 generates it's 48MHz CPU main clock, by using its digital freqency locked loop (DFLL48M) to multiply up the frequency from various clock sources:

  1. A 0.4MHz to 32MHz crystal (XOSC) on port pins PA14 and PA15
  2. An external 32.768kHz crystal (XOSC32K) on port pins PA00 and PA01
  3. An internal 32.768kHz oscillator (OSC32K), or derived from the USB's 1kHz "Start Of Frame" SOF signal, if connected

Option 1 isn't used by any Arduino compatible boards that I've seen. Option 2 is common on larger boards. Option 3 is often used on smaller boards.

The external 32.768kHz crystal offers better accuracy and precision than the internal oscillator, which may affect projects that require some form of absolute timing, such as a Real Time Clock (RTC) measurement.

The SAMD21 also has an on-chip 8MHz internal oscillator (OSC8M), a 32.768kHz ultra low powered oscillator (OSCULP32K), plus a fractional 96MHz digital phase locked loop (FDPLL96M). The FDPLL96M can be used to run some of the on-chip timers at a higher frequency than the CPU.

Hi MartinL,

Thanks for your answer!.

I understand that if I connect an external crystal (option2) like a picture, the rest of process for to work at 48MHz is firmware, right?

One more time, thanks for your support.

Óscar R

Hi @OSCARRAMIREZ

Yes, that's right, the Arduino bootloader and sketch core code will automatically set-up the DFLL at 48MHz for you.

Actually, I used the same ABS07 crystal and 0805 22pF caps on my custom boards and they worked OK.

By the way, if you're creating a custom board for the SAMD21, it's worth looking at the "Schematic Checklist" at the back of the microcontroller's datasheet, (if you haven't already?).

Hi @MartinL thanks for your answer.

Great! if your had used the same crystal configuration, it will works fine!

Yes, I have checked Schematic checklist some days ago, that part it's ok for me.

Sorry, but I have more question.

I am looking for the easiest way for to burn bootloader and program sketches in the SAMD21G18A using Arduino IDE. Can you propose me some way for do it?

I have read some things about ATMEL ICE, but I wondering if is the easiest option for do it. I have to consider that this design will manufactured lot of units.

Thanks @MartinL

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.