How to integrate AVRDude with Atmel Studio

Published on in Series Arduino Development with Atmel Studio


We are able to compile the programs for Arduino using Atmel Studio 6 in this guide “How to setup Atmel Studio for Arduino development”

So now move on with uploading the compile binary within Atmel Studio using AVRdude

Step 1: Download and Install Arduino IDE.

If you don’t have it already you can download if from arduino.cc. I have installed Arduino IDE in D:/arduino-1.0.4

Step 2: Create command-line parameter for AVRdude

We have moved this step to another to separate article “Programming Arduino using AVRDude”

Step 3: Integrate Aurdino programming form Atmel Studio

  • Select Tools > External Tools
  • Then fill the details in window as show in the screenshot

How to integrate AVRDude with Atmel Studio

Title

&Deploy

Command

\ D:/arduino-1.0.4/hardware/tools/avr/bin/avrdude.exe

Arguments

-F -v -patmega328p -carduino -P.COM22 -b57600 -D -Uflash:w:"$(ProjectDir)Debug$(ItemFileName).hex":i -CD:/arduino-1.0.4/hardware/tools/avr/etc/avrdude.conf

Note: $(ProjectDir)Debug$(ItemFileName).hex <- This are automatic variables to get the name of hex file and path from Atmel Studio.

Step 4: Test programming

From menu select Tools > Deploy, this should program your Arduino.

How to integrate AVRDude with Atmel Studio

You should see similar log in the output window.

avrdude.exe: Version 5.11, compiled on Sep  2 2011 at 19:38:36
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch
System wide configuration file is "D:/arduino-1.0.4/hardware/tools/avr/etc/avrdude.conf"
Using Port                    : .COM22
Using Programmer              : arduino
Overriding Baud Rate          : 57600
AVR Part                      : ATMEGA328P
Chip Erase delay              : 9000 us
PAGEL                         : PD7
BS2                           : PC2
RESET disposition             : dedicated
RETRY pulse                   : SCK
serial program mode           : yes
parallel program mode         : yes
Timeout                       : 200
StabDelay                     : 100
CmdexeDelay                   : 25
SyncLoops                     : 32
ByteDelay                     : 0
PollIndex                     : 3
PollValue                     : 0x53
Memory Detail                 :
                        Block Poll               Page                       Polled
 Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
 ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
 eeprom        65    20     4    0 no       1024    4      0  3600  3600 0xff 0xff
 flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
 lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
 hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
 efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
 lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
 calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
 signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
Programmer Type : Arduino
Description     : Arduino
Hardware Version: 2
Firmware Version: 1.16
Vtarget         : 0.0 V
Varef           : 0.0 V
Oscillator      : Off
SCK period      : 0.1 us

avrdude.exe: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.02s
avrdude.exe: Device signature = 0x1e950f
avrdude.exe: safemode: lfuse reads as 0
avrdude.exe: safemode: hfuse reads as 0
avrdude.exe: safemode: efuse reads as 0
avrdude.exe: reading input file "E:\Data\Project\Eggy\git\src\AVRStudio_project\Eggy\Debug\Eggy.hex"
avrdude.exe: writing flash (216 bytes):
Writing | ################################################## | 100% 0.11s
avrdude.exe: 216 bytes of flash written
avrdude.exe: verifying flash memory against E:\Data\Project\Eggy\git\src\AVRStudio_project\Eggy\Debug\Eggy.hex:
avrdude.exe: load data flash data from input file E:\Data\Project\Eggy\git\src\AVRStudio_project\Eggy\Debug\Eggy.hex:
avrdude.exe: input file E:\Data\Project\Eggy\git\src\AVRStudio_project\Eggy\Debug\Eggy.hex contains 216 bytes
avrdude.exe: reading on-chip flash data:
Reading | ################################################## | 100% 0.10s
avrdude.exe: verifying ...
avrdude.exe: 216 bytes of flash verified
avrdude.exe: safemode: lfuse reads as 0
avrdude.exe: safemode: hfuse reads as 0
avrdude.exe: safemode: efuse reads as 0
avrdude.exe: safemode: Fuses OK
avrdude.exe done.  Thank you.
Note: New Atmel Studio versions have inbuilt support for importing Arduino


This article is part of Arduino Development with Atmel Studio series.

  1. How to integrate AVRDude with Atmel Studio [This Article]
  2. Programming Arduino using AVRDude
  3. How to setup Atmel Studio for Arduino development

TAGS: arduino

Share on: Email Facebook Twitter


View/Write Comments