Is it possible to use a 32.768kHz square wave, such as the output from the DS3231 RTC, as an input for something like the SAMD21 microcontroller? I would rather not have to add a crystal to my design if I've already got a super accurate, temperature compensated and age compensated crystal built into my design.

My go-to idea is to disconnect the crystal output pin and connect the crystal input pin to the square-wave output of the RTC chip. Thoughts? I've only seen other questions about PICs.

  • \$\begingroup\$ It'll be slow, but I see no reason for it not to work. What does its datasheet/user guide say about external clocking? Does it give a low frequency limit? \$\endgroup\$
    – user16324
    Commented Oct 31, 2020 at 17:25
  • \$\begingroup\$ The chip has internal oscillators that go much faster, the 32.768kHz oscillator is just for accuracy checking - as far as I understand \$\endgroup\$ Commented Oct 31, 2020 at 17:28

1 Answer 1


Answered my own question in the datasheet! Looks like setting the XTALEN bit in the XOSC32K register of the SYSCTRL section to 0 solves the question:

Datasheet XTALEN table

Also from the datasheet:

The external clock or crystal oscillator is enabled by writing a one to the Enable bit (XOSC32K.ENABLE) in the 32kHz External Crystal Oscillator Control register. To enable the XOSC32K as a crystal oscillator, a one must be written to the XTAL Enable bit (XOSC32K.XTALEN). If XOSC32K.XTALEN is zero, external clock input will be enabled.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.