User Tools

Site Tools


ideas:rfm69_frequency_trimming

RFM69 Frequency Trimming

For optimum performance all the nodes in your network need to be working on the same frequency. The RFM69’s have automatic frequency control but that has a limited range. This guide shows you how to trim the frequency of the RFM69s.

The frequency inaccuracy is caused by variations in the 32MHz crystal reference oscillator. There are two options to improve this. The first is to provide a high quality external 32MHz reference oscillator. The alternative and infinitely cheaper option is to trim the carrier frequency of the RFM69. Whilst some radio systems include a trimming arrangement for the reference clock, the RFM69 does not. One solution is to change the RF frequency word in the RFM69Config file to compensate for the error.

Receiver Calibration

Before you can start adjusting the RFM69, you first need to accurately measure the current transmit frequency. I suggest you use an SDR Dongle, either RTL or FUNcube. The first task is to calibrate the Dongle. There aren’t any VHF/UHF standard frequency transmissions around so we need to use an in-service transmitter of known accuracy. The choice is very much down to location due to the range limitations of VHF transmissions. A good option is amateur radio VHF/UHF repeaters as they are usually well maintained and so provide a good enough reference for this purpose. You can find a full list of UK repeaters here http://data.dcc.rsgb.org/ . In many parts of the country amateur radio VHF/UHF activity is very low but you can still use the repeaters for frequency checking as they transmit a CW ident every 30 minutes. To calibrate the SDR dongle, first set the SDR to NFM, tune to the published frequency of the repeater and open-up the SDR Sharp configuration tool (cog symbol). Here you will see the adjustment window with the ppm compensation tool. The adjustment works in real-time which makes alignment easy. To start the calibration use the SDR Sharp zoom slider to get a close view and wait for the repeater or other reference signal to appear. As soon as it appears adjust the frequency compensation to align the received signal with the tuning point. As you get closer you can increase the zoom. The default FFT settings for SDR Sharp will probably leave you with a blocky display. To change this, go to the FFT menu on the left and increase the resolution; 65536 works well if your PC can handle it. Once aligned, make a note of the compensation value for future reference. With the receiver calibrated, you can move on to deal with the UKHASnet nodes.

Measuring a Node

Tune SDR Sharp to 869.5MHz and zoom in as close as you can whilst still capturing the transmission (about 30kHz wide). Once you capture a transmission, press the stop button to freeze the display. You can now move your cursor across the waterfall display to measure the frequency of the low frequency peak. As the shift is set to 24kHz just add half that (12kHz) to the measured frequency to find the true carrier frequency.

Correcting a RFM69

The carrier frequency of the RFM69 is determined by a three byte word that’s stored in three registers: FRF_MSB, FRF_MID and FRF_LSB. For 869.5MHz the data is 0xD9, 0x60 and 0x12. If you convert that to decimal you get 14245906. If you then divide the nominal frequency (869.5MHz) by 14245906 you get 61.03507913Hz which the frequency step size available when changing the frequency word. For the sake of this adjustment, it’s simpler to treat this as 61Hz steps.

Here’s an example. If you calculate your node carrier to be on 869.48MHz you need to increase the carrier frequency by 20kHz (869.5-869.48) to bring it on frequency. To get a 20kHz increase you need to increase the frequency word by 20,000/61 = 328. The new tuning word is therefore 14245906 + 328 = 14246234. Converting to hex gives your new frequency word which is D9 61 5A. Update the RFN69Config.h file with the new value, upload the code and check the frequency again.

NB: If you're using Windows, the Windows calculator, 'Programmer' view allows you to easily calculate hex values and do hex to decimal conversions.

That's it!

ideas/rfm69_frequency_trimming.txt · Last modified: 2014/10/19 11:38 by g4wnc-mike