Raspberry Pinout

ATmega 328p / Arduino over SPI

Did you know that your Pi could power and program an ATmega 328p/Arduino directly, with nothing but a few wires, a breadboard, a 16Mhz crystal oscillator and some 22pF capacitors?

Read my complete Pico PiDuino tutorial to get started for just over £5

You'll need to install Gordon's modified AVRDude.

Connect 8/CEO to your ATmega's Reset/RST pin, 9/MISO to its MISO pin (D12), 10 to its MOSI pin (D11) and 11/SCLK to its SCLK pin (D13).

Power your ATmega with the 3.3v and GND pins from your Pi, and you're good to go.

Make sure you have no rogue SPI device drivers running and check it's connected correctly using:

avrdude -p m328p -c gpio

To get started compiling Arduino sketches from the command line:

sudo apt-get install arduino arduino-mk

This basic Makefile should get you started. Create a basic sketch, name it mysketch.ino and run:

export BOARD=atmega328
avrdude -p m328p -c gpio -e -U flash:w:build-cli/Arduino.hex