Skip to content

Commit 1fb0408

Browse files
authored
Merge pull request #2269 from nvlsianpu/lfclkdoc2master
documentation regards nRF51/nRF52 Low frequency clock configuration
2 parents 36468c9 + d885692 commit 1fb0408

File tree

1 file changed

+97
-0
lines changed

1 file changed

+97
-0
lines changed
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
2+
# LF Clock configuration using mbed configuration system
3+
4+
In order to provide the configuration for a low frequency (LF) clock, add a description of the LF clock inside a mbed configuration JSON file.
5+
For example at application level the description might be added in a mbed_app.json file and on target level the description might be added in the hal/target.json file.
6+
LF clock source configuration is used for MCU startup initialization and the BLE SoftDevice LF clock configuration (if BLE libraries is used). Advanced configurations are used only for the BLE SoftDevice LF clock configuration.
7+
8+
9+
## Usage:
10+
11+
1. Clock source
12+
13+
Default clock source is XTAL oscillator. It is defined at the target level configuration as the target.lf_clock_src key.
14+
There are three options that can be configured as the clock source:
15+
- NRF_LF_SRC_XTAL
16+
- NRF_LF_SRC_RC
17+
- NRF_LF_SRC_SYNTH
18+
19+
In order to override this configuration use targed_override section in configuration file (e.g mbed_app.json)
20+
21+
```json
22+
{
23+
"target_overrides": {
24+
"*": {
25+
"target.lf_clock_src": "NRF_LF_SRC_XTAL"
26+
}
27+
}
28+
}
29+
```
30+
31+
2a. Advanced configuration of the LFCLK RC oscillator:
32+
33+
```json
34+
{
35+
"config": {
36+
"lf_clock_rc_calib_timer_interval": {
37+
"value": 16,
38+
"macro_name": "MBED_CONF_NORDIC_NRF_LF_CLOCK_CALIB_TIMER_INTERVAL"
39+
},
40+
"lf_clock_rc_calib_mode_config": {
41+
"value": 1,
42+
"macro_name": "MBED_CONF_NORDIC_NRF_LF_CLOCK_CALIB_MODE_CONFIG"
43+
}
44+
}
45+
}
46+
47+
```
48+
49+
"lf_clock_rc_calib_timer_interval" - Calibration timer interval in 250 ms. It is equivalent to nrf_clock_lf_cfg_t::rc_ctiv.
50+
This item generates macro MBED_CONF_NORDIC_NRF_LF_CLOCK_CALIB_TIMER_INTERVAL.
51+
By default, such configuration is set to 16.
52+
53+
"lf_clock_rc_calib_mode_config" - This value configures how often the RC oscillator will be calibrated, in number of calibration intervals.
54+
It is equivalent to nrf_clock_lf_cfg_t::rc_temp_ctiv.
55+
For further information, see the documentation for the [API of a SoftDevice 13x version 2.0.0](http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v2.0.0/structnrf__clock__lf__cfg__t.html)
56+
This item generates macro MBED_CONF_NORDIC_NRF_LF_CLOCK_CALIB_MODE_CONFIG.
57+
By default, such configuration is set to 1.
58+
59+
2b. Advanced configuration of the LFCLK XTAL oscillator:
60+
61+
Accuracy of the clock source can be set. In order to do so macro MBED_CONF_NORDIC_LF_CLOCK_XTAL_ACCURACY should been provided (e.g. in mbed_app.json).
62+
By default such configuration is set to NRF_CLOCK_LF_XTAL_ACCURACY_20_PPM.
63+
For further information, see the documentation for the [API of a SoftDevice 13x version 2.0.0](https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s132.api.v2.0.0%2Fgroup___n_r_f___s_d_m___d_e_f_i_n_e_s.html)
64+
65+
```json
66+
{
67+
"config": {
68+
"lf_clock_xtal_accuracy": {
69+
"value": "NRF_CLOCK_LF_XTAL_ACCURACY_250_PPM",
70+
"macro_name": "MBED_CONF_NORDIC_LF_CLOCK_XTAL_ACCURACY"
71+
}
72+
}
73+
}
74+
75+
```
76+
77+
78+
79+
2c. Advance configuration of the LFCLK Synthesized from HFCLK:
80+
81+
Accuracy of the clock source can be set. In order to do so macro MBED_CONF_NORDIC_LF_CLOCK_SYNTH_ACCURACY should been provided (e.g. in mbed_app.json).
82+
By default, such configuration is set to NRF_CLOCK_LF_XTAL_ACCURACY_20_PPM.
83+
For further information, see the documentation for the [API of a SoftDevice 13x version 2.0.0](https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s132.api.v2.0.0%2Fgroup___n_r_f___s_d_m___d_e_f_i_n_e_s.html)
84+
85+
```json
86+
{
87+
"config": {
88+
"lf_clock_synth_accuracy": {
89+
"value": "NRF_CLOCK_LF_SYNTH_ACCURACY_250_PPM",
90+
"macro_name": "MBED_CONF_NORDIC_LF_CLOCK_XTAL_ACCURACY"
91+
}
92+
}
93+
}
94+
95+
```
96+
97+

0 commit comments

Comments
 (0)