cancel
Showing results for 
Search instead for 
Did you mean: 

Spirit1 How to configure AFC

martin23
Associate
Posted on August 21, 2014 at 21:42

Where can I get information on how to configure the AFC for optimal results?

There is likely a trade-off for longer/shorter preambles.

What about the difference between AFC_SLICER_CORRECTION and AFC_2ND_IF_CORRECTION for example?

#spirit1
1 REPLY 1
Nickname1920_O
Associate III
Posted on September 02, 2014 at 08:50

Hello Martin,

the AFC algorithm allows to compensate, within certain limits, a relative frequency error between the transmitting device and the receiving one caused by, e.g., crystal inaccuracies.

The AFC algorithm is operational in FSK, GFSK and MSK modes.

Due to the demodulation algorithm employed, any frequency error results in a DC offset in the demodulated signal before slicing.

The basic operating principle of the AFC is that the minimum and maximum signal frequencies are detected and a correction is calculated to remove the aforementioned offset.

Such correction is either applied at the slicer level in the form of offset compensation (default mode) or, optionally, is used to adjust the second IF conversion stage frequency. The former mode allows a quick recovery of the frequency error but doesn’t prevent part of the received signal power to be cut by the channel filter; the latter mode adjusts the signal frequency before entering the channel filter thus avoiding power loss but requires a longer period to settle.

The first mode is recommended for normal operation

.

The AFC also provides the estimated frequency error through the AFC_CORR register. If the frequency error is known to be constant (e.g. communication always occurs between the same pair of devices), this value can directly be used to correct the programmed IF_OFFSET.

In order to guarantee both fast lock and smooth tracking, the AFC has a fast and a slow mode. The AFC will start in fast mode as soon as a signal threshold is passed and will switch to the slow mode after a programmable period.

The AFC is controlled by the following parameters:

  • RSSI threshold: this parameter sets the minimum signal power above which the AFC algorithm is started (RSSI_TH register).
  • AFC fast gain log2: this parameter sets the loop gain in the fast mode (AFC0 register), the allowed range is 0 Ã· 15.
  • AFC slow gain log2: this parameter sets the loop gain in the slow mode (AFC0 register). the allowed range is 0 Ã· 15.
  • AFC fast period: this parameter sets the length of the fast period in number of samples (AFC1 register), the allowed range is 0 Ã· 255. The recommended setting for this parameter is such that the fast period equals the preamble length. Since the algorithm operates typically on 2 samples per symbol, the programmed value should be twice the number of preamble symbols.
  • AFC peak detection leakage: this parameter sets the decay speed of the min/max frequency peak detector (AFC2 register), the range allowed is 0 Ã· 31 (0 is no leakage, 31 is high leakage). The recommended value for this parameter is 4.
  • AFC mode: this parameter sets the AFC correction mode (AFC2 register. 0 is slicer correction, 1 is 2nd IF correction). The recommended value for this parameter is 0.
  • AFC enabled: this parameter enables the AFC algorithm (AFC2 register).

Hope this clarifies the topic.

Best regards.