Author Topic: Changing the RMF69 radio configuration [+300kbps settings]  (Read 309966 times)

sid1202

  • NewMember
  • *
  • Posts: 30
  • Country: ca
Changing the RMF69 radio configuration [+300kbps settings]
« on: August 21, 2016, 08:28:50 PM »
Hi guy's,

I'm pretty new at all this but I'm learning pretty fast.

I have a project that uses the radio with it's default config quite happily, but there is one thing I'd like to implement sporadically and it's the ability to have push to talk communication between 2 of my nodes.

I was thinking of setting the radio on continuous mode and pumping my sampling directly to the transceiver via DIO2 for as long as the button is pushed (either side) and then go back to the default config. The transceiver needs to be at a bit rate greater than 64kbps for that moment.

I've been reading the datasheets and I think it can be done. Of course the range will be short for PTT but it doesn't need to be far, just a couple of hundred feet.

I found some of the registers I need to change and how I would wire this up, but implementing it in the code is a little beyond my current understanding.

Can anyone give me some hints on how to implement this ?

I'm using a Adafruit Feather 32u4 RMF69HCW with the Arduino IDE and LowPowerLab's librarie.

Thank you !

Sidney
« Last Edit: November 17, 2016, 08:54:43 PM by Felix »

sid1202

  • NewMember
  • *
  • Posts: 30
  • Country: ca
Re: Changing the RMF69HCW configuration and back
« Reply #1 on: August 22, 2016, 12:10:20 PM »
The question is RFM69HCW specific and not MCU specific. Configuring the radio uses the library calls to set the radios registers and the library is not supported by Adafruit.

emjay

  • Full Member
  • ***
  • Posts: 119
  • Country: nl
Re: Changing the RMF69HCW configuration and back
« Reply #2 on: August 22, 2016, 12:52:26 PM »
@sid1202,

Unfortunately, streaming data like that is a violation of the usage rules in the ISM band - have a look at the section on duty cycle.

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: Changing the RMF69HCW configuration and back
« Reply #3 on: August 22, 2016, 06:59:39 PM »
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.

sid1202

  • NewMember
  • *
  • Posts: 30
  • Country: ca
Re: Changing the RMF69HCW configuration and back
« Reply #4 on: August 22, 2016, 09:10:38 PM »
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.

That's exactly it. Being fairly new to this, I'm having a hard time understanding the relationships. I understand most of the individual settings, but that's it.

Heres what I got so far

RegDataModul (0x02)   01100000 -> Set to Continuous mode

RegBitrateMsb and RegBitrateLsb have multiple choices but thease are the ones I think make most sense

BitRate   BitRate   (G)FSK
(15:8)    (7:0)    (G)MSK

0x01    0xA1    76.8 kbps
0x01    0x16    115.2 kbps

RegDioMapping defaults maps DIO2 to data all the time

But  just realized that althought I can trigure the mode change when the button is push on both sides, I'm not sure how I can inform the receiver the the button has been release on the sending side.

This bring me to another possibility, simply increase the BR to 115.2 kbps and send the audio in packets with a control byte at one end

What do you think ?

BTW, is it ok to just set the bit rate to 115.2 kbps or do I have to figure out the bandwidth and frequency that goes with it ?

Sidney

sid1202

  • NewMember
  • *
  • Posts: 30
  • Country: ca
Re: Changing the RMF69HCW configuration and back
« Reply #5 on: August 25, 2016, 06:18:56 AM »
I provide a good all-around set of settings in the library, otherwise the library is AS-IS and comes with no strings attached.

I've been going at this for a month, reading datasheets and code and now I'm a little lost. If you would be kind enough to point me to where those settings are and how to use them I'd greatly appreciate it.

Thank you,
Sidney

sid1202

  • NewMember
  • *
  • Posts: 30
  • Country: ca
Re: Changing the RMF69HCW configuration and back
« Reply #6 on: September 08, 2016, 06:47:12 AM »
It's crazy. I've been looking to find which other registers to change and at what value to get the highest transfer rate  possible and I can't get an answer anywhere.

I understand the procedure to implement it, I just don't know the values. The highest transfer rate  I managed to achieve is about 16 kb/s with the BR set at 250

There is something I don't understand about the configuration procedure and no matter where i look all a get is basically just a list of settings but not the relationship between them.

one example is deviation. Should I configure it low (5kHz) or high (closer to 500 kHz).

I know that by reducing the amount of control bytes and increasing the payload I'll get faster transfers, but the difference is to high at the moment to make any real difference.

