User Tools

Site Tools


Programming Arduino with a programmer

The Arduino IDE (development environment) works really well but for some special occasions, it preferable and more enjoyable to rely on a good programmer to successfully transfer your code to the microchip. The Arduino Playground is explaining on this page a method for using the programmer directly with the IDE. You modify the preferences.txt file and all.

I prefer not having to edit the preferences.txt file so I don't have to quit/relaunch the application all the time. Here the method that I'm happily using (thanks a lot Massimo for showing it to me). It works magic for programming the Arduino Bluetooth. Uploading sketches over Bluetooth is not very reliable and so frustrating. With the programmer, it works 100% and it's fast.

I'm using the USBtinyISP AVR from AdaFruit. It works great and has direct support in AVRdude.

  • Make sure your programmer is working fine and that you have all the necessary software for it. If you are using the USBtinyISP, the details are on this page. On OSX, you can install AvrMacPack and you should be ready to go right away.
  • Plug your programmer and make sure you have power to the board. Note the orientation of the ISCP connector.

arduino_programmer.jpg tZNTDOJFFEeBXZwt

  • Have your Arduino sketch open and make sure it verifies and compiles fine. When compiling, the Arduino application generates the .hex file targeted for the microchip. This file is located in /tmp/build#####/name_of_sketch.hex where ##### is a random number. You can check that the file is there using the console/terminal. Type “ls /tmp/” to check for the proper name. You can also type “ls /tmp/build” and hit the tab key. It should autocomplete automatically with the proper name. Be careful, you might have multiple build##### directories if you are running Processing at the same time.

  • Open your console/terminal and type the following command. If you want to know the various options and parameters used by avrdude, type “avrdude” in the terminal.
 avrdude -c usbtiny -p m168 -e -U flash:w:/tmp/build#####/name_of_sketch.hex 
  • You should see an ascii progress bar showing three time in the screen. It writes first, then verifies.

  • Your sketch will start rigth away. No need to reset or wait. You are done.

camille moussette 2008/08/23 12:10

arduino/programming_arduino_with_a_programmer.txt · Last modified: 2008/08/23 09:30 by camille