Ok I think what you're looking for is a custom set of settings. There are certain relationships between settings when you change the basic settings like bitrate, bandwidth, frequency etc. These are covered in the datasheet but it's tedious work. I provide a good all-around set of settings in the library, otherwise the library is AS-IS and comes with no strings attached.
If you write to registers you should not have to reset anything. I don't think you should worry about bricking.
Usually changing from a radio mode to another will cause the changes to take effect.
I provide a good all-around set of settings in the library, otherwise the library is AS-IS and comes with no strings attached.
It details the relationship between frequency deviation, bit rate and receiver bandwidth. Your goal to get maximum range is to have the smallest allowable receiver bandwidth for a given bit rate. Of course you might want to have high bit rate to reduce transmission time to save battery power so these settings then become a compromise between range and battery use.
Mark.
Rule 1) 0.5 <= 2 * Fdev/BR <= 10 (modulation index, MI)Modulation index really shapes the energy distribution in the transmitted signal bandwidth. A high MI spreads the energy into two that have peaks around the two modulation frequencies (i.e. Fc + Fdev, and Fc - Fdev where Fc is the centre frequency). The higher the index the more energy is centred, but spread more, around those two regions with not much in the centre. A low MI makes the energy peak around the centre frequency. This can be important when considering that the receiver bandwidth RxBw has to cover (practically) all the signal bandwidth, a low MI essentially reduces the sidebands and allows the receiver bandwidth to be smaller. The limits of 10 to 0.5 are set by the radio's ability to demodulate them.
This is for transmitting ?, do I want to be closer to 0.5 or to 10 ?
Rule 2) BR < 2*RxBw (bit rate)I think this is a natural limit that drops out of other equations, if you had very small Fdev or equal to zero then rule 3) would become:
This determines the maximum biterate relationship between the transmitter and the receiver. Having the BR closer to 2*RxBw rather than further away will have what consequences ?
Rule 3) RxBw >= Fdev + BR/2 (receiver bandwidth)Yes, this is derived from Carson's rule for the bandwidth of a transmitted FM signal and represents 98% of the energy of the signal. You should make RxBw as small as possible while still meeting this equation.
Pretty sure this sets the receiver settings limits. Should it be set as close to the limit as possible ?
Rule 4) RxBwAfc >= Fdev + BR/2 + LOoffset (receiver AFC bandwidth)See the above link for a really good discussion on AFC, that Freescale chip uses a rebadged sx1231 silicon.
This rule is only applicable if AFC is enabled. I haven't looked into that much yet, so I'm not sure what AFC does except for the basic definition. But I think I can look into that last.
Rule 5) Fdev + BR/2 < 500kHz (maximum RxBw setting)Correct.
This one a simply a hard limit to the RxBw setting. I think that this rules means that what ever values you choose in the 4 previous rules This rule can't be broken.
All the rules really need to be understood if you are going to set your own values ;).
Modulation index really shapes the energy distribution in the transmitted signal bandwidth. A high MI spreads the energy into two that have peaks around the two modulation frequencies (i.e. Fc + Fdev, and Fc - Fdev where Fc is the centre frequency). The higher the index the more energy is centred, but spread more, around those two regions with not much in the centre. A low MI makes the energy peak around the centre frequency. This can be important when considering that the receiver bandwidth RxBw has to cover (practically) all the signal bandwidth, a low MI essentially reduces the sidebands and allows the receiver bandwidth to be smaller. The limits of 10 to 0.5 are set by the radio's ability to demodulate them.
To illustrate that, take the two equations from the rules:
1) MI = 2 * Fdev/BR, and
3) RxBw >= Fdev + BR/2.
We can find Fdev in terms of BR from 1):
Fdev = MI * BR/2, and substitute into 3):
RxBw >= (MI * BR/2) + BR/2.
Note that for smaller MI values RxBw is also smaller. So if your goal is to get long range and have a low RxBw you'd be better off using a low MI (MI is also known as beta). However, there are complications with very low beta signals because of the way the RxBw filter actually works in the radio (without getting too technical there's a 'notch' in the centre and that is where most of the energy is).
If you want more details see www.nxp.com/files/rf_if/doc/app_note/AN4983.pdf
For instance, if β=0.25, only one sideband is needed; while if β=5, eight sidebands are required, and a few phrases later
The bandwidth is equal to the number of discrete spectral tones multiplied by the frequency spacing set by the message signal frequencyexplaining that the side bands are required and how to determine the number of sidebands but How are the side bands used ? do they contain parallel data ?
As the modulation index increases it is found that other sidebands at twice the modulation frequency start to appear.So the side bands are a resonances effect of the frequency deviation and the signal frequency and are not wanted ??? or are they required ... I'm lost...
in North
America, the maximum frequency deviation, f∆ , is 75 kHz for commercial FM broadcasting. If the maximum message frequency is equal to 15 kHz for audio, then 51575 == kHzkHzβ
const uint8_t CONFIG[][2] = {
{ REG_OPMODE, RF_OPMODE_SEQUENCER_ON | RF_OPMODE_LISTEN_OFF | RF_OPMODE_STANDBY }, // 0x01
{ REG_DATAMODUL, RF_DATAMODUL_DATAMODE_PACKET | RF_DATAMODUL_MODULATIONTYPE_FSK | RF_DATAMODUL_MODULATIONSHAPING_00 }, // 0x02
{ REG_BITRATEMSB, RF_BITRATEMSB_300000 }, // 0x03
{ REG_BITRATELSB, RF_BITRATELSB_300000 }, // 0x04
{ REG_FDEVMSB, RF_FDEVMSB_300000 }, // 0x05
{ REG_FDEVLSB, RF_FDEVLSB_300000 }, // 0x06
{ REG_FRFMSB, RF_FRFMSB_915 }, // 0x07
{ REG_FRFMID, RF_FRFMID_915 }, // 0x08
{ REG_FRFLSB, RF_FRFLSB_915 }, // 0x09
{ REG_RXBW, RF_RXBW_DCCFREQ_111 | RF_RXBW_MANT_16 | RF_RXBW_EXP_0 }, // 0x19
{ REG_DIOMAPPING1, RF_DIOMAPPING1_DIO0_01 }, // 0x25
{ REG_DIOMAPPING2, RF_DIOMAPPING2_CLKOUT_OFF }, //0x26
{ REG_IRQFLAGS2, RF_IRQFLAGS2_FIFOOVERRUN }, // 0x28
{ REG_RSSITHRESH, 220 }, // 0x29
{ REG_PREAMBLELSB, RF_PREAMBLESIZE_LSB_VALUE }, // 0x2D
{ REG_SYNCCONFIG, RF_SYNC_ON | RF_SYNC_FIFOFILL_AUTO | RF_SYNC_SIZE_2 | RF_SYNC_TOL_0 }, // 0x2E
{ REG_SYNCVALUE1, 0x2D }, // 0x2F
{ REG_SYNCVALUE2, networkID }, // 0x30
{ REG_PACKETCONFIG1, RF_PACKET1_FORMAT_VARIABLE | RF_PACKET1_DCFREE_OFF | RF_PACKET1_CRC_OFF | RF_PACKET1_CRCAUTOCLEAR_OFF | RF_PACKET1_ADRSFILTERING_OFF }, // 0x37
{ REG_PAYLOADLENGTH, 66 }, // 0x38
{ REG_FIFOTHRESH, RF_FIFOTHRESH_TXSTART_FIFONOTEMPTY | RF_FIFOTHRESH_VALUE }, // 0x3C
{ REG_PACKETCONFIG2, RF_PACKET2_RXRESTARTDELAY_2BITS | RF_PACKET2_AUTORXRESTART_ON | RF_PACKET2_AES_OFF }, // 0x3D
{ REG_TESTDAGC, RF_DAGC_IMPROVED_LOWBETA0 }, // 0x6F
{ 255, 0 }
};