Crystals on Arduino DUE: Necessary?

975 views
Skip to first unread message

Tyler

unread,
Mar 20, 2014, 5:14:43 PM3/20/14
to devel...@arduino.cc
Hi!

I'm wondering what the purpose is of these crystals on the Arduino DUE:


CRYSTAL 12MHZ 12PF SMD 1 7V-12.000MAAE-T

CRYSTAL 32.768KHZ 9PF SMD 1 CM315D32768DZCT


Doesn't the SAM3X have internal oscillators? Are these only for the ATMega16u that programs it, or are they used for something else? If I remove them along with the ATMega16u, will the SAM3X still work properly? Or is there any code that depends on a 12Mhz or 32Mhz clock or something?

Thanks!

Tyler

Angus Gratton

unread,
Mar 22, 2014, 8:16:28 PM3/22/14
to Tyler, devel...@arduino.cc
On Thu, Mar 20, 2014 at 02:14:43PM -0700, Tyler wrote:
> I'm wondering what the purpose is of these crystals on the Arduino
> DUE:
>
> Doesn't the SAM3X have internal oscillators? Are these only for the
> ATMega16u that programs it, or are they used for something else? If
> I remove them along with the ATMega16u, will the SAM3X still work
> properly? Or is there any code that depends on a 12Mhz or 32Mhz
> clock or something?<br>

Hi Tyler,

The ATmega16u has a separate 16MHz crystal associated with it.

The 12MHz crystal is used as the main clock source for the
ATSAM3X. You're correct the the SAM3X can run off internal clock
sources. The internal clock source is less accurate and stable and may
preclude some features, for example USB support won't work from the
internal RC/PLL combination. You'll have to consult the data sheet for
exact details.

If you removed the 12MHz crystal then the standard Due core library
would no longer work with your board, as it sets this for the clock
source. You'd need a modified core.

32.768kHz crystals are used as an accurate slow clock source (SLCK)
for low power modes usually. I don't actually know if or where this is
used or configured in the Due core.

- Angus

Tyler

unread,
Mar 23, 2014, 5:34:39 PM3/23/14
to Angus Gratton, devel...@arduino.cc
Thank you all for the information!

Doesn't seem that there's any calls to pmc_switch_sclk_to_32kxtal() in
the Arduino core, so I'm wondering if the 32.768kHz crystal is even
being used at the moment. I might try removing it as an experiment and
let you know how it turns out.

Thanks!

Tyler

Tyler

unread,
Jun 9, 2014, 3:21:03 AM6/9/14
to devel...@arduino.cc
Finally following up on this in case anyone's interested:

I removed the 32.768kHz crystal from the Arduino Due board, and it still
works great! I guess there's no code that depends on the RTC clock, that
I'm using at least.

-Tyler

On 3/22/14 5:16 PM, Angus Gratton wrote:

Silver

unread,
May 25, 2015, 6:11:46 AM5/25/15
to devel...@arduino.cc, phrea...@gmail.com
Hey Angus,

Please do you know how I can use the Arduino Due at 84 MHz? this what was written in board features. thank you in advance.

AndisH

unread,
Jun 26, 2015, 8:25:51 AM6/26/15
to devel...@arduino.cc, ty...@odbol.com
Hi !
For me, I'd want the quarz, because I want to synchronize watches across multiple arduinos and to my nas etc..
Just switch clock sources from the internal to quartz for the 32kHz clock source, and your are done. Only after such a switchover you will recognize if the quarz is there, of course. Since I have not found many boards that have the quartz soldered in, it may well be a cool strategy to implement a check upon setting up if the external quartz is there, e.g. by temporarily useing a timer with the main clock source to determine the frequency of the 32kHz internal or external signal. When you can't measure a signal (0 pulses), switch back to internal 32kHz signal. After doing these checks it is 1 line of code to modify the RTC calibration to have low error for the current conditions like temperature and core voltage. But the library would have to repeat this, to be stable over some days, using up valuable timer resources.

Bottom line is: since so many boards don't have it, it lets us draw the conclusion that no one hat low-power applications in mind, that the sam3x is well capaple of.a
Still I will try to solder some quartz in.

Low drift is always preferred. Quatz has 20ppm, so 20sec after 20*10^6 sec. passed max. error. Nice.
It uses very low power, still, but this means: put in just the right components, otherwise it may not resonate.
So far I only read hints as to how to calculate the correct capacitance of quarz and the 2 capacitors to ground.

Intermittent question:
Couldn't you just send it to me ;)) ? 
Really, I was kind a disappointed that my sanguino Due china clone has neither 1.27mm Pin headers for JTAG debugging, nor the real time clock "populated", emptyness on board!. And some 10kOhm between Pin18 ATmega16u2 output and main reset line, doing very instable reset. Soldered a 1kOhm on top, fine now.

So now it takes me quite some time to understand that I probably can _not_ just rip some 32kHz quarz from the next peice of electronic junk like old motherboard.
You have to adapt the capacitors to ground according to
on page 11:
C_L_ex32 = 2 * ( C_crystal - C_pcb - C_para_in_µC )

Thanks to the pdf with DUE circuitry we now, that C_L_ext32 = 22pF.
Right now after a lot of googling I thing that 9pF is the capacitance of the quartz one should use.

Since C_para in datasheet is given with 1,4pF, 
22/2 - 1,4 - 9 = 0.6pF is the value that the designers of the PCB assumed for the PCB stripes to the quartz. I think this value is assumed a bit low, but well. If it is not working, I will have to buy the 12pF version of the quartz.



So I have found an affordable source at some electronic distributor for hobbyists that sends out in small numbers in germany:
Data is 
Article-Nr.:V705871
manufacturer-Nr.:CM7V-T1A32.768kHz9pF+/-20ppmTAQC
EAN.:2050001862013


Datasheet of quarz is


I have some problems getting affordable 22pF 0402 capacitors, either 3EUR _per piece_ or 8EUR per 1000. Both is not what I want. 37EUR for kit of 3500 will be my way if I intend to fiddle araount, with shaking hands an pincer and soldering iron, freshly sharpened tip ;) 
(SMD 0402: 1 x 0,5 x 0,4 mm ^3 !!! : Dual USB Microscope is on the wish list, X-Mas perhaps... This displayed on a smartphone, hanging in a 3D cardbox in front of my eyes. Kinda cyborg, but could be cool and affordable.)

Steady hands and a good soldering iron

Andi

Am Montag, 9. Juni 2014 09:21:03 UTC+2 schrieb Tyler F:
Finally following up on this in case anyone's interested:

I removed the 32.768kHz crystal from the Arduino Due board ...
Reply all
Reply to author
Forward
0 new messages