RFM2Pi v1: load custom program

Hi.

I'd like to load a custom program to the RFM2Piv1 (ATTiny). (This is because I'd like to use a lower bitrate.)

I'm trying to follow the steps here, here, and there to configure the arduino IDE to work on ATTiny.

So I downloaded tiny-core on this page.

I'm using Debian's packaged arduino software, which is in /usr/share/arduino. I created a symlink from /usr/share/arduino/hardware/tiny to /usr/local/share/arduino/hardware/tiny where I decompressed the archive.

The archive does not contain boards.txt but a file called "Prospective boards.txt" (Yes, a space in a filename). I copied it into boards.txt and now I see a lot of boards available, but I don't see

ATtiny84 @ 8Mhz (internal oscillator; BOD disabled)

The closest I find are

ATtiny84 @ 1Mhz (internal oscillator; BOD disabled)

ATtiny85 @ 8Mhz (internal oscillator; BOD disabled)

 Night Light (ATtiny84 @ 8 MHz; internal oscillator; 4.3 V BOD; CKOUT enabled)Night Light (ATtiny84 @ 8 MHz; internal oscillator; 4.3 V BOD; CKOUT enabled)

Can I pick one of these ?

BTW, another difference with Martin's post, I don't have

hardware\tiny\bootloaders\attiny84\empty.hex

but

bootloaders/empty/

-rw-r--r-- 1 root root 234 juin  30 19:51 empty13Aat128.hex
-rw-r--r-- 1 root root 132 juin  30 19:51 empty13Aat1.hex
-rw-r--r-- 1 root root 770 juin  30 19:51 empty84at16.hex
-rw-r--r-- 1 root root 950 juin  30 19:51 empty84at1.hex
-rw-r--r-- 1 root root 950 juin  30 19:51 empty84at8.hex
 

 

Anyone been doing this lately ?

mharizanov's picture

Re: RFM2Pi v1: load custom program

here is my all pre-configured and Attiny84 friendly IDE (Windows)

https://dl.dropboxusercontent.com/u/18771283/arduino-1.0.1.zip

You can still make use of it, even if you run on Linux, just requires some more thought :)

 

Jérôme's picture

Re: RFM2Pi v1: load custom program

Thank you Martin for the link.

I downloaded you archive and used hardware/tiny/ from it to replace the one I got from arduino-tiny.

Now, I can select the right board type.

I had a compilation issue:

In file included from /usr/share/arduino/hardware/tiny/cores/tiny/WConstants.h:1:0,
                 from /usr/share/arduino/hardware/tiny/cores/tiny/WInterrupts.c:36:
/usr/lib/avr/include/math.h:426:15: error: expected identifier or ‘(’ before ‘double’
 extern double round (double __x) __ATTR_CONST__;
               ^
/usr/share/arduino/hardware/tiny/cores/tiny/wiring.h:136:26: error: expected ‘)’ before ‘>=’ token
 #define round(x)     ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))
                          ^

I searched a bit on the web and found an explanation.

I modified /usr/local/share/arduino/hardware/tiny/cores/tiny/wiring.h (extracted from your archive) to comment the "round" line and now I can compile successfully.

I can't test right now. I hope to borrow an ISP AVR tomorrow.

I'd like to test different bit rates.

Ideally, I'd add a new config parameter to allow for changing without reprogramming. Would you be interested in such a feature ?

mharizanov's picture

Re: RFM2Pi v1: load custom program

Yes, config parameters for bitrate and send power are something I have long wanted to implement, but laziness kicked in :)

 

Jérôme's picture

Re: RFM2Pi v1: load custom program

If I get the time, I'll try to come up with something. I'm not promising.

RFM2Pi is no longer produced, and people with a current version would still have to reflash, but I suppose the code could be used on v2 as well. Less necessary but still practical.

Do you see this as a modif to your sketch, or would you even patch jeelib ? After a quick look, I think both are feasible, but I don't know if the jeelib project would be interested.

BTW, I copied the tiny directory of your config files on github, along with the fix I had to apply to run on a recent debian.

Jérôme's picture

Re: RFM2Pi v1: load custom program

Actually, I couldn't get an ISP AVR programmer.

I could buy one, but I might as well buy an RFM2Pi...

Regarding the setup, I wrote this:

I'm using Debian's packaged arduino software, which is in /usr/share/arduino. I created a symlink from /usr/share/arduino/hardware/tiny to /usr/local/share/arduino/hardware/tiny where I decompressed the archive.

In case anyone reads this, it is useless. Just create a hardware folder inside your arduino sketchbook.

Besides, the arduino-tiny-0150-0020.zip file works, or almost. I decompressed it in my newly created hardware directory and it works as expected, except I had to cut everything in tiny/avr/ and paste it up into tiny/.

I mean I need

~/projects/arduino/hardware/tiny/cores

not

~/projects/arduino/hardware/tiny/avr/cores

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.