Giter VIP home page Giter VIP logo

logbox-avr's Introduction

Using avrdude with the Raspberry Pi

Since the Raspberry Pi lacks a DTR pin that makes it oh-so-easy to upload your hex files into the avr, we need this hack to make it just as easy. When you wire up your atmega chip, be sure to connect one of the digital gpio pins to the reset pin, and then you'll be able to use avrdude as if your serial cable actually had a dtr pin.

Instructions:

Install using script:

$ git clone https://github.com/openenergymonitor/avrdude-rpi.git ~/avrdude-rpi && ~/avrdude-rpi/install

Manual Install:

Copy both files into your /usr/bin directory, then rename the original avrdude to avrdude-original and symlink avrdude-autoreset to become avrdude.

$ cp autoreset /usr/bin
$ cp avrdude-autoreset /usr/bin
$ mv /usr/bin/avrdude /usr/bin/avrdude-original
$ ln -s /usr/bin/avrdude-autoreset /usr/bin/avrdude

Modify the autoreset script to use the pin that you wired up to the reset pin. See the line in autoreset where we do "pin = 4" and change the 4 to your gpio pin number.

Now when you run avrdude from anywhere (including via arduino's normal UI) it will flag dtr when it is about to upload hex data.

To upload to the RFM12/69Pi (ATmega328 @ 8Mhz):

$ avrdude -v  -c arduino -p ATMEGA328P -P /dev/ttyAMA0 -b 38400 -U flash:w:sketch_name.hex

To upload to the emonPi (ATmega328 @ 16Mhz):

$ avrdude -v -c arduino -p ATMEGA328P -P /dev/ttyAMA0 -b 115200 -U flash:w:sketch_name.hex

http://www.deanmao.com/2012/08/12/fixing-the-dtr-pin/

Make sure Python is installed:

$ sudo apt-get update
$ sudo apt-get install python-dev
$ sudo apt-get install python-rpi.gpio

logbox-avr's People

Contributors

glynhudson avatar mharizanov avatar deanmao avatar jmatsushita avatar

Watchers

Greg Bowler avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.