To maximize the I.m pretty sure I need to tweak the bit rate (reg 0x03 & 0x04)  but that needs to be matched by changes to the bandwidth (0x19), the frequency deviation (0x05 & 0x06) and the Channel Filter BW control (0x1A). Also may be required to tweak the Packet mode settings (0x37) and the Data operation mode and Modulation settings (0x02)

I'm just amazed no one tried to push the transfer rate before. If someone did I can't find the info anywhere.

I don't know if I express my self badly in English or what but I seams to get a lot of dead air when I ask questions. If I do come across as "different" please accept my apologies, English is not my native language.

Regards,

Sidney

perky

  • Hero Member
  • *****
  • Posts: 873
  • Country: gb
Re: Changing the RMF69HCW configuration and back
« Reply #7 on: September 08, 2016, 08:27:36 AM »
Have you seen this thread?
https://lowpowerlab.com/forum/rf-range-antennas-rfm69-library/definition-of-rxbw-with-rfm69/

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.

In summary the rules are:
1)  0.5 <= 2 * Fdev/BR <= 10    (modulation index, MI)
2)  BR < 2*RxBw     (bit rate)
3)  RxBw >= Fdev + BR/2   (receiver bandwidth)
4)  RxBwAfc >=  Fdev + BR/2 + LOoffset (receiver AFC bandwidth)
5)  Fdev + BR/2 < 500kHz  (maximum RxBw setting)

Mark.

sid1202

  • NewMember
  • *
  • Posts: 30
  • Country: ca
Re: Changing the RMF69HCW configuration and back
« Reply #8 on: September 08, 2016, 12:38:47 PM »
I did. but its been a few weeks since I read it and I've learned a lot since then. But there are a few things in this thread that I don't understand and I would need someone to clarify a few things. I will go through this thread a few more times.

My work load goes down in the winter. I think I will write a tutorial.  If some other people are willing to help revise and correct it as I go they will be most welcome.

Sid

sid1202

  • NewMember
  • *
  • Posts: 30
  • Country: ca
Re: Changing the RMF69HCW configuration and back
« Reply #9 on: September 08, 2016, 07:59:45 PM »

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.

That's just it, these to node will be plugged in and act as a bridge between 2 sub nets. My shop is to fare for wireless unless I got high end which is very costly. Wired, which I try to avoid. The house sensors will all send data to a local interface. It will "massage" the data and send it to the shop's interface through the bridge and vise versa. This way whether I'm at the shop or the house I can the state of all my sensors. I'll also have one device as a remote interface. This one will be low speed for greater range and will only give me critical information unless I explicitly request it to get detailed information for a particular system.

Each subnet will be layered. I'll have a coupe of complex enclosed system that will have a few nodes wired together with one node as a gateway. All nodes in a room will communicate through IR to a higher level gateway. Each room/area's gateways will communicates to the interface via radio (more economical than Bluetooth or wifi too) I'd like to be able to transmit security images from the shop to the house, and be able to speak to customers or intruders at the shop from the house.

I breadboarded several systems. I've sent and received data sturtures both ways successfully. Even tested my remote to over 1000 feet with just a wire antenna and in the middle of the house at ground level. So with a external antenna on the roof, I should get really good coverage. But and when I calculate the time it would take to transfer a jpeg, the radio's would be pegged for to long. Also, If I want to send speach I need to get 57.x kp/s minimum. Ideally 64kp/s.

Since most people using the radios are most interested in range and precise transmission, finding how to configure for that is easy. There are even many tweaks on the web for many particular situation. I found one than communicates with a micro satellite at very low bandwidth. On the other hand, I haven't found any projects that *successfully* used the full bandwidth capacity of the radio in short range when power is no object. so finding the right settings, at the very least close enough, has been a nightmare.

When we buy a car, we don't necessarily want to control the chemistry that is happening in our catalytic converter's but we want to be able to go slow or fast as the needs appear. When I bought these radio's I expected to have to know a little more that just turn a knob, but I did not expect to have to become a radio engineer. It's as if you buy a car with a bag of gears in the trunk of different sizes and they tell you to go fast change the gears in the transmission.

I digress.... and a little annoyed of the one sided information available for this radio.

I've been at this problem for to long without progress. I'm starting to look at other solutions, albeit more expensive and more complicated, that might be possible to implement. Maybe using IoT and or installing parabolic wifi antennas.

Anyway, I had a hard days at work and I think I need to rest. I'll look at this with a fresh eye tomorrow.

Thank you,
Sidney

sid1202

  • NewMember
  • *
  • Posts: 30
  • Country: ca
Re: Changing the RMF69HCW configuration and back
« Reply #10 on: September 10, 2016, 07:51:53 AM »
Thanks Mark for getting me to read this thread again.  :)

I'm still overwhelmed by the volume of information and relationships between all the parameters, I am starting to understand a little more.

Since this part of my project will be hardwired, battery usage is not an issue. Also range is no as important but not negligible.  I've managed to get the Semtech starter kit running but there are still some aspects of relationships that are still foggy. For example for a given bitrate, lets say 250 kbps, there is a range of valid FDev values but I don't quite get which way does what.  what is the impact of having a Fdev value on the low side compared to having it on the high side of the valid Fdev range.

What I'm also struggling with is what to concentrate on first. There are many parameters to consider. Am I correct that I should learn in the order of the rules ?

Here what I understand and are some of the questions I'm trying to answer:

Rule 1)  0.5 <= 2 * Fdev/BR <= 10    (modulation index, MI)
This is for transmitting ?, do I want to be closer to 0.5 or to 10 ?

Rule 2)  BR < 2*RxBw     (bit rate)
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)
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)
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)
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.

What should I try to figure out first ?

sid1202

  • NewMember
  • *
  • Posts: 30
  • Country: ca
Re: Changing the RMF69HCW configuration and back
« Reply #11 on: September 10, 2016, 08:18:42 AM »
I also found a related thread about optimizing power here https://lowpowerlab.com/forum/rf-range-antennas-rfm69-library/optimizing-radio-settings-for-power-(rfm69whw)/that is pretty interesting. When I first went through the forum and I saw this title, I skip it thinking it was something about batteries. This time I caught on and read the tread.

Sid

perky

  • Hero Member
  • *****
  • Posts: 873
  • Country: gb
Re: Changing the RMF69HCW configuration and back
« Reply #12 on: September 10, 2016, 09:33:37 AM »
All the rules really need to be understood if you are going to set your own values  ;).

Quote
Rule 1)  0.5 <= 2 * Fdev/BR <= 10    (modulation index, MI)
This is for transmitting ?, do I want to be closer to 0.5 or to 10 ?
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

Quote
Rule 2)  BR < 2*RxBw     (bit rate)
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 ?
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:
RxBw >= BR/2.

Quote
Rule 3)  RxBw >= Fdev + BR/2   (receiver bandwidth)
Pretty sure this sets the receiver settings limits. Should it be set as close to the limit as possible ?
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.

Quote
Rule 4)  RxBwAfc >=  Fdev + BR/2 + LOoffset (receiver AFC bandwidth)
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.
See the above link for a really good discussion on AFC, that Freescale chip uses a rebadged sx1231 silicon.

Quote
Rule 5)  Fdev + BR/2 < 500kHz  (maximum RxBw setting)
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.
Correct.

« Last Edit: September 10, 2016, 06:25:14 PM by perky »

sid1202

  • NewMember
  • *
  • Posts: 30
  • Country: ca
Re: Changing the RMF69HCW configuration and back
« Reply #13 on: September 10, 2016, 02:06:07 PM »
Quote
All the rules really need to be understood if you are going to set your own values  ;).

I see that, everything is inter dependent...

Quote
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

This is the one part that is the hardest to wrap my mind around. I took a quick look at the document and it very clear. I'll read it through. If I can get this rule down pat, the rest will slide. But with waht you stated I understand the the MI is basically how loud the signal is. If the MI is to low, the receiver can't "hear" properly but is its to loud, the message gets distorted. Like putting a cheap stereo at high.

This feels like I finally found the wiper control while driving in a storm.

Thank you so much. I'll go through the document this weekend.

Sid

perky

  • Hero Member
  • *****
  • Posts: 873
  • Country: gb
Re: Changing the RMF69HCW configuration and back
« Reply #14 on: September 10, 2016, 03:26:29 PM »
OK, this modulation index is a little difficult to get to grips with. This paper might shed more light:
www.silabs.com/Marcom%20Documents/Resources/FMTutorial.pdf

If you look at figure 2 you'll see a table showing the number of sidebands and their relative amplitudes for different betas (i.e. modulation indices). Look carefully at the coefficients and you'll see at high MI there are two energy peaks with the amount of energy near the centre frequency getting less and less as MI increases, and the number of sidebands increases, increasing the bandwidth. For eample with a beta of 5, the fourth sideband  J4 has an amplitude of 0.39 whereas the centre frequency J0 itself only has -0.18, so there are two peaks, one either side of the centre frequency (like a double humped camel).  The shape for a beta of 1 though only has one peak at the centre and far fewer sidebands (like a single humped camel).
 
Mark.