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

johnboiles
Posts: 6
Joined: Thu Mar 03, 2022 6:31 am

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

Postby johnboiles » Fri Mar 04, 2022 7:20 pm

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

dalbert
Posts: 14
Joined: Wed Nov 16, 2016 3:45 am

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

Postby dalbert » Wed Apr 22, 2026 12:49 am

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 124 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.


dalbert
Posts: 14
Joined: Wed Nov 16, 2016 3:45 am

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

Postby dalbert » Wed Apr 22, 2026 9:47 pm

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.

xiongweichao
Espressif staff
Espressif staff
Posts: 5
Joined: Tue Jun 22, 2021 3:33 am

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

Postby xiongweichao » Wed May 06, 2026 3:16 am

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

Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot], Bytespider and 5 guests