OCXO as a Clock Source

0xPIT#
Posts: 5
Joined: Tue Aug 01, 2017 9:20 pm

OCXO as a Clock Source

Postby 0xPIT# » Tue Aug 01, 2017 9:23 pm

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

ESP_igrr
Posts: 2072
Joined: Tue Dec 01, 2015 8:37 am

Re: OCXO as a Clock Source

Postby ESP_igrr » Wed Aug 02, 2017 8:22 am

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.

0xPIT#
Posts: 5
Joined: Tue Aug 01, 2017 9:20 pm

Re: OCXO as a Clock Source

Postby 0xPIT# » Wed Aug 02, 2017 8:34 am

Thanks!

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

ESP_igrr
Posts: 2072
Joined: Tue Dec 01, 2015 8:37 am

Re: OCXO as a Clock Source

Postby ESP_igrr » Wed Aug 02, 2017 8:39 am

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

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

Re: OCXO as a Clock Source

Postby WiFive » Wed Aug 02, 2017 10:28 am


0xPIT#
Posts: 5
Joined: Tue Aug 01, 2017 9:20 pm

Re: OCXO as a Clock Source

Postby 0xPIT# » Tue Aug 22, 2017 8:05 pm

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

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: OCXO as a Clock Source

Postby ESP_Angus » Mon Aug 28, 2017 3:31 am

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.

Who is online

Users browsing this forum: No registered users and 181 guests