Determine the trim value

nRF70 Series Device Commissioning and Characterization

You can use a transmit-based or receive-based approach for determining the trim value. The choice depends on the available test equipment. The receive-based approach yields quicker results and is better for trimming multiple units simultaneously. The trim accuracy is the same with either approach.

The crystal oscillator trim range is 0 to 127, where 0 represents the highest frequency the crystal oscillator generates, while 127 represents the lowest frequency.

Transmit-based approach

To determine the trim value, the unit to be trimmed transmits either a modulated packet or a carrier wave at a known frequency. Measure the frequency offset using a Vector Signal Analyzer (VSA) for a modulated packet or a Spectrum Analyzer (SA) for a carrier wave. This is repeated with different trim values until the minimum Carrier Frequency Offset (CFO) is found. This value is then programmed into the One Time Programmable (OTP) memory.

The following diagram shows the CALIB_XO process.

Figure 1. CALIB_XO process for transmit-based approach
CALIB_XO process for transmit-based approach

The process shown in the diagram is based on searching for the minimum CFO. Multiple approaches can be used. The following example is based on the bisection or binary search method.

L=0, H=127
minCFO=1e6 
For i in range(7)  
    trimVal = (INT) (L+H)/2 
    Set crystal oscillator offset to trimVal 
    Transmit modulated packet or carrier wave 
    Measure CFO on VSA or SA  
    if abs(CFO) < minCFO: 
         minCFO = abs(CFO) 
         minTrimVal = trimVal 
    L= trimVal if CFO > 0 else H= trimVal

The following table provides example Wi-Fi® Radio test commands for performing the steps described in the algorithm.

Table 1. Wi-Fi Radio test commands for transmit-based approach
Step Commands
Set crystal oscillator offset to trimVal
wifi_radio_test set_xo_val <trimVal>
Transmit a modulated packet (for example, legacy 6 Mbps in 2.437 GHz)
wifi_radio_test init 6 
wifi_radio_test tx_pkt_tput_mode 0 
wifi_radio_test tx_pkt_rate 6  
wifi_radio_test tx_power 10 
wifi_radio_test tx 1 
Alternative - transmit a carrier wave (for example, at 2.439 GHz)
wifi_radio_test init 6
wifi_radio_test tx_tone_freq 2
wifi_radio_test tx_power 10 
wifi_radio_test tx_tone 1
Update the OTP memory register CALIB_XO with the required trim value
wifi_radio_ficr_prog otp_write_params 0x130 <minTrimVal> 

Reboot the system to activate the trim values for TX/RX operations.

Receive-based approach

To determine the trim value, the unit to be trimmed receives a carrier wave at a known frequency transmitted from a Vector Signal Generator (VSG) or similar test equipment. The unit to be trimmed measures the CFO at each possible trim value and reports the trim value with the minimum offset. This value is then programmed into the OTP memory.

The following diagram shows the CALIB_XO process.

Figure 2. CALIB_XO process for receive-based approach
CALIB_XO process for receive-based approach

The VSG can be connected to the unit to be trimmed with either a cable (recommended) or antenna. The target RSSI is –50 dBm, with ±10 dB tolerance on this target. Any channel can be used as long as the VSG can transmit a carrier wave at 0.5 MHz above the channel center frequency. Theoretically, higher frequency channels would result in improved estimation accuracy, but in practice the difference is not noticeable.

The following table provides example Wi-Fi Radio test commands for performing the steps described in the algorithm.

Table 2. Wi-Fi Radio test commands for receive-based approach
Step Commands
Set operating channel (for example, channel 6)
wifi_radio_test init 6
Initiate CFO measurement sweep
wifi_radio_test compute_optimal_xo_val
Update the OTP memory register CALIB_XO with the required trim value
wifi_radio_ficr_prog otp_write_params 0x130 <minTrimVal> 

Reboot the system to activate the trim values for TX/RX operations.