12. PLL Setting Command¶
Configures the microcontroller clock output-buffer drive, phase-detector delay, PLL dithering, and PLL bandwidth.
Note
The datasheet recommends retaining the power-on-reset settings for typical applications. Changes should be checked by examining the output RF spectrum.
Register Fields¶
Bits |
Name |
Meaning |
API |
|---|---|---|---|
7 |
Fixed |
Must be |
None |
6:5 |
|
CLK output-buffer drive current |
|
4 |
Fixed |
Must be |
None |
3 |
|
Phase-detector delay enable |
|
2 |
|
PLL dithering disable |
|
1 |
Fixed |
Must be |
None |
0 |
|
PLL bandwidth |
The setters listed in the register field table above directly configure
fields in the PLL Setting Command. The setters and reset function update
staged configuration without communicating with the radio. Use
rfm12_apply_to_radio() to write the staged settings.
Command Functions¶
rfm12_set_pll_output_buffer_current()¶
-
RFM12_result_t rfm12_set_pll_output_buffer_current(RFM12_t *dev, RFM12_pll_output_buffer_current_t current)¶
Stage the drive-current selection for the microcontroller CLK output.
Higher drive current produces faster rise and fall times but can cause interference. The datasheet relates the selections to the CLK frequency as follows; the optimal setting also depends on external load capacitance.
Selection
ob1:ob0CLK frequency
RFM12_PLL_OUTPUT_BUFFER_CURRENT_0002.5 MHz or less
RFM12_PLL_OUTPUT_BUFFER_CURRENT_1012.5 MHz or less
RFM12_PLL_OUTPUT_BUFFER_CURRENT_2103.3 MHz
RFM12_PLL_OUTPUT_BUFFER_CURRENT_3115 or 10 MHz (recommended)
This setting controls output drive, not the clock division ratio.
- Parameters:
dev – RFM12 radio instance.
current – CLK output-buffer drive-current selection.
- Returns:
RFM12_OKon success, or an appropriateRFM12_result_terror.
rfm12_set_pll_delay_enable()¶
-
RFM12_result_t rfm12_set_pll_delay_enable(RFM12_t *dev, RFM12_enable_t enable)¶
Stage the PLL phase-detector delay setting.
Enabling this setting sets
dlyand switches on the delay in the phase detector.- Parameters:
dev – RFM12 radio instance.
enable – Enable or disable the phase-detector delay.
- Returns:
RFM12_OKon success, or an appropriateRFM12_result_terror.
rfm12_set_pll_dithering_disable()¶
-
RFM12_result_t rfm12_set_pll_dithering_disable(RFM12_t *dev, RFM12_enable_t enable)¶
Stage the PLL dithering-disable setting.
Enabling this setting sets
dditand disables dithering in the PLL loop. Disabling this setting clearsdditand allows dithering.- Parameters:
dev – RFM12 radio instance.
enable – Enable or disable the dithering-disable bit.
- Returns:
RFM12_OKon success, or an appropriateRFM12_result_terror.
rfm12_set_pll_bandwidth()¶
-
RFM12_result_t rfm12_set_pll_bandwidth(RFM12_t *dev, RFM12_pll_bandwidth_t bandwidth)¶
Stage the PLL loop bandwidth for transmitter RF performance.
Select
RFM12_PLL_BANDWIDTH_NORMALforbw0 = 0orRFM12_PLL_BANDWIDTH_HIGHforbw0 = 1. The datasheet lists the following tradeoff between maximum bit rate and phase noise.Selection
Maximum bit rate
Phase noise at 1 MHz offset
RFM12_PLL_BANDWIDTH_NORMAL86.2 kbps
-107 dBc/Hz
RFM12_PLL_BANDWIDTH_HIGH256 kbps
-102 dBc/Hz
These are hardware PLL characteristics; this setter does not select the data rate. The datasheet power-on-reset command value is
0xCC77, which hasbw0 = 1. The header’s comment labeling the normal bandwidth selection as the default does not describe that hardware power-on-reset value.- Parameters:
dev – RFM12 radio instance.
bandwidth – PLL loop-bandwidth selection.
- Returns:
RFM12_OKon success, or an appropriateRFM12_result_terror.
rfm12_reset_pll_setting()¶
-
RFM12_result_t rfm12_reset_pll_setting(RFM12_t *dev)¶
Reset the staged PLL Setting Command values to their library defaults.
This function does not communicate with the radio. The changed settings are written to the radio by
rfm12_apply_to_radio().- Parameters:
dev – RFM12 radio instance.
- Returns:
RFM12_OKon success, or an appropriateRFM12_result_terror.