Hi Nordics,
I would like to run the app example “ble_app_hrs_s110_hci_pca10028 (nRF51 PCA10028)” on the 32 MHz crystal. Can anyone help to change the code to 32MHz base on the example?
V.H.
You can start the HFCLK oscillator like this:
NRF_CLOCK->EVENTS_HFCLKSTARTED = 0;
NRF_CLOCK->TASKS_HFCLKSTART = 1;
while (NRF_CLOCK->EVENTS_HFCLKSTARTED == 0){}
NRF_CLOCK->EVENTS_HFCLKSTARTED = 0;
You can also synthesize LFCLK from HFCLK:
NRF_CLOCK->LFCLKSRC = (CLOCK_LFCLKSRC_SRC_Synth << CLOCK_LFCLKSRC_SRC_Pos);
Note that even if you have a 32MHz crystal, the HFCLK will be scaled down to 16MHz