Helpful AVR Pocket Programmer Script

The CryptoCape has an AtMega328p and I’m working on getting the crypto library NaCl running on the micro-processor.  Peter and Michael, the authors of the paper, have been extremely responsive and helpful as I’ve been bugging them 🙂 I quickly realized that the AVR Pocket Programmer is a very nice way to flash a “naked” ATMega328p (or a full Arduino Uno).  But, when using various sketches, it’s nice to have a script with avrdude that is easily invoked from the command line.

The AVR Pocket Programmer attached to an ISP 6 pin connector, wired to an AtMega328p.

I’ve added this blurb to my .zshrc:

[code language=”bash”]
# AVR dude command for the pocket programmer.
# Usage: pp sketch.hex
sudo avrdude -c usbtiny -B 1 -p atmega328p -U flash:w:$1 -v

Flash the sketch with pp Blink.cpp.hex.

Hardware Details

For the DIYers out there, I used the schematic from SparkFun’s Redboard for the wiring example.  The ISP-6 pin reference is below:

ISP 6 way pinout

Happy Hacking!

One thought on “Helpful AVR Pocket Programmer Script

Comments are closed.