Calibrating RFM12B crystal
It was interesting Martyn presentation during JeeDay’13 about possible connectivity issues between “old” and “new” RFM12B radios (actually modules with “metal can” crystal and SMD one).
The point was that, due to manufacturing, “old” radios are tended to run on frequencies slightly lower that the median one, while “new” are on slightly higher.
Usually it should not be an issue, but in some rare cases, as I understood Martyn, people experienced some connectivity issues.
I could see two reasons to calibrate:
# For the company (JeeLabs) : to make sure that “new” radios are more compatible with “old” radios. Because of amount of work, my expectation is that it could be an extra service to fine tune or in case of issues reported.
# For the “power users” (as recommended by Martyn): tune all their radios to almost the same frequency, which is in your neighborhood as much interference-free as possible.
Other people, who have no issues, do not have to bother and even read this post ;)
It was possible to calibrate somebody radio during the JeeDay and I’ve took this chance. My CLK was measured as 10.000143 MHz with precision less than 1ppm.
But, due to limited time, we have not completed the actual calibration, meaning we have not changed the setting and measured it again to make sure that we did it right.
There is a builin opportunity in the RFM12B radio to tune the frequency by changing capacitors: “The internal load capacitance value is programmable from 8.5 pF to 16 pF in 0.5 pF steps”
Parameters in “Configuration Setting Command” (see page 15 of specs) Cxl (x0-x3) should be used for setting wanted capacitance up, which is, according to Martyn, to be done every time during initialization. Meaning it should be stored somewhere…
There is not interface to read current Cxl value, but the “measured frequency offset OFF” with sign could be read with “Status Read Command” (see page 27 of specs)
Calibration pitfalls/difficulty level¶
To perform proper calibration the CLK frequency should be measured pretty precisely. Giving the crystal frequency range is almost out of common [cheap] scopes, one needs good lab equipment to measure.
note from Martyn:
usually absolute accuracy is not needed, the requirement is to get all the modules to agree within the tolerance of the AFC circuit to adjust during each reception. So designating one unit as MASTER (maybe the central node) and then adjusting each peripheral module to align with the master is sufficient. If the Master is several PPM from ideal, it does not matter, since they all now agree on using the same (slightly inaccurate) value for the carrier.
to be followed by procedures
RE: Calibrating RFM12B crystal - Added by martynj almost 6 years ago
Buried rather deeply in this presentation (P.15, .pdf) is key data for mapping from a change to the RFM12B built in capacitor loading bank to the resulting crystal frequency delta. These are empirical values, obtained from measuring over 800 actual modules from different manufacturing batches. There is of course some variation from module to module, but the standard deviation is small, making the averaged values good enough for simple trimming.
To summarise (adding capacitance lowers the frequency; RF12 library arbitrarily initialises with the middle Cbank setting) :
* Metal can crystal ~8-10ppm ∆F/single cap bank change
* SMD type crystal ~3-3.5ppm ∆F/single cap bank change
These results match the theory well - the SMD quartz plate is physically smaller, hence “stiffer”, so requires more Cbank change to move the frequency.
The test results also showed that the SMD crystal was “better” for several parameters (lower standard error for deviation from nominal, lower temperature coefficient).
There is a small potential downside to using the Cbank for re-calibration. With full Cbank loading, the crystal may be slower to start up when the MPU supply voltage is near the lower limit (since the gain of the Pierce oscillator falls with Vcc). This was not observed in practice at room temperature, but may be seen at temperature extremes.