JeeLib for RFM69CW connected to ATTiny88

Added by sanb about 1 year ago


I am beginning to use ATTiny88 (instead of ATTiny84 which I have been using so far) with an RFM69CW connected to it.

My question is: Will JeeLib work on ATTiny88/48? If not, is it possible to port it for ATT88/48?

My (very) quick attempt at compiling code that currently works on ATT84+RFM69CW gave compile-time errors in JeeLib. Following is the error message:

Archiving built core (caching) in: /tmp/arduino_cache_904757/core/core_ATTinyCore_avr_attinyx8_LTO_disable,chip_88,clock_8internal,eesave_aenable,bod_disable_e4494528da289b44acb2fb07b9e4f645.a
libraries/jeelib-master/Ports.cpp.o: In function `Sleepy::loseSomeTime(unsigned int)':
/export/home/langur/sbhatnag/Arduino/libraries/jeelib-master/Ports.cpp:1176: undefined reference to `timer0_millis'
/export/home/langur/sbhatnag/Arduino/libraries/jeelib-master/Ports.cpp:1176: undefined reference to `timer0_millis'
/export/home/langur/sbhatnag/Arduino/libraries/jeelib-master/Ports.cpp:1176: undefined reference to `timer0_millis'
/export/home/langur/sbhatnag/Arduino/libraries/jeelib-master/Ports.cpp:1176: undefined reference to `timer0_millis'
/export/home/langur/sbhatnag/Arduino/libraries/jeelib-master/Ports.cpp:1176: undefined reference to `timer0_millis'
libraries/jeelib-master/Ports.cpp.o:/export/home/langur/sbhatnag/Arduino/libraries/jeelib-master/Ports.cpp:1176: more undefined references to `timer0_millis' follow
collect2: error: ld returned 1 exit status
exit status 1
Error compiling for board ATtiny48/88.

Some additional information: The error comes from the Sleepy::loseSomeTime() method. If this is not used, the code that uses JeeLib compiled. I haven't yet run it on the MCU (awaiting the arrival of the chips in a few days).

Some more information: I have been studying the code, primarily to find out if ATT88 is pin-compatible with ATMega328. If it is, then I am hoping that JeeLib would work on ATT88 (or can be made to work with some effort). From pin labeling, they do appear pin compatible. I also found the following application note which does say that they are pin compatible. Following is also a link to the ATT88 datasheet:

But there are also differences mentioned in this note, but I am not knowledgeable enough to know if these are significant for using JeeLib with RFM69CW. If someone (JohnO and/or martynj?) could give me some guidance, I can do some experiments (I got the ATT88 ICs). Just a reminder -- I am comfortable with programming. So I can provide the programming labor, but will need support and guidance about what and where to change, if required.

Replies (3)

RE: JeeLib for RFM69CW connected to ATTiny88 - Added by sanb about 1 year ago

Just FYI (and for completeness, as I make progress):

I was able to get past the compile-time problems when compiling JeeLib for ATTiny88. Adding "_AVR_ATTINY88_" in the #define in Sleepy::loseSomeTime() got it working. I have now tested this function on ATT88. It does introduce the required delay. I am yet to verify that the MCU does go into deep sleep (power consumption goes down to fraction of uAmp).

I will next connect the RFM69CW and test it with my real program on ATT88. The connections on ATT84 are the following:

        ATT84        RFM69CW
         D1            NSS
         D2            DI00
      MOSI, D4         MISO
      MISO, D5         MOSI
      SCK, D6          SCK

I am not yet clear about which would be the equivalent pins for D1 and D2 on ATT88 (NSS and D100 on RFM69 respectively). If someone already knows the answer, please let me know.

I suspect I can use the same pins for RFM69CW's NSS and D100 as I am using on Arduino UNO (since ATT88 is pin-compatible with ATMega328) -- but again, not sure.

RE: JeeLib for RFM69CW connected to ATTiny88 - Added by sanb about 1 year ago


I hooked up the RFM69CW module with the ATTiny88 programmed to run at 8MHz with a sketch that does a wireless ping-pong with the basestation radio. The test was successful. I.e., for my purpose, ATT88 is a good replacement for ATT84 that I have been using and, for my purpose it is pin-compatible with ATMega328. JeeLib required only minor modifications (in Sleepy::loseSomeTime()) for ATT88.

Following are the connections between ATT88 and RFM69CW module:

[Editing to fix errors in the following table. ATT88-17 and -18 were connected to RFM-5 and -8 respectively. Should be as below]

     ATT88 Physical Pin                                 RFM69CW Pins
           16 (SS)                                         7 (NSS)
           17 (MOSI)                                       8 (MISO)
           18 (MISO)                                       5 (MOSI)
           19 (SCK)                                        6 (SCK)
            4 (INT0/2/PCINT18/PD2)                         9 (DI00)

RE: JeeLib for RFM69CW connected to ATTiny88 - Added by martynj about 1 year ago

Thanks for documenting that.