Author Topic: Speeding Up The RFM69 Library  (Read 4534 times)

zingbat

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Speeding Up The RFM69 Library
« Reply #30 on: February 04, 2018, 12:02:25 PM »
Sounds great! I have receive working now and will hopefully post a proof of concept soon.

ChemE

  • Sr. Member
  • ****
  • Posts: 385
  • Country: us
    • View Profile
Re: Speeding Up The RFM69 Library
« Reply #31 on: February 05, 2018, 05:36:59 AM »
I would love to see the code extended to a working receive!  Please post it for everyone when you get a chance.

LukaQ

  • Full Member
  • ***
  • Posts: 247
  • Country: si
    • View Profile
Re: Speeding Up The RFM69 Library
« Reply #32 on: April 10, 2018, 08:43:02 AM »
hey ChemE, do you have gateway also available for this?
And I don't know where you set 915M or 868M freq.
« Last Edit: April 10, 2018, 09:39:13 AM by LukaQ »

ChemE

  • Sr. Member
  • ****
  • Posts: 385
  • Country: us
    • View Profile
Re: Speeding Up The RFM69 Library
« Reply #33 on: April 10, 2018, 02:10:50 PM »
hey ChemE, do you have gateway also available for this?
And I don't know where you set 915M or 868M freq.

When the module powers up, it is already set to 915MHz so I don't bother setting the carrier frequency.  To change it is 868MHz though you would use the following:

Code: [Select]
  // Change the carrier frequency to 868MHz
  writeReg( REG_FRFMSB, 0xD9 );
  writeReg( REG_FRFMID, 0x00 );
  writeReg( REG_FRFLSB, 0x00);

My gateway is not quite finished yet.  I have been successful in listening for packets and detecting payloadready in DIO0 though.

LukaQ

  • Full Member
  • ***
  • Posts: 247
  • Country: si
    • View Profile
Re: Speeding Up The RFM69 Library
« Reply #34 on: April 10, 2018, 03:31:28 PM »
what is you cpu freq.? You've set TWBR=1, which would mean that i2c clock would be very fast, 888kHz? Prescaler is 1?
I have too much capacitance on bus, I had to go with 48.

I can confirm, that is works with si7021, this would then also work with si7051.
But would like to ask, if 278 for Vcc is correct? as far as I know you are looking at bandgap voltage, right?

Any reason you are going for "everything done fast as possible"?
« Last Edit: April 10, 2018, 03:35:24 PM by LukaQ »

ChemE

  • Sr. Member
  • ****
  • Posts: 385
  • Country: us
    • View Profile
Re: Speeding Up The RFM69 Library
« Reply #35 on: April 10, 2018, 04:21:08 PM »
what is you cpu freq.? You've set TWBR=1, which would mean that i2c clock would be very fast, 888kHz? Prescaler is 1?
I have too much capacitance on bus, I had to go with 48.

I can confirm, that is works with si7021, this would then also work with si7051.
But would like to ask, if 278 for Vcc is correct? as far as I know you are looking at bandgap voltage, right?

Any reason you are going for "everything done fast as possible"?

Fcpu is 16MHz yes.  278 is roughly what I measure on my Moteinos and yes my code is using the internal bandgap voltage as the reference.  As for why I'm doing everything as fast as possible, I always code that way!  I enjoy speeding code up, always have.  Things cannot break, but until they break, to me faster is better.

LukaQ

  • Full Member
  • ***
  • Posts: 247
  • Country: si
    • View Profile
Re: Speeding Up The RFM69 Library
« Reply #36 on: April 11, 2018, 02:28:15 AM »
Also very refreshing to have code without dependency. Totally different approach for doing the same job. I like your code, give me insight into how things work "in the background".
Do you have any other code like that, that you would share? maybe github?

zingbat

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Speeding Up The RFM69 Library
« Reply #37 on: May 25, 2018, 12:32:50 AM »
To circle back on this: I've built an RFM69 library that is dependency free and doesn't use interrupts (for simplicity and to keep the board in a relatively clean state after boot).

I then used that library and built a working bootloader (called Airboot) that does both serial + OTA programming without a flash chip.

Will post it as I clean it up a bit more.

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 5130
  • Country: us
    • View Profile
    • LowPowerLab
Re: Speeding Up The RFM69 Library
« Reply #38 on: May 25, 2018, 07:54:51 AM »
zingbat,
Awesome, looking forward to seeing some code!
Also can you please link in airboot, would like to take a look at that.
Thanks!

TomWS

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1682
    • View Profile
Re: Speeding Up The RFM69 Library
« Reply #39 on: May 25, 2018, 10:47:33 AM »
I'm looking forward to it as well, but, in my experience, one very important feature of an OTA boot loader is the ability to replace itself (OTA, of course).  Cuz, once you're committed to this path, you need this ability as well.

Another factor to consider is how to address radio differences (433, 898, 915, HW vs W, LoRa?).  Can it be done with a single generic BL or do you need one for each flavor? 

Tom