Re: NRF52840 select clock source from external XTAL HFXO


jim@...
 

Something like this should work:

struct device *clk_dev = device_get_binding(DT_INST_0_NORDIC_NRF_CLOCK_LABEL "_16M");
clock_control_on(clk_dev, (void *)1);

Jim


On Fri, Oct 4, 2019 at 09:25 AM, Alexis Cogrel <alexis.cogrel@...> wrote:

Hello Zephyr Community,

 

We work on board based on NRF52840 using zephyr. We are encountering problems to communicate with a device using UARTE at 9600 bit/s.

We observe that the current speed is not properly at 9600 bit/s. We observe a shift error around 2%. When we program the UARTE properly at 9600 bit/s by setting BAUDRATE register value, the communication is good with our device.

 

To our mind, the shift error is due to the clock source (HFCLOCK) from internal (HFINT tolerance typ 1.5% to 8% max) is selected by default and we would like to use clock from external crystal (HFXO) for better performance.

Currently, setting clock source from external crystal seems to be not easily and maybe not implemented yet. Is the driver available?

 

If yes someone can help me to set clock source to external XTAL (HFXO)?

 

Regards,

 

Alexis COGREL

Embedded software engineer

www.stimio.fr

 

 

 

Join devel@lists.zephyrproject.org to automatically receive all group messages.