Author Topic: Definition of RxBw with RFM69  (Read 23576 times)

WhiteHare

  • Hero Member
  • *****
  • Posts: 1298
  • Country: us
Re: Definition of RxBw with RFM69
« Reply #15 on: December 27, 2015, 09:01:35 AM »
Thanks for the clarification.  That solves the mystery.  I see that Table 14 in the datasheet must be the table of allowable bandwidths that you're referring to.

I think I was thrown off by the RadioHead RF69 library, which gives "a selected subset of common modulation types" and which doesn't even mention the corresponding bandwidths:
   FSK_Rb2Fd5 = 0,      ///< FSK, Whitening, Rb = 2kbs,    Fd = 5kHz
   FSK_Rb2_4Fd4_8,    ///< FSK, Whitening, Rb = 2.4kbs,  Fd = 4.8kHz
   FSK_Rb4_8Fd9_6,    ///< FSK, Whitening, Rb = 4.8kbs,  Fd = 9.6kHz
   FSK_Rb9_6Fd19_2,   ///< FSK, Whitening, Rb = 9.6kbs,  Fd = 19.2kHz
   FSK_Rb19_2Fd38_4,  ///< FSK, Whitening, Rb = 19.2kbs, Fd = 38.4kHz
   FSK_Rb38_4Fd76_8,  ///< FSK, Whitening, Rb = 38.4kbs, Fd = 76.8kHz
   FSK_Rb57_6Fd120,   ///< FSK, Whitening, Rb = 57.6kbs, Fd = 120kHz
   FSK_Rb125Fd125,    ///< FSK, Whitening, Rb = 125kbs,  Fd = 125kHz
   FSK_Rb250Fd250,    ///< FSK, Whitening, Rb = 250kbs,  Fd = 250kHz
   FSK_Rb55555Fd50,   ///< FSK, Whitening, Rb = 55555kbs,Fd = 50kHz for RFM69 lib compatibility

Because of that, I had gathered the erroneous impression that bandwidth was a dependent value, derived from BitRate and FDEV.

Interestingly, the radiohead library states "If you need another configuration, use the register calculator.  and call setModemRegisters() with your desired settings.  "  So, it would appear that there does exist some kind of calculator for the RFM69, perhaps a spreadsheet similar to the RF22B calculator:  https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0ahUKEwjd1vGPlvzJAhXEbiYKHYyUAcwQFggcMAA&url=http%3A%2F%2Fwww.hoperf.com%2Fupload%2Frf%2FRF22B%252023B%252031B%252042B%252043B%2520Register%2520Settings_RevB1-v5.xls&usg=AFQjCNGlwgyomYH-WSWInI2winrQu1Oq6A&bvm=bv.110151844,d.eWE

Anyone seen a register calculator for the RFM69?

WhiteHare

  • Hero Member
  • *****
  • Posts: 1298
  • Country: us
Re: Definition of RxBw with RFM69
« Reply #16 on: December 27, 2015, 09:31:14 AM »
Partially answering my own question, it appears that Semtech does have a "calculator" of sorts for the SX1231.  It's documented here:  http://www.semtech.com/images/datasheet/sx1231skb-userguide.pdf

