First there's Gordon Henderson's avrdude version 5.10, which has patches to bitbang the gpio pins. Gordon also patched Arduino 'boards.txt' and 'programmers.txt' files to have the Gertboard, Gertduino and avrdude 'gpio' programmer recognized by Arduino.
There's also this avrdude that's using 'linuxspi': http://www.raspberrypi.org/forums/viewt ... 44&t=45211 That works great as a standalone very fast avrdude, but reportedly doesn't play nice with the Arduino IDE (which very well may not be a concern to you).
Then there's the current upstream version of avrdude-6.1 (http://download.savannah.gnu.org/releases/avrdude/) which supports bitbanging GPIO pins out of the box. It doesn't need changes to the source code, a simple compile will do. It only needs the 'linuxgpio' programmer enabled in /etc/avrdude.conf to set the correct pins and it works. This seems the cleanest and most future proof option to me. I found it to be very reliable (use the -i option when setting fuses).
AVRPi-tools:
I've launched 2 new Raspberry Pi addon boards. One of them has an ATmega328p (AVRPi-328), and the other one (AVRPi-32U4) the very cool USB HID capable ATmega32U4 (the same as on the Arduino Leonardo). See this topic: http://www.raspberrypi.org/forums/viewt ... 0&t=106575
To support those, I've been working on a script that makes it as easy as possible to set these boards up. It consists of a menu, with "Install everything in 1 easy step", "Custom install" and "Fuse settings" options. There are also options to easily install additional software such as wiringPi, the 'avrpi' tool, and setting up some extra projects (Arduino-Makefile, LUFA, ...).
The script installs the Arduino library and IDE and a pre-compiled avrdude (avrdude_6.1-2_armhf.deb) and config. It also patches Arduino 'boards.txt', 'programmers.txt' and 'USBCore.cpp' files (that last one was necessary to make an ATmega32u4 also work on 8MHz in the Arduino library).
The avrpi-tools setup script is here: https://github.com/onandoffables/avrpi-tools.
Code: Select all
git clone https://github.com/onandoffables/avrpi-tools
cd avrpi-tools
./setup
Code: Select all
#######################################################################
# avrpi-tools #
#######################################################################
Install everything in 1 easy step:
e) Arduino IDE/libs + avrdude
Custom install:
a) apt-get dependencies and AVR toolchain (without Arduino)
b) install pre-compiled avrdude binary
c) compile + install avrdude from source
p) patch arduino
First time - fuses and test:
s) change to different board/chip
f) set fuses for atmega32u4 on avrpi32u4 board
t) make + upload test/blinky.hex
o) install Arduino Caterina bootloader
g) install Atmel DFU bootloader
Optional extra:
x) uninstall wiringPi
u) uninstall avrpi tool
d) install dfu-programmer
Software and projects:
m) install Arduino-Makefile
l) install LUFA-AVRPI32U4
q) quit
Enter your choice:
The scripts that download the avrdude-6.1 source, patch avrdude.conf, compile with linuxgpio enabled, create a .deb package and install it are here: https://github.com/onandoffables/avrdude-linuxgpio
The script that patches the Arduino IDE and libs is here: https://github.com/onandoffables/arduino-linuxgpio
'avrpi' tool
The 'avrpi' tool makes it easier to control the board from the Raspberry Pi (reset, flash firmware, start serial terminal etcetera).
Code: Select all
pi@raspberrypi ~ $ avrpi -h
Usage: avrpi [options] <filename>
[options] is any of the following:
-f <file> flash <file> flash <file> to avrpi board
-u <file> upload <file> upload <file> using caterina bootloader
-d <file> upload <file> upload <file> using Atmel DFU bootloader
-i info show info about chip
-r reset reset AVR chip
-b bootloader enter bootloader mode (HWB fuses set)
-m minicom start minicom on /dev/ttyAMA0 @ 9600
-n screen start screen on /dev/ttyAMA0 @ 9600
-h help show this info
-c config edit avrpi config file
-s show show config
The pins "avrdude-6.1 linuxgpio" uses are the same ones that "Gordon's avrdude-5.10 gpio" uses. So it was little effort to add the Gertboard and Gertduino boards in the mix. I also took the liberty of adding Alex's new RasPiO Duino board in the setup menu.
From 'boards.txt' and 'board.mk' in Arduino-Makefile:
Code: Select all
BOARD_TAG = avrpi328_8 # AVRPi-328 ATmega328 @ 8 MHz
BOARD_TAG = avrpi328_12 # AVRPi-328 ATmega328 @ 12 MHz
BOARD_TAG = avrpi328_16 # AVRPi-328 ATmega328 @ 16 MHz
BOARD_TAG = avrpi32u4_8 # AVRPi-32U4 ATmega32U4 @ 8 MHz
BOARD_TAG = avrpi32u4_8cat # AVRPi-32U4 ATmega32U4 @ 8 MHz Caterina bootloader
BOARD_TAG = gert168 # Gertboard ATmega168 @ 12 MHz
BOARD_TAG = gert328 # Gertboard ATmega328 @ 12 MHz
BOARD_TAG = gertduino48 # Gertduino ATmega48 @ 8 MHz
BOARD_TAG = gertduino328 # Gertduino ATmega328 @ 16 MHz
BOARD_TAG = raspioduino # RasPiO Duino ATmega328 @ 12 MHz
So if you're using one of those boards, you can also use this setup. There's also going to be support for some ATtiny's or AT90's for boards that you've soldered up yourself. Let me know if you want boards/chips added, or do the fork/patch/pullrequest thing.