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.
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.
| Step | Commands |
|---|---|
| Set crystal oscillator offset to trimVal |
|
| Transmit a modulated packet (for example, legacy 6 Mbps in 2.437 GHz) |
|
| Alternative - transmit a carrier wave (for example, at 2.439 GHz) |
|
| Update the OTP memory register CALIB_XO with the required trim value |
|
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.
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.
| Step | Commands |
|---|---|
| Set operating channel (for example, channel 6) |
|
| Initiate CFO measurement sweep |
|
| Update the OTP memory register CALIB_XO with the required trim value |
|
Reboot the system to activate the trim values for TX/RX operations.