Page 1 of 1

OCXO as a Clock Source

Posted: Tue Aug 01, 2017 9:23 pm
by 0xPIT#
Hi,

as far as I've understood, Wifi and BT will only work with the default (40MHz?) clock frequency.

If I'm ok without Wifi and BT, can I simply connect a 10MHz OCXO as a external clock source to a ESP32?

Thanks

pit

Re: OCXO as a Clock Source

Posted: Wed Aug 02, 2017 8:22 am
by ESP_igrr
In theory, you can (i.e. the chip will start up, load code from flash, etc).
However software assumes that only certain frequencies of XTAL are ever used, namely 40, 26, 24 MHz. If you feed 10MHz as input, then
a) the code which figures out XTAL frequency will fail:
https://github.com/espressif/esp-idf/bl ... #L469-L494

b) the code which configures the PLL may not be able to enable PLL because the parameters needed for 10MHz input will likely be different from the ones for 40/26/24 MHz.
https://github.com/espressif/esp-idf/bl ... clk.c#L224
(workaround: remove these parts of code and don't enable PLL at all:
https://github.com/espressif/esp-idf/bl ... /clk.c#L78
https://github.com/espressif/esp-idf/bl ... #L634-L646
)

c) all timekeeping code (system_get_time, gettimeofday, RTOS ticks) will be using incorrect dividers.
https://github.com/espressif/esp-idf/bl ... #L261-L264
https://github.com/espressif/esp-idf/bl ... time.c#L84
https://github.com/espressif/esp-idf/bl ... nfig.h#L99

It is not impossible to work around this, but this is not something we will likely support out of the box.

Re: OCXO as a Clock Source

Posted: Wed Aug 02, 2017 8:34 am
by 0xPIT#
Thanks!

So I should opt for a 40, 26 or 24 MHz OCXO :)

Re: OCXO as a Clock Source

Posted: Wed Aug 02, 2017 8:39 am
by ESP_igrr
I recommend using 40MHz as that is the most tested at this point.
26 is okay as long as you don't use WiFi (see another thread on this forum about 26 MHz support with wifi/bt).

Re: OCXO as a Clock Source

Posted: Wed Aug 02, 2017 10:28 am
by WiFive

Re: OCXO as a Clock Source

Posted: Tue Aug 22, 2017 8:05 pm
by 0xPIT#
Finally got a 26MHz OCXO in my hands \o/

I want to remove the 26MHz Xtal of my ESP32-Thing and feed the ESP with the clock signal from the OCXO.

However, I seem to be unable to find specific information in the datasheet or hardware design guide on how to operate the ESP32 with an external oscillator.

Would I connect my OCXO's signal output simply to the XTAL_P (External crystal input), and leave XTAL_N (External crystal output) unconnected? Or does _N need to be treated with a capacitor to ground, like so:
Image

Thanks for help

pit

Re: OCXO as a Clock Source

Posted: Mon Aug 28, 2017 3:31 am
by ESP_Angus
0xPIT# wrote: Would I connect my OCXO's signal output simply to the XTAL_P (External crystal input), and leave XTAL_N (External crystal output) unconnected? Or does _N need to be treated with a capacitor to ground, like so:
You can leave XTAL_N unconnected.