How do I use the CTUNE token for EFR32?
The EFR32 38.4MHz crystal does not require external loading caps, as there is a tunable capacitor bank in the EFR32 that can be used instead. Different tune values can be written to registers to observe the corresponding frequency offset, and the CTUNE token is used to store the value for use by the application. Here in this example, we refer to nodetest commands.
Once your EFR32 device is programmed with nodetest, if you enter “tokdump” you should see the ctune token amongst the tokens reported:
[C354] MFG_CTUNE FF FF
Note that there are also nodetest commands "setCtune" and "getCtune" where you can set and read the CTUNE register values. This is helpful if you want to try multiple specific ctune values and measure their affect prior to writing the token. From the nodetest "help" output:
setCtune u4 - set CTUNE registers (CMU->HFXOSTEADYSTATECTRL_CTUNE and CMU->HFXOSTARTUPCTRL_CTUNE)
getCtune - get CTUNE register value
A default / erased value for MFG_CTUNE corresponds to using the nodetest default ctune register value of 0x142. The EFR32 reference manual provides a formula for ctune:
Sets oscillator tuning capacitance.
Capacitance on HFXTAL_N and HFXTAL_P (pF) = Ctune = Cpar + CTUNE<8:0> x 40fF.
Max Ctune 25pF (CLmax ~12.5pF)
CL(DNLmax)=50fF ~ 0.6ppm (12.5ppm/pF)
With this calculation, the default of 0x142 (322 decimal) and no loading caps installed (as is the case with the BRD4151A modules in the WSTK) corresponds to a capacitance of 12.8pF.
You can issue the nodetest command "tokWrite c354" to write this token:
tokWrite u2 - Write all data of a token (u2=creator code)
Similar set/get of CTUNE register values can be achieved with RAIL test as well. See the RAIL test user documentation for additional details.
Setting CTUNE token can also be achieved via Simplicity Commander. See the Simplicity Commander User Guide UG162 for additional details on setting tokens.