[Edit: here is a download link for the software:  http://www.semtech.com/apps/filedown/down.php?file=sx1231starter-kit-setup.exe]

However, the software doesn't seem to work without the corresponding hardware connected.   I don't see an offline mode where it could be used to what-if configurations.  :'(
« Last Edit: December 27, 2015, 09:58:15 AM by WhiteHare »

perky

  • Hero Member
  • *****
  • Posts: 873
  • Country: gb
Re: Definition of RxBw with RFM69
« Reply #17 on: December 28, 2015, 05:12:30 PM »
I've not seen a 'calculator' as such for RFM69, but a speadsheet that calculates an optimum settings from the set of RxBw and RxBwAfc values allowable and given BR would be really handy.

The RadioHead common configurations select entries in the 'modem configuration' array, which are 8 byte entries that set modulation type, Fdev, BR, RxBw and RxBwAfc. These have been pre-configured beforehand, their bandwidth values have (supposedly) been selected for you. And yes, there's no indication in the name as to what they have been set to.

Mark.

WhiteHare

  • Hero Member
  • *****
  • Posts: 1298
  • Country: us
Re: Definition of RxBw with RFM69
« Reply #18 on: January 08, 2016, 04:27:55 PM »
So, in the end did you stick with LOoffset as 20ppm?  Without a dataset of actual measurements to draw upon, or some other references that would be analogous or inform insight, I don't know what more one can do. 

With RxBw = 2.6kHz, Fdev 1.1kHz, LOoffset = 20ppm@915Mhz = 18.300kHz, it's easy to see that the Tx and Rx bandwidths might have zero overlap.  How well does the AFC actually work? 

As a supplement, I can imagine the Tx sending calibration packets over a range of different frequencies below and above its set frequency, and the Rx using the results of what it receives to better tune itself to the Tx frequency.  It's rather brute force, but maybe it would pay off if going for extreme range.  Also, it would be a way of building up a dataset to better inform what LOoffset actually is between a particular pair of transceivers.
« Last Edit: January 08, 2016, 06:41:07 PM by WhiteHare »

WhiteHare

  • Hero Member
  • *****
  • Posts: 1298
  • Country: us
Re: Definition of RxBw with RFM69
« Reply #19 on: January 28, 2016, 10:49:29 AM »
Parsing the Semtech chip defaults for the SX1231h and figuring their values, it looks like Semtech went for a pretty wide RxBwAfc of 50KHz:

Code: [Select]
Packet Mode, FSK modulation scheme
[ActualBitrate] 4799.760bps = nominal bitrate of 4800bps
[regRXBW] B1010101
[theDccFreq] B10
[RxBw] 10416Hz
  [RxBwMant] 24
  [RxBwExp] 5
[regAFCBW] B10001011
[theDccFreqAfc] B100
[RxBwAfc] 50000Hz
  [RxBwMantAfc] 20
  [RxBwExpAfc] 3
[FDev] 5004Hz
[frequency-center] 915000000Hz

That's in contrast to the calculations in the posting directly above, which suggests that at 915Mhz (the worst case) Semtech  might have gone as narrow as 10,416Hz + 18,300kHz = 28.716KHz (though in actuality, by rounding up, the next closest match in Table 14 would have been 31.3Khz). The 50Khz figure that Semtech actually settled on as its default for AFC bandwidth was much wider.  Any theories as to why?  I'm just trying to get as much insight as I can to best inform how to set AFC bandwidth when using non-default settings, and working backward from Semtech's defaults is another way to triangulate what Semtech thinks are good numbers.
« Last Edit: January 28, 2016, 01:20:57 PM by WhiteHare »

emjay

  • Full Member
  • ***
  • Posts: 120
  • Country: nl
Re: Definition of RxBw with RFM69
« Reply #20 on: January 28, 2016, 12:56:10 PM »
@WhiteHare,

Two opposing issues:

Set the AfcBw much wider than RxBw and still capture those sloppy crystals... but let in extra noise power, so not good for very weak signals and/or capture by adjacent channel activity.

I guess you pay your money and take your choice...


perky

  • Hero Member
  • *****
  • Posts: 873
  • Country: gb
Re: Definition of RxBw with RFM69
« Reply #21 on: January 28, 2016, 01:12:10 PM »
Yep, the silicon defaults are 10.4kHz for RxBw and 50kHz for RxBwAfc, it assumes a rather sloppy crystal being used. The 20ppm LOoffset difference between TX and RX assumes 10ppm crystals, reasonably common and nowadays pretty cheap, but if a 20 ppm crystal was used (cheaper run-of-the-mill crystal) at 915MHz you're looking at Fdev+ BR/2+ LOoffset = 5kHz + 2.5kHz +  36.6kHz = 44.1kHz, and the closest one to that is 50kHz.
« Last Edit: January 29, 2016, 07:22:09 AM by perky »

emjay

  • Full Member
  • ***
  • Posts: 120
  • Country: nl
Re: Definition of RxBw with RFM69
« Reply #22 on: January 28, 2016, 03:04:12 PM »
Here is some data taken from a sample of over 100 RFM69 modules at room temperature with a measuring system with better than 0.5ppm accuracy.

You see a systematic ~2.5 ppm lower than target plus a reasonable "normal" spread around that mean.
Using +/- 10ppm is a generous estimate allowing for a relatively "small" sample.
« Last Edit: January 28, 2016, 03:09:12 PM by emjay »

perky

  • Hero Member
  • *****
  • Posts: 873
  • Country: gb
Re: Definition of RxBw with RFM69
« Reply #23 on: January 29, 2016, 06:20:11 AM »
I saw that original post about crystals. This appears to show a close tolerance, but we don't know whether these modules are part of the same batch or whether the crystals were part of the same batch. In theory the manufacturer of the cystals, or the model, could be changed without our knowledge too. Given that it is best to have a low tolerance crystal, and the most common generic low cost crystal is 10ppm, it's highly probable that 10ppm spec crystals were used here and is a reasonable assumption IMO.
Mark.

emjay

  • Full Member
  • ***
  • Posts: 120
  • Country: nl
Re: Definition of RxBw with RFM69
« Reply #24 on: January 29, 2016, 09:31:58 AM »
@Mark,

Actually drawn from three different manufacturing lots, spread over about 9 months.
We are in violent agreement that 10ppm is a good working estimate.

perky

  • Hero Member
  • *****
  • Posts: 873
  • Country: gb
Re: Definition of RxBw with RFM69
« Reply #25 on: January 29, 2016, 11:25:23 AM »
OK, what do you think the spec of the crystal is?

WhiteHare

  • Hero Member
  • *****
  • Posts: 1298
  • Country: us
Re: Definition of RxBw with RFM69
« Reply #26 on: January 29, 2016, 12:26:59 PM »
What frequency were the tested crystals? 

I vaguely recollect Felix saying that the 868Mhz and 915Mhz RFM69 modules were identical (though, maybe I'm mis-remembering, and it was the LoRa modules) , and, if so, I was never clear as to which crystal was actually used on it.  Might the  ppm's be "effectively" worse if, say, it turned out to be an 868Mhz crystal forced to operate in the 902-928Mhz range?  Or would it simply not matter?


« Last Edit: January 29, 2016, 12:55:41 PM by WhiteHare »

perky

  • Hero Member
  • *****
  • Posts: 873
  • Country: gb
Re: Definition of RxBw with RFM69
« Reply #27 on: January 29, 2016, 12:37:43 PM »
The crystal is 32MHz on all modules, you can't force it to be any other. The 868MHz and 915MHz frequencies are genereated by a PLL in the chip, so they would have slightly different values programmed in their registers by software.  The 'identical' thing might be that the passives around the sx1231h, specifically around the antenna area, may have the same values as the frequencies are close.

WhiteHare

  • Hero Member
  • *****
  • Posts: 1298
  • Country: us
Re: Definition of RxBw with RFM69
« Reply #28 on: January 29, 2016, 12:51:06 PM »
Wow, I was way off the mark.   :-[   Thanks for clearing that up.

In any case, as implicitly defined in perky's calculations (above), presently:
Loffset = 2*(ppm)*(center frequency in Hz)
« Last Edit: January 29, 2016, 01:25:02 PM by WhiteHare »

emjay

  • Full Member
  • ***
  • Posts: 120
  • Country: nl
Re: Definition of RxBw with RFM69
« Reply #29 on: January 29, 2016, 01:14:41 PM »
@Mark,

Quote
The 'identical' thing might be that the passives around the sx1231h, specifically around the antenna area, may have the same values as the frequencies are close

No, the L/C values for the mesh between the chip and antenna are different values (HopeRF have different builds for 868 & 915 MHz modules)  They are similar so the mismatch with the antenna is modest, but recall that the mesh is dual function - matching and bandpass filtering to clean up the out of band hash from the Tx section. Working in the "wrong" band has an acceptable signal strength degradation (IIRC <3dBm), but risks making the spurious emissions well out of spec.