I'm introducing 2 Atmel AVR microcontroller addon boards for the Raspberry Pi Model A+/B+/Pi2. One of them with an ATmega32U4 (AVRPi-32U4), the other one with an ATmega328p (AVRPi-328).
AVRPi-32U4

The AVRPi-32U4 runs on 3.3V@8MHz and is Arduino Leonardo (software) compatible, but it also runs Dean Camera's LUFA library very well.
The ATmega32U4 is programmable as a USB device. This is useful if you want a USB HID [device] that can be controlled by the Raspberry Pi or yourself such as a keyboard, joystick, mouse, midi, audio, virtual serial or generic HID.
AVRPi-32U4 has a USB connector that you can connect to the Raspberry Pi itself or an external USB host like a laptop, desktop or other Raspberry Pi. Now you can control anything that takes commands from a device connected to the USB port. Send high level commands from the Raspberry Pi to the AVRPi (over the internet if you want) which sends USB commands from the AVRPi to the USB host you want to control.
AVRPi-328

The AVRPi-328 has the familiar ATmega328p on it like the Arduino Uno, Gertboard, Gertduino, RasPiO Duino and other boards. It also runs on 3.3V, but you decide how fast. Choose between 8, 12 or 16MHz (or any other speed, each has its pros and cons).
All Raspberry Pi GPIO pins are broken out on the top, and the ATmega328p GPIO pins at the bottom of the board in a convenient, single row of 25 pins. It's very easy to solder 'shields' for your project. Everything aligns to the default 0.1" grid. There are 13 rows of free holes between the pins on the AVRPi-32U4, and 14 rows of free holes on the AVRPi-328p.
Software examples
Both boards are programmable in the Arduino IDE, but also with a Makefile and your favourite text-editor. The software comes with plenty examples to compile Arduino 'sketches' (just regular c++ files, really) with the Arduino-Makefile. You should seriously check that out. After that you don't want to go back to the Arduino IDE.
For the AVRPi-32U4 there's a LUFA directory with ready-to-compile examples. There's also a 'testblinky' using a generic Makefile that's easy to adapt for your own 'plain asm/c/c++' projects.
avrpi-tools
I have script files on github that make it easy to set everything up. Get the 'avrpi-tools' repository, run ./setup, choose 'e)install everything in 1 easy step', and 'f) set fuses for [your board]'. That's basically it. The menu for the AVRPi-32U4 has the most options:
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 '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 configavrdude and arduino
The software comes with the latest avrdude-6.1 with linuxgpio enabled (no patches to the original source code other than having gpio pin 8,9,10,11 set in /etc/avrdude.conf).
When using the Arduino IDE or Arduino-Makefile, you can choose the following compatible boards that are programmable with avrdude's linuxgpio interface:
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 MHzAll documentation is here: http://www.onandoffables.com
Install everything from this setup script: https://github.com/onandoffables/avrpi-tools
Available now (as a kit) on Tindie: https://www.tindie.com/stores/onandoffables/

