How to Flash or Program Arduino using USBasp from Atmel Studio?


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.   

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://mendupmindcode.blogspot.com/2021/12/installing-arduino-drivers.html

What You Will Learn

  • How to install USBasp drivers in Windows 10?
  • How to use USBasp in Atmel Studio?
  • How to flash Arduino UNO using USBasp from Atmel Studio?
  • How to flash Arduino NANO using USBasp from Atmel Studio?
  • How flash Arduino from Atmel Studio?

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’ in the 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 Successful 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

إرسال تعليق

Post a Comment (0)

أحدث أقدم