Author Topic: RFM69HW Bit Rate Settings  (Read 18510 times)

chalupien

  • NewMember
  • *
  • Posts: 21
RFM69HW Bit Rate Settings
« on: March 03, 2014, 08:58:12 PM »
Hi, What settings do I change to lower the bitrate / baud rate of the rfm69hw?

In the RFM69 Library, I can see the registers for many different bit rates, and in the function to initialize the RFM69 radio it looks like its setting the bit rate. Begin of CONFIG sent to radio

  const byte CONFIG[][2] =
  {
    /* 0x01 */ { REG_OPMODE, RF_OPMODE_SEQUENCER_ON | RF_OPMODE_LISTEN_OFF | RF_OPMODE_STANDBY },
    /* 0x02 */ { REG_DATAMODUL, RF_DATAMODUL_DATAMODE_PACKET | RF_DATAMODUL_MODULATIONTYPE_FSK | RF_DATAMODUL_MODULATIONSHAPING_00 }, //no shaping
    /* 0x03 */ { REG_BITRATEMSB, RF_BITRATEMSB_55555}, //default:4.8 KBPS
    /* 0x04 */ { REG_BITRATELSB, RF_BITRATELSB_55555},
    /* 0x05 */ { REG_FDEVMSB, RF_FDEVMSB_50000}, //default:5khz, (FDEV + BitRate/2 <= 500Khz)
    /* 0x06 */ { REG_FDEVLSB, RF_FDEVLSB_50000},

....

Which ones do I need to change and how to lower the bit rate?

Nick

NixHydra

  • NewMember
  • *
  • Posts: 41
Re: RFM69HW Bit Rate Settings
« Reply #1 on: March 04, 2014, 01:53:53 AM »
Hi Nick,

You can change the bit rate by changing the contents of the RFM69 registers, 0x03 and 0x04.

Please see fig(a) attachment, RFM69 library syntax for setting registers 0x03 and 0x04, for a bit rate of 9600.
                  fig(b) attachment, register 0x03, RFM69HW datasheet, page 63.
                  fig(c)  attachment, register 0x04, RFM69HW datasheet, page 64.
                  fig(d)  attachment, bit rate examples, RFM69HW datasheet, page 20.

Hope this helps.

                      cheers,


Tomme

  • NewMember
  • *
  • Posts: 24
Re: RFM69HW Bit Rate Settings
« Reply #2 on: March 05, 2014, 04:47:06 AM »
Quick question on a related subject, the RFM69 library claims the default bitrate is 4800 but what is actually used is RF_BITRATEMSB_55555(0x02) and RF_BITRATELSB_55555 (0x40) which isn't 4800bd its 55.555k. Am I missing something? If not it's worth cleaning up the comments in the code to say this OR actually use 4800 as the comments suggest.

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: RFM69HW Bit Rate Settings
« Reply #3 on: March 05, 2014, 07:58:06 AM »
The default power-on is 4800. Checking the datasheet is sometimes useful ;)

Tomme

  • NewMember
  • *
  • Posts: 24
Re: RFM69HW Bit Rate Settings
« Reply #4 on: March 05, 2014, 10:14:17 AM »
Righto thanks, much appreciated!

I did check the data sheet, but I think my comment re: code comments stands.

Quote
//default:4.8 KPBS

Could be better put as:

//default power-on bitrate is 4.8 kpbs, change to 55.5 kbps.

Something to the same effect could be put in RFM69registers.h ?



Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: RFM69HW Bit Rate Settings
« Reply #5 on: March 05, 2014, 10:16:04 AM »
Yes, a lot of the code comments could be rewritten more verbosely

Tomme

  • NewMember
  • *
  • Posts: 24
Re: RFM69HW Bit Rate Settings
« Reply #6 on: March 05, 2014, 10:33:10 AM »
I'd be happy to help with such things if you were interested?

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: RFM69HW Bit Rate Settings
« Reply #7 on: March 05, 2014, 10:48:08 AM »
Thanks, I will need to revise some of the comments whenever I get some time for that, but quite low priority right now

Samwise

  • NewMember
  • *
  • Posts: 1
Re: RFM69HW Bit Rate Settings
« Reply #8 on: January 22, 2015, 08:07:52 AM »
I'm sorry for bringing this topic up again but I'm wondering why the RFM69 library changes the default bitrate from 4800 to 55555? Probably because a higher speed is prefered, but then why not selecting one of the more regular bitrates like 57600?

Just bought 2 moteino's and I'm trying to get familiar with the code base :)

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: RFM69HW Bit Rate Settings
« Reply #9 on: January 22, 2015, 08:59:33 AM »
No particular reason. You can change to 57600 if you'd like.

TomWS

  • Hero Member
  • *****
  • Posts: 1930
Re: RFM69HW Bit Rate Settings
« Reply #10 on: January 22, 2015, 03:01:40 PM »
I'm sorry for bringing this topic up again but I'm wondering why the RFM69 library changes the default bitrate from 4800 to 55555? Probably because a higher speed is prefered, but then why not selecting one of the more regular bitrates like 57600?

Just bought 2 moteino's and I'm trying to get familiar with the code base :)
I think Felix used to have a girlfriend with '55555' for her telephone number  :)

Seriously, as Felix alluded, I think this value is pretty arbitrary.  There isn't any reason why it would need to match a standard UART baud rate (other than the fact that is does make the rest of us wonder about it)  ;)

Tom

LukaQ

  • Sr. Member
  • ****
  • Posts: 302
  • Country: si
Re: RFM69HW Bit Rate Settings
« Reply #11 on: January 31, 2018, 09:30:36 AM »
Has anyone played with setting for Fdev and Bitrate or are you using what comes set? I find that low BR and high Fdev or other way around don't work, the ones that do work are around what come default with library and based on RSSI (high 40s), it doesn't get any better. Should I be testing with nodes more apart?

perky

  • Hero Member
  • *****
  • Posts: 873
  • Country: gb
Re: RFM69HW Bit Rate Settings
« Reply #12 on: January 31, 2018, 11:50:14 AM »
There are rules for FDEV, BR and RXBW that need to be followed. Give that RXBW is quantised (i.e. only certain values are selectable) the BR and FDEV being variable allows a system to be optimised. Often there are additional constraints like channel widths to take into account, oscillator drift and accuracy etc. Personally I like to keep the modulation index above 2 if I can so low beta compensation is not needed, see this post:

https://lowpowerlab.com/forum/rf-range-antennas-rfm69-library/definition-of-rxbw-with-rfm69/

Mark.

LukaQ

  • Sr. Member
  • ****
  • Posts: 302
  • Country: si
Re: RFM69HW Bit Rate Settings
« Reply #13 on: January 31, 2018, 02:46:42 PM »
How do you set gateway then? If you have higher speed nodes (let's say as is at 55.5k) and some low speed ones (2.4-4.8k), that let's say are far away and you need to do this because of signal strength. Can you mix such node on one gateway?

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: RFM69HW Bit Rate Settings
« Reply #14 on: January 31, 2018, 04:19:04 PM »
Can you mix such node on one gateway?
You could just change the settings for each bitrate to match that of the sending node, but how do you know when to listen to which one?