encounters with electron•ics / by flabbergast

Notes on programming JeeNode Micro with Arduino

Having gotten a JeeNode Micro (with a RFM69CW instead of the usual RFM12B), I needed to figure out a way to program it from Arduino GUI. A Bus Pirate from Dangerous Prototypes came in really handy:

Here are some notes about how to incorporate this setup into Arduino (1.0.5) GUI:

Add Bus Pirate as a programmer

UPDATE: the old instructions (below) are for Arduino < 1.5. For the new Arduino GUI, create ARDUINO_SKETCHBOOK_FOLDER/hardware/buspirate/avr/programmers.txt with this content:

buspirate.name=Bus Pirate
buspirate.communication=serial
buspirate.protocol=buspirate
buspirate.program.protocol=buspirate
buspirate.program.tool=arduino:avrdude
buspirate.program.extra_params=-P{serial.port}

and also create an empty file ARDUINO_SKETCHBOOK_FOLDER/hardware/buspirate/avr/boards.txt (without it Arduino complains that there are no valid board definitions in the buspirate folder and doesn’t add the programmer).

After restarting the GUI, Bus Pirate should appear in the “Programmers” menu option.

OLD INSTRUCTIONS:

This is done simply by creating a file ARDUINO_SKETCHBOOK_FOLDER/hardware/buspirate/programmers.txt with the following content:

buspirate.name=Bus Pirate
buspirate.communication=serial
buspirate.protocol=buspirate

Add attiny84 (and some other tinys) as a target

Get the tiny core for Arduino here: arduino-tiny and unpack the zip file into ARDUINO_SKETCHBOOK_FOLDER/hardware - you should get a new tiny folder in there. Then copy some of the board definitions from ARDUINO_SKETCHBOOK_FOLDER/hardware/Prospective Boards.txt into ARDUINO_SKETCHBOOK_FOLDER/hardware/boards.txt. I selected two attiny84 and two attiny85 targets (the attiny84@8MHz is the one that goes for JeeNode Micro), the file can be downloaded here.

Using RFM69CW on JNu

One now needs Arduino libraries that talk to RFM69CW and work on attiny84. One is of course jeelib. Another one is my modified version of LowPowerLab’s RFM69 library, which is on my github: RFM69_f / attiny branch.

Some sketches that I successfully use for some sensors at home are also on my github: my Arduino sketches.

Another rig

On this one, I’m using MattairTech’s AVRisp mkII clone as a programmer, and a little TH02 humidity and temperature sensor is hooked to the JeeNode Micro. This one has the advantage that AVRISP mkII already has an entry in Arduino’s Programmers menu.

The TH02 turned out to be a bit tricky to deal with: it has I2C interface, and the “hardware” I2C on attiny84 can be done only via the USI module, which is used for SPI to communicate with RFM69CW. So software I2C it is. However I couldn’t make it work with the first few software I2C libraries that I found (jeelib comes with one, and there were a few on the net). They worked with some other I2C hardware, but not TH02. Finally, one from here worked, written in assembler.