hello, I want to use HFXO with high accuracy. How can I switch between HFINT and HFXO?
than you,
hello, I want to use HFXO with high accuracy. How can I switch between HFINT and HFXO?
than you,
According to documentation
The HFINT will be used when HFCLK is requested and HFXO has not been started. The HFXO is started by triggering the HFCLKSTART task and stopped using the HFCLKSTOP task. A HFCLKSTARTED event will be generated when the HFXO has started and its frequency is stable.
According to documentation
The HFINT will be used when HFCLK is requested and HFXO has not been started. The HFXO is started by triggering the HFCLKSTART task and stopped using the HFCLKSTOP task. A HFCLKSTARTED event will be generated when the HFXO has started and its frequency is stable.
thank you, How can HFXO trigger the HFCLKSTART task?
You can use driver available in SDK (nrf_drv_clock_hfclk_request), you can use HAL available in SDK( nrf_clock_task_trigger(NRF_CLOCK_TASK_HFCLKSTART) ), you can do it directly on the registers (something like NRF_CLOCK->TASKS_HFCLKSTART = 1) if i remember correctly... ).
You just operate on it like on any other peripherals. There is documentation of SDK available on infocenter, and also there are clock examples available in SDK - you should just check it.
Hi, Wojtek, thank you, I was satisfied with the addition below. NRF_CLOCK->TASKS_HFCLKSTART = 1; NRF_CLOCK->TASKS_LFCLKSTART = 1;
With this, I was able to interrupt and measure accurate time. However, I think whether there is some sacrifice of current consumption.
Extend question for this case: For current consumption, we can found HFXO enabled or disabled depends on BLE connection requirement, and it is not always on or off. My application needs HFXO during a specified interval time, other time, it will be disabled, too. It maybe conflicted with BLE. How to manage them for this application?