Hi Team,
currently we are using nrf52833 micro controller for out prototype design. can run micro controller without external 32Mhz and 32khz crystals.
Hi Team,
currently we are using nrf52833 micro controller for out prototype design. can run micro controller without external 32Mhz and 32khz crystals.
Yes.
However, without the 32MHz crystal, the RADIO peripheral will not be frequency-stable enough to be usefully functional (and might also be illegal). But as an MCU that doesn't use the radio peripheral, it should work.
How to enable both internal clock and external clocks in software, can i have code snipet for this using zephyr
Assuming you are using NCS:
Here is an ugly way to start HFXO that works for me (at least when not using BLE.... haven't tested it with BLE)
static int clock_setup() { int rc; // // LOG_INF("nrfx_clock_init(0)"); nrfx_clock_init(0); // LOG_INF("nrfx_clock_init(clk_callback)"); // nrfx_clock_init(clk_callback); LOG_INF("nrfx_clock_enable"); nrfx_clock_enable(); // // nrfx_clock_hfclk_start(); // * @note This function is deprecated. Use @ref nrfx_clock_start instead. LOG_INF("nrfx_clock_start"); nrfx_clock_start(NRF_CLOCK_DOMAIN_HFCLK); LOG_INF("nrfx_clock_is_running"); rc = nrfx_clock_is_running(NRF_CLOCK_DOMAIN_HFCLK,0); LOG_INF("nrfx_clock_is_running=%d",rc); // nrf_clock_hf_src_get(); // sd_clock_hfclk_request(); // // // // static const struct device *const clock0 = DEVICE_DT_GET_ONE(nordic_nrf_clock); // if (!device_is_ready(clock0)) { // return 22; // } // rc = clock_control_on(clock0, CLOCK_CONTROL_NRF_SUBSYS_HF); // if (rc) { // LOG_ERR("clock_control_on failed first try rc=%d",rc); // rc = clock_control_on(clock0, CLOCK_CONTROL_NRF_SUBSYS_HF); // } // // todo: confirm we are running HFXO // if (rc) { // LOG_ERR("clock_control_on failed rc=%d",rc); // return rc; // } // struct onoff_manager *clk_mgr; // // struct onoff_client clk_cli; // clk_mgr = z_nrf_clock_control_get_onoff(CLOCK_CONTROL_NRF_SUBSYS_HF); // // mpsl_clock_hfclk_request(); // // what about logging? // LOG_ERR("Good morning!!"); // only need to add header files; CONFIG_LOG=y already set // printk("after LOG... but it it?\n"); return 0; }
Thanks for reply,
can you suggest how to enable internal high-speed clock frequency alone using zephyr
The internal HFCLK will be enabled automatically when needed. But as Daniel Chisholm says, you will not be able to use the radio peripheral running on this.