Page 2 of 2

Re: Need guidelines: wiring and configuring an external 32Khz oscillator input in EDP-IDF

Posted: Fri Mar 04, 2022 7:20 pm
by johnboiles
Are there any guidelines as to the maximum PPM tolerance for the 32.768kHz oscillator that will still work, particularly for using BLE + light sleep? I'm considering the various options from the SiTime lineup https://www.sitime.com/products/khz-oscillators

Re: Need guidelines: wiring and configuring an external 32Khz oscillator input in EDP-IDF

Posted: Wed Apr 22, 2026 12:49 am
by dalbert
Would someone at EspressIF please provide up-to-date information regarding how to connect an external 32.768kHz oscillator to the ESP32 (I'm using the ESP32-WROOM-32E) and the software configuration for using it (ESP-IDF) for the RTC?

I am using an external TCXO that produces a 3v3 square wave through a resistor divider to deliver a 750mV p-p square wave to the IO32 (XN) pin. IO33 (XP) has a 1nF to ground. (see: https://docs.espressif.com/projects/esp ... _tree.html)
or a 32 kHz clock signal generated by an external circuit. The external signal must be connected to the 32K_XN pin. Additionally, a 1 nF capacitor must be placed between the 32K_XP pin and ground. In this case, the 32K_XP pin cannot be used as a GPIO pin.
Past ESP-IDF documents have indicated that the voltage should be between 0v6 and 1v0.
External 32kHz oscillator at 32K_XN pin: Allows using 32kHz clock generated by an external circuit. The external clock signal must be connected to the 32K_XN pin. The amplitude should be less than 1.2 V for sine wave signal and less than 1 V for square wave signal. Common mode voltage should be in the range of 0.1 < Vcm < 0.5xVamp, where Vamp is signal amplitude. Additionally, a 1 nF capacitor must be placed between the 32K_XP pin and ground. In this case, the 32K_XP pin cannot be used as a GPIO pin.
Current hardware guidelines don't even mention the external oscillator option (https://docs.espressif.com/projects/esp ... -schematic)

The currrent ESP-IDF software documents (https://docs.espressif.com/projects/esp ... _time.html) indicate:
External 32 kHz oscillator: Allows using a 32 kHz clock generated by an external circuit. The external clock signal must be connected to the external oscillator pin. The input amplitude must ensure that the digital circuit can correctly distinguish between logic high and low levels. Test results show that 1.7 V is the threshold between high and low levels. Therefore, make sure the input waveform has a peak value greater than 1.7 V and a minimum value lower than 1.7 V. For details on pin connections, please refer to the datasheet.
So what is the desired input voltage for the external oscillator?

MenuConfig is configured for an external oscillator and yet calls to rtc_clk_cal() often do not work
ESP32_TCXO_XN.jpg
ESP32_TCXO_XN.jpg (100.81 KiB) Viewed 153 times
I call rtc_clk_32k_enable_external(); and then repeatedly call rtc_clk_cal(RTC_CAL_32K_XTAL, 1000); which always (usually) returns 0.

Any help would be much appreciated.

Re: Need guidelines: wiring and configuring an external 32Khz oscillator input in EDP-IDF

Posted: Wed Apr 22, 2026 8:18 am
by MicroController

Re: Need guidelines: wiring and configuring an external 32Khz oscillator input in EDP-IDF

Posted: Wed Apr 22, 2026 9:47 pm
by dalbert
Thank you. I think EspressIF needs to weigh in here. Both their documentation and even this thread contains wildly different and contradictory information. Some places say that the external clock should connect to XP, others to XN. Some way less than 1V, some say more than 1v7. Some suggest you connect the oscillator through a series capacitor, others have a direct DC connection. It is unreasonable for users to have to use trial and error to find out how to interface an external 32.768kHz oscillator.

Re: Need guidelines: wiring and configuring an external 32Khz oscillator input in EDP-IDF

Posted: Wed May 06, 2026 3:16 am
by xiongweichao
Hi @dalbert ,

For BLE + light sleep, the maximum allowable oscillator tolerance is 500 PPM. Reference documentation: https://docs.espressif.com/projects/esp ... power-mode

Thanks