This article is a part of Arduino / ATmega328p Embedded C Firmware Programming Tutorial. Consider exploring the course home page for articles on similar topics.
This tutorial will walk you through the process of configuring Atmel Studio for flashing AVR based Arduino Boards from Atmel Studio Using USBasp. You will also come to know how to install USBasp Drivers.
To flash Arduino Board or any AVR Boards using the ISP interface, USBasp is the cheap and best option. It supports a wide range of AVR Microcontrollers and easy to use.
Using AVR USBasp for programming Arduino Board will give you more Flash memory space than using the Serial USB programming. By default, Arduino Boards uses a Bootloader to program itself without the use of any external programmer hardware but for this to happen Arduino Boards uses 2Kbyte of Flash Memory for Bootloader. If you use USBasp you can utilize this extra 2Kb for your Firmware, and your program will start execution without any delay that Bootloader introduces otherwise.
Before proceeding you must install Arduino IDE as we will use avrdude from Arduino Installation. If you want to know how to install please follow the link.
Steps to configure
Time needed: 15 minutes.
How to Install USBasp Drivers and Configure Atmel Studio to Flash using USBasp
- Install USBasp Drivers
The best and easy way to install USBasp Drivers is by using the Zadig USB Driver Installer.
- Download Zadig from the below link
- Connect the USBasp to your computer
- Open Device Manager
You Should see the ‘!’ mark next to USBasp.
- Open the Zadig Application that you have downloaded
You will see ‘1 device found’ at left corner.
- Select Driver and Install
Select ‘libusb-win32’ and click ‘Install Driver’.
- Driver Installation
It usually takes few moments to install the driver.
- After Successfull Installation
A success message is displayed if everything is ok.
- Open Device Manager
Open Device Manager to Verify Installation. The ‘!’ Mark should not be there.
- Open Atmel Studio
Open Atmel Studio and go to Menu -> Tools -> External Tools.
- Click ‘Add’
A new entry will be created.
- Fill the Text Boxes
Title : USBasp
Command : C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avrdude.exe
Arguments : -C"C:\Program Files (x86)\arduino\hardware\tools\avr\etc\avrdude.conf" -v -p atmega328p -c usbasp -U flash:w:"$(ProjectDir)Debug\$(TargetName).hex":i
Select ‘Use Output Window’
Change the -p parameter based on your AVR chip.
Arduino UNO / NANO Microcontroller > -p atmega328p
Arduino MEGA Microcontroller > -p atmega2560
- Connect the AVR or Arduino Board with USBasp
Make sure to check the correct pin orientation.
- Test the Tool
Go to Menu -> Tools -> USBasp You should see a screen like this:
Do you want to get your PCB manufactured? Check out PCBWay They have their own factory at Shenzhen, China and provides affordable PCB Manufacturing and Assembly Services. They can manufactur FR-4 , Aluminum, Rogers, HDI, Flexible and Rigid-Flex boards, with very reasonable price. Before you order you can check for quotation Online instant Quote .
If you want to know how to place an order on PCBWay Website and get your PCB Board manufactured in professional quality check out my step by step guide on PCBWay : How to Order Article.To check if the gerbers generated by your CAM software is correct you can view them on the Online Gerber Viewer. If you want to get any project assembled and mass manufactured then they also have a SMT & THT assembly service, which starts from only $30 with free stencil and free worldwide shipping. Learn More about their Assembly Service.
They have other services like Layout Design and also supports students with PCB and Project Sponsorship. It is a higly recommended company to work with. Learn more about PCBWay.