External 32768 clock

tsc1987
Posts: 6
Joined: Thu Mar 28, 2019 8:25 pm

External 32768 clock

Postby tsc1987 » Thu Mar 28, 2019 8:33 pm

Does anyone have specifications regarding the crystal and the capacitance to use for the external 32.768kHz clock with the ESP32Wroom module?
I have tried using this crystal: https://www.digikey.com/product-detail/ ... ND/3927445 .
with 12pF capacitors on both sides.

We are seeing failure in about 20-25% of our units. The ESP32 during startup displays the following message:

"clk: RTC: Not found External 32kHz crystal. Switching to internal 150 kHz RC chain."

I have also tried to switch to 6pF capacitors on both sides with the above crystal and it still does not work.


Any insights into this issue will be really appreciated.


tsc1987
Posts: 6
Joined: Thu Mar 28, 2019 8:25 pm

Re: External 32768 clock

Postby tsc1987 » Fri Mar 29, 2019 8:34 pm

Hi,
I am using esp-idf v1.1.1 which already has the bug fix that was reported. I am still getting the failures in a few boards.

tsc1987
Posts: 6
Joined: Thu Mar 28, 2019 8:25 pm

Re: External 32768 clock

Postby tsc1987 » Fri Mar 29, 2019 10:41 pm

The issue was resolved by changing the clk.c file with the bugfix (https://github.com/espressif/esp-idf/co ... f66fae576a)

Any idea why this bug fix is not part of the standard release yet?
Last edited by tsc1987 on Tue Apr 02, 2019 5:27 pm, edited 1 time in total.

ESP_Sprite
Posts: 8921
Joined: Thu Nov 26, 2015 4:08 am

Re: External 32768 clock

Postby ESP_Sprite » Sat Mar 30, 2019 7:26 am

What do you mean by 'standard release'? As far as I can see, that fix has been in ESP-IDF since 3.1 was released. Are you really sure you're using ESP-IDF 1.x.x? Because the 1.x branch is three years old and unmaintained by now.

tsc1987
Posts: 6
Joined: Thu Mar 28, 2019 8:25 pm

Re: External 32768 clock

Postby tsc1987 » Tue Apr 02, 2019 5:26 pm

Sorry the firmware version is v3.1.1.

Also, the issue wasn't fixed with the changes. I ran unit tests on the clock. For the cases where its not working properly, the unit tests show that the crystal is detected but the time measurement fails.Following are the results of the unit tests:
attempt #1/3... [time=63] FAIL. Time measurement...FAIL [calibration val = 16000371]
attempt #2/3... [time=63] FAIL. Time measurement...FAIL [calibration val = 15999923]
attempt #3/3... [time=63] FAIL. Time measurement...FAIL [calibration val = 16000115]

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: External 32768 clock

Postby WiFive » Fri Apr 05, 2019 2:47 am


commando_j
Posts: 27
Joined: Tue Feb 05, 2019 5:26 pm

Re: External 32768 clock

Postby commando_j » Wed Apr 10, 2019 5:55 pm

Are you giving enough time for the crystal to stabilize after power up, before measurement?

What is your layout like, trace length?

I don't like that the datasheet says "Load capacitance at both ends should be configured according to the crystal’s specification."
Usually there's a recommended load capacitance from the uC manufacturer.

commando_j
Posts: 27
Joined: Tue Feb 05, 2019 5:26 pm

Re: External 32768 clock

Postby commando_j » Wed Apr 10, 2019 6:54 pm

I have found this info. ESP32 does not seem to have an internal bias / feedback resistor internal to the chip. So it would be needed externally "for the oscillator to reliably start up- it biases the amplifier into the linear region where noise can be amplified to get the crystal oscillator going." ( From https://electronics.stackexchange.com/q ... ss-crystal).
The ESP32 datasheet says "The parallel resistor R4 is used for biasing the crystal circuit (5 MΩ < R4 ⩽ 10 MΩ)." And the image shows the R4 resistor is external to the ESP32 in the ESP32 Hardware Design Guidelines V2.7 page 6 Figure 6.
What is odd is that the WROVER kit doesn't have this resistor. But it is a dev kit, so not really a design to base yours on.
You could try adding a resistor across the pins, and/or making sure your caps calculation take into consideration some stray capacitance, say 2pF. CX1=CX2 = 2(CL - Cstray). So for your Digi-Key crystal with 6pF load capacitance, try 8pF caps. And ensure the caps are higher voltage (say 50V) at least 5% or less, and C0G(NP0).

commando_j
Posts: 27
Joined: Tue Feb 05, 2019 5:26 pm

Re: External 32768 clock

Postby commando_j » Mon Apr 15, 2019 2:59 pm

Any feedback?
Would like to know if you had any positive affects on your board.

Who is online

Users browsing this forum: No registered users and 56 guests