Author Topic: Cannot compile RFM69 ListenModeSleep Example for Moteino M0  (Read 1505 times)

kurtsmith38

  • NewMember
  • *
  • Posts: 2
Cannot compile RFM69 ListenModeSleep Example for Moteino M0
« on: December 15, 2020, 10:40:59 PM »
Hello,

New guy here...trying to get my feet wet with the Moteino M0. I have an M0 with an RFM69HW and want to experiment with the radio's listen mode. I'm attempting to compile the "ListenModeSleep" example at https://github.com/LowPowerLab/RFM69/tree/master/Examples/ListenModeSleep, but in the Arduino IDE (v1.8.13) I receive the error: #error "Please ensure chosen MCU is a SAMD21"

My code is unchanged from the posted example on github. In Arduino IDE, my selected board is Moteino M0. My board package is v1.5.0 of "LowPowerLab SAMD Boards..." package.

I'm sure I'm making a newbie mistake, but at the moment I'm stuck. Can someone point me to what I'm missing?

Thank you in advance.

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: Cannot compile RFM69 ListenModeSleep Example for Moteino M0
« Reply #1 on: December 16, 2020, 10:03:27 AM »
Quote
"Please ensure chosen MCU is a SAMD21"

This #error originates from here.

The TLDR is that the ListenModeSleep example is only applicable for AVR boards.
« Last Edit: December 16, 2020, 10:08:12 AM by Felix »

kurtsmith38

  • NewMember
  • *
  • Posts: 2
Re: Cannot compile RFM69 ListenModeSleep Example for Moteino M0
« Reply #2 on: December 16, 2020, 10:44:18 AM »
Got it, I saw that but was confused since the M0 is a SAMD21.

Do you have any RFM69 listen mode examples that are compatible with the M0?


Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: Cannot compile RFM69 ListenModeSleep Example for Moteino M0
« Reply #3 on: December 16, 2020, 02:46:30 PM »
No, because there is no WDT (watchdog) module/sleep mode on M0.

The ListenMode sleep is specifically for AVRs with WDT since WDT sleep takes around 4uA and using the ListenMode sleep would instead allow sleeping the AVR in "FOREVER" (and hence WDT off) saving an additional 2uA+ in this mode.

I added a note in that sketch to hopefully clear any confusion in the future.

Jim

  • NewMember
  • *
  • Posts: 16
Re: Cannot compile RFM69 ListenModeSleep Example for Moteino M0
« Reply #4 on: December 20, 2020, 09:39:12 PM »
>No, because there is no WDT (watchdog) module/sleep mode on M0.

in this sketch the author is using the internal RTC and it's working great. It's around 600µA if I remember correctly and receives a transmission very fast. You can even lower the power consumption if you increase the duty cycle but then of course the delay between a packet and the reception increases.

https://github.com/chocotov1/arduino-LoRa/tree/cadmode

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: Cannot compile RFM69 ListenModeSleep Example for Moteino M0
« Reply #5 on: December 21, 2020, 10:15:49 AM »
Jim,

SAMD RTC != AVR WDT

In the AVR application we are trying to save another 2uA by using this technique, not applicable to SAMD chips. That's all.