Author Topic: RFM12B Attiny84a  (Read 3876 times)

Kitsibas

  • Newbie
  • *
  • Posts: 8
RFM12B Attiny84a
« on: September 01, 2013, 11:30:23 AM »
Hi,

Anybody use attiny with RFM12B library? When I try to compile example send sketch gets the following error message:

Code: [Select]
D:\Arduino\arduino-1.0.5\libraries\RFM12B/RFM12B.h:200: error: 'SLEEP_MODE_STANDBY' was not declared in this scope

Any ideas?

Regards!

iqb

  • Newbie
  • *
  • Posts: 2
Re: RFM12B Attiny84a
« Reply #1 on: October 30, 2013, 05:57:07 AM »
Hi, this is because the standby mode for attiny84 is called (SLEEP_MODE_PWR_SAVE).
You can change this in RFM12B.h. Find:
Code: [Select]
    void SendStart(uint8_t toNodeId, const void* sendBuf, uint8_t sendLen, bool requestACK=false, bool sendACK=false, uint8_t waitMode=SLEEP_MODE_STANDBY);
    void Send(uint8_t toNodeId, const void* sendBuf, uint8_t sendLen, bool requestACK = false, uint8_t waitMode=SLEEP_MODE_STANDBY);


and change it with :
Code: [Select]
	#if defined(__AVR_ATtiny84__)
    void SendStart(uint8_t toNodeId, const void* sendBuf, uint8_t sendLen, bool requestACK=false, bool sendACK=false, uint8_t waitMode=SLEEP_MODE_PWR_SAVE);
    void Send(uint8_t toNodeId, const void* sendBuf, uint8_t sendLen, bool requestACK = false, uint8_t waitMode=SLEEP_MODE_PWR_SAVE);
#else
    void SendStart(uint8_t toNodeId, const void* sendBuf, uint8_t sendLen, bool requestACK=false, bool sendACK=false, uint8_t waitMode=SLEEP_MODE_STANDBY);
    void Send(uint8_t toNodeId, const void* sendBuf, uint8_t sendLen, bool requestACK = false, uint8_t waitMode=SLEEP_MODE_STANDBY);
#endif

This solves the standby issue, but when I try to send a pkt, the compiler returns a few relocation errors I don't know how to handle:
Code: [Select]
c:/arduino/arduino-1.0.5/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/lib/avr25/crttn84.o:(.init9+0x2): relocation truncated to fit: R_AVR_13_PCREL against symbol `exit' defined in .fini9 section in c:/arduino/arduino-1.0.5/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/avr25\libgcc.a(_exit.o)

any suggestions?

iqb

  • Newbie
  • *
  • Posts: 2

Lensdigital

  • Full Member
  • ***
  • Posts: 151
    • Xronos Clock
Re: RFM12B Attiny84a
« Reply #3 on: November 01, 2014, 02:16:29 PM »
Did anyone actually got Attiny84 working with RFM12b?  I got mine to compile no issues (after modifying library as suggested, thanks!) , it even gets thru radio init, but it's not sending anything out :(
Check out my hand made open source Xronos Alarm Clock!
http://www.xronosclock.com

Spexx

  • Newbie
  • *
  • Posts: 30
  • Country: de
Re: RFM12B Attiny84a
« Reply #4 on: November 07, 2014, 02:19:54 PM »
The JeeLib library (https://github.com/jcw) works great with the RFM12B module and an Attiny84.
Here you will find also many helpful information and some sketches for different sensors:
http://nathan.chantrell.net/tinytx-wireless-sensor/