This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How can I use Zephyr's API to set clock source to external 32MHz crystal for NRF52840-DK

Hi there, 

I have a question about using zephyr on my nrf52840-DK board: I want to set the system to run at 64MHz for Zephyr. However, I can't find an option to do that. And if I run the following code block to measure the cycles of a second: 

```

u32_t then = k_cycle_get_32();

k_sleep(1000);

u32_t now = k_cycle_get_32();

printk("then: %d, now: %d, diff = %d\n", then, now, now - then);

```

It always return a diff number around 32768. Does the MCU run at only 32KHz by default?  How can I force it to run at 64MHz given that the board has the external 32MHz crystal? 

Thank you! 

Jun