USBasp with Atmel Studio 7
This short article presents my setup of Atmel Studio 7 for USBasp programmer. USBasp is a simple low-cost programmer that does not offer any advanced features such as on-chip debugging. On the other hand, the cost of this programmer is significantly lower in comparison with Atmel-supplied debuggers such as Atmel-ICE. USBasp can be added into Atmel Studio as an external tool. The following steps present the installation process.
1. Plug in your USBasp.
2. Install libusbK driver using Zadig software as presented in the following picture. (If you cannot see USBasp device you might need to click on Options -> List All Devices.)
2. Download AVRdude http://download.savannah.gnu.org/releases/avrdude/?C=M&O=D (in my case avrdude-6.3-mingw32.zip and avrdude-doc-6.3.pdf).
3. Unzip the downloaded file to a chosen folder.
4. Open Atmel Studio and click on Tools -> External Tools as shown in the screenshot.
5. Choose a title you like.
6. Command is the path to your downloaded (unzipped) avrdude.exe file.
7. Field Arguments is specific for your type of microcontroller. In my case I used ATmega2560 (m2560) . More information can be found in avrdude-doc-6.3.pdf file.
avrdude -c usbasp -p m2560 -U flash:w:$(ProjectDir)Debug\$(TargetName).hex:i
8. $(ProjectDir) sets the Initial directory as a project directory.
9. Check "Use Output Window" for status messages of avrdude.exe.
10. Write a simple code and click on Build -> Build Solution (F7). The following code blinks an LED on the MEGA 2560 board.
11. Press Tools -> USBasp to program your microcontroller. Good luck!