Note

This article is a part of Arduino / ATmega328p Embedded C Firmware Programming Tutorial. Consider exploring the course home page for articles on similar topics.

Arduino Tutorial Embedded C Register Level Arduino Master Class

Introduction

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.   

PCBway Banner

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.

https://www.arnabkumardas.com/platforms/atmel/how-to-install-arduino-ide-and-drivers/

Steps to configure

Time needed: 15 minutes.

How to Install USBasp Drivers and Configure Atmel Studio to Flash using USBasp

  1. Install USBasp Drivers

    The best and easy way to install USBasp Drivers is by using the Zadig USB Driver Installer. 

  2. Download Zadig from the below link

    https://zadig.akeo.ie/

  3. Connect the USBasp to your computer 

    Connect USBasp to Computer

  4. Open Device Manager 

    You Should see the ‘!’ mark next to USBasp.

    USBasp in Device Manager

  5. Open the Zadig Application that you have downloaded 

    You will see ‘1 device found’ at left corner. 

    USBasp Driver Installation

  6. Select Driver and Install

    Select ‘libusb-win32’ and click ‘Install Driver’.

    Zadig USBasp Installation

  7. Driver Installation

    It usually takes few moments to install the driver.

    Zadig USBasp Driver Installation

  8. After Successfull Installation

    A success message is displayed if everything is ok.

    USBasp Driver Installation

  9. Open Device Manager

    Open Device Manager to Verify Installation. The ‘!’ Mark should not be there.

    Successfull USBasp Installation

  10. Open Atmel Studio

    Open Atmel Studio and go to Menu -> Tools -> External Tools.

    External Tools Atmel Studio

  11. Click ‘Add’ 

    A new entry will be created.

    Add External Programming Tool Arduino in Atmel Studio

  12. 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


    USBasp Configuration Atmel Studio

  13. Connect the AVR or Arduino Board with USBasp

    Make sure to check the correct pin orientation.

    USBasp ISP connection with Arduino NANO

  14. Test the Tool

    Go to Menu -> Tools -> USBasp You should see a screen like this:

    Success Flashing Arduino from Atmel Studio

Manufacturing

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.PCBWay.com Manufacturer Review - Electronics-LabTo 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.


Crazy Engineer

MAKER - ENGINEER - YOUTUBER

2 Comments

abpccpba · August 7, 2019 at 11:21 pm

Thank You Great help.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.