In general (and maybe this is impossible to answer "generally"), is it possible to supply an external clock source to a microprocessor that supports a directly-connected crystal (and a pair of small caps)?

Specifically, I'm looking at an ESP32, which supports a 32.768KHz crystal as a source for its internal RTC. Everything I've found references an actual crystal, but what I'm trying to do is use a temperature-compensated clock source instead, so I'm essentially not using the ESP32's internal oscillator circuit, but instead feeding it a square wave from the TCXO.

I've used other microprocessors in the past that specifically (i.e. according to their datasheets) can support either a crystal or an external clock source, so I'm inclined to try it with the ESP32 (connecting the TCXO to the pin labeled "crystal input"), but I thought I'd ask before I potentially smoke my ESP32.

  • 1
    \$\begingroup\$ yes it is just a self biased CMOS inverter with IN and out, so you can drive IN with same logic signal as output. \$\endgroup\$ May 15, 2017 at 0:22

1 Answer 1


In general, there's no answer that correctly answers every circumstance. This is the kind of question you would normally give to your local field representative for the microcontroller in question. In the case of these ESP8266, I have no idea who you'd call about it. So I'd probably experiment and simply "find out" for myself. That said:

In the usual cases for the pair of pins where a crystal is normally added, externally, one of them is an input to a class-A amplifier and the other one is an output from the same amplifier.

Sometimes, the field rep will tell you to drive the input and leave the output unconnected. If you do this, the class-A amplifier will drive the clock chain inside the part (and also consume the usual added gobs of power that the class-A amplifier itself sucks down, too, as it clocks along with the input.) In this case, the output pin is also likely to be driven hard. Leaving it unloaded may be okay (if it works both for you and for the chip to do that) and it may not be (for you, or else for the chip.) A reason why a conversation (or else testing) may be needed.

Sometimes, the field rep will tell you to drive the output and "do something" with the input. (Such as leave it open or it might be something specific you have to do that mitigates the amplifier's output sharing the pin you are driving.) I had my local Microchip field rep send me a long, internal "whitepaper" on the topic of doing exactly this, in fact; pointing out that for their PIC16 device I was looking at, that it actually consumed lower power driving the output because their class-A amplifier would "find a quiescent point" and stop oscillating, entirely. (And therefore consuming very little power on its own.) This actually caused the chip to consume about half the overall quiescent power, since that darned class-A oscillator was designed to "run hot."

(Microchip seriously over-powered the class-A amplifier because their designers expected "idiots" to use gosh-knows what kind of crap, wired with gosh-knows what kind of bailing wire from one protoboard to another, and they would rather just avoid having to deal with after-sales phones calls than to stand on ceremony and design a clean, lower-powered oscillator. They worried that if they did it for really low power they'd almost certainly have all manner of phone calls coming back complaining about "bad parts" from people who couldn't design their way out of a paper bag. So they just made the class-A oscillator "bullet-proof.")

Some microcontrollers (some from Texas Instruments, such as certain MSP430 I think) include methods to adjust how "hot" their oscillators are, by programming them. So you might also be told by your field rep to drive the oscillator output pin, but only if you program the internal options to lower the quiescent current of their amplifier, and to otherwise use the input pin.

As you can see, "It Depends."

If you want to see an example of what it might really look like, with more "behavioral" details inserted, you could examine the Harris (now Intersil, I gather) datasheet on the HA7210 oscillator IC. I actually used that part in order to lower the power consumption of that Microchip PIC16 I mentioned, not because I wanted a TXCO, but instead because I wanted to dump their internal class-A oscillator and replace it with something that would reduce the overall power consumed in operating it. Drove the oscillator output pin and it worked great.

  • \$\begingroup\$ In the early 90s, I designed in an IC with XTALIN and XTALOUT pins that took in an external clock on its XTALOUT pin. Seemed unusual but the datasheet was very clear on it. This was pre-internet so less easy to find out for sure. Must have checked the datasheet twenty times before I had the board laid out. UV. \$\endgroup\$
    – TonyM
    May 15, 2017 at 7:23
  • \$\begingroup\$ @jonk, small world I'm looking at this today thinking about a TXCO vs. 3 rounds of protoboards to ensure our crystals are trimmed. \$\endgroup\$
    – Leroy105
    Jul 29, 2018 at 17:36

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.