navigationGo.pngQuick Navigation
allprojects32.pngAll projects

favoriteStar32.pngTop projects
Alan numitron clock
Clapclap 2313/1386
SNES Pi Webserver
USB Volume/USB toys
Smokey amp
Laser cutter
ardReveil v3
SNES Arcade cabinet
Game boy projects
Home Presence Detector


navigationMail.pngContact me

3flags.pngWho's Alan?

Rand Nerd Tut
Datasheet Lib
Reddit Elec
Carnet du maker (fr)
ATmel blog (defunct)


kalshagar - AVRStudioFlasher
This is a small tool I made since I didn't find the thing I wanted. If there is an easy way to do it instead of this software, run for it but just send me a mail before so I can do the same!
  • Oups, apparently there is a quite elegant way of doing that explained here. Still 1 advantage for my tool, it gets itself the type of mcu, you don't have to change it. But for memory :
  • External tools >
    • Command = "C:/arduino-0022/hardware/tools/avr/bin/avrdude.exe"
    • Params = "-CC:/arduino-0022/hardware/tools/avr/etc/avrdude.conf -v -v -patmega328p -cavrispv2 -P\.COM1 -b57600 -D -Uflash:w:"$(ProjectDir)Debug$(ItemFileName).hex":i"

Moving out from WinAVR (a great distribution) and its Programmer's Notepad a kinda limited software (... and I'm staying polite) to AVR Studio 5 embedded in Visual Studio Shell. So great, nice, integrated and it's Visual Studio, the tool I use at work everyday of the week. Installation is fine, a few simple tutorials on how to use and you're in within minutes.
Ok, now how do I upload this magnificent blink code to my micro controller ? I do what ? Tools > AVR Programming > Apply > Memories > Choose a file > Program ? And the window is modal ? You want me to do that each time ? No really, you're kidding, right ? Not Ctrl%20Shit%20P or simple shortcut ? I searched a little and seems it's not a trivial question since there's no nice answer that I could find. So let's open Visual Studio C#...


Binary file %20 config file

Source code

How does it work ?

  1. Write your code
  2. Compile (important since the shortcut does NOT recompile before uploading)
  3. If it compiled fine, press Ctrl%20Shift%20P (or the shortcut you chose) and AvrStudioFlasher will run avrdude for you

The program is launched with as a parameter the path to the Visual Studio project (where the .avrgccproj is located). Once there, it will fetch the makefile located in Debug\ subdirectory. Inside it will find the name of the .hex to search for and the type of MCU you're using in that project. Based on that info plus COM port and protocol (these are defined in the AvrStudioFlasher.exe.config) it runs avrdude (path to avrdude is also defined in the .config file).

Cant find avrdude

Says it can't find avrdude ? Well, I guess it's not in your PATH environment variable. If you understand this comment you most likely know how to fix it. Otherwise, just give the full path to avrdude in the config file. You might have to install the WinAVR tool chain to have the avrdude installed. XML config file will look like something like:
    <add key="UploaderExe" value="C:\WinAVR\bin\avrdude"/>

Config file ?

An xml file named AvrStudioFlasher.exe.config that must be in the same directory as AvrStudioFlasher.exe. This is what it looks like by default:
<?xml version="1.0" encoding="utf-8" ?>
    <add key="ProgrammerProtocol" value="avrispv2"/>
    <add key="COMport" value="COM1"/>
    <add key="UploaderExe" value="avrdude"/>
    <add key="Params" value="-p {mcu} -P {comport}  -c {protocol} -U flash:w:&quot;{hexfile}&quot;:i "/>

HOWTO install ?

The External tools window
You need .NET Framework 3.5 to make this run. It's a basic console app, so you can recompile it in .NET 1.0 if needed I guess, knock yourself out.
  1. Put the files in some folder, say c:\Flasher
  2. Open AVR Studio 5
  3. Tools > External tools ...
    1. Pick a nice name
    2. The command is the path to the AvrStudioFlasher.exe
    3. Param is $(ProjectDir)
    4. Check the Use output console item
  4. Now you have a command you can run by clicking the new menu item you created in the Tools menu. Let's add a shortcut
  5. Tools > Options ... > Environment > Keyboard
    1. Pick the command Tools.ExternalCommand1 (1 is because it is the first on my computer, if you have 2 it's the second,...)
    2. In the Press shortcut key zone, press the shortcut you want (my case I press Ctrl%20Shift%20P)
  6. You're done!
All content on this site is shared under the MIT licence (do what u want, don't sue me, hat tip appreciated) ~ Formerly known as (AlanFromJapan [2009 - 2019])