How to program Arduino by using USBasp without bootloader


Introduction

By using USBasp, we are able to download the program directly to the Arduino Duemilanove board or others AVR microcontroller without pre-program bootloader. AVR USBasp is a USB in-circuit programmer and it can use to program most of the ATmel AVR controllers. It simply consist of an ATMega8 and a couple of passive components such as resistors, capacitors, LEDs and ect. The programmer uses a firmware-only USB driver and there is no special USB controller is needed. In this tutorial, we will show how to modified the Arduino Software so that you can use it to program AVR microcontrollers without pre-program bootloader.

How to use it

By using AVR USBasp, we need to have a PC and a Atmel AVR controller’s board. The USB type A of the AVR USBasp is connect to the PC and the 10 ways programmer pins connect to the microcontroller’s board. After that, we can load the program to the microcontroller from the PC through AVR USBasp.

There is a lot of project that you can use this programmer, in this stage,  we will shows how to program a LED blinking using this programmer to load the program from the PC to Arduino Duemilanove board. The steps is given below:

1. The first step is to modified the software that we need to use which is the arduino software. For arduino software, you can download it on this website: http://arduino.cc/en/Main/Software. After you have installed the arduino software to your PC, do not open the software first. Goto C:, click Tools > Folder Opetion > View, and tick the column which show “show hidden files and folder” then click apply and ok.

Afterthat, go to C:\Documents and Settings\”user”\Application Data\Arduino. Open the file preferences.txt. Find the sentence upload.using = bootloader, and change it to upload.using = usbasp.

After replace it, save it and close it. next, open the folder of the software arduino which you have installed at the beginning. Open Folder …\hardware\arduino. Then open the text file programmers.txt and add another 2 lines at below of the last sentence in the text file:
USBasp.name=USBasp
USBasp.protocol=usbasp

The last step is save and close the text file, then open back the arduino softare “Arduino.exe” and you can write your program in it and load it to your microcontroller using AVR USBasp.

2. After the modification of the software, we can now program the LED blinking in to the Arduino Duemilanove board.( during the process of burning the program in the microcontroller of the board, we do not need to use the bootloader’s program in it )

First, do some wiring on the connection of AVR USBasp with Arduino Duemilanove board. The female to female jumper connectors are not include in the product AVR USBasp. The female to female jumper connectors are selling in Cytron, you can visit this website

Secondly, connect the AVR USBasp to the USB port of the PC.

Thirdly, open the arduino software “Arduino.exe” to load the program into the Arduino Duemilanove board. Normally, when we want to program the programming into Arduino board, we need to program the bootloader progrmming first, but for this case, we are using the programmer of AVR USBasp, so we will no need to program the bootloader program into the Arduino board and direct program the LED programming into it. There are several steps show how to use USBasp to program the board of Arduino Duemilanove.

a. Open the arduino software “Arduino.exe”

b. Next, we need to call out the example of the source code by click on the Files > Examples > Basics > Blink. Then the source code of LED blinking will pop out in few seconds.

c. The last step is to click on the Upload which appears on the page of LED blink’s source code to load the program to the microcontroller.

d. This is the output of LED blinking on the Arduino board.

For more information, you can refer to the reference below.

* If you needed faster response from author, please do post your inquiry/suggestion in our technical forum as we seldom check tutorial comment section.

References:

1. AVR USBasp User Manual

Buy

, ,

Related Post

Getting Started with Colour Sensor Module (SN-COLOUR-MOD)

Getting Started with Tilt Sensor (SN-TILT)

Getting Started with Vibration Sensor Module (Normally Off) (SN-VIBRATE-MOD)

Getting Started with IR Distance Click

17 thoughts on “How to program Arduino by using USBasp without bootloader

  1. But can it do serial communication like Serial.println() ?
    Does that mean that the USB port on the Arduino isn’t needed anymore to program it? So can it be removed?

  2. Yup…Pololu programmer is for programming Atmel chip too. You can give it a try. It should work too. Usually users use programmer to program the bootloader firmware into the Atmel chip on Arduino. After that, will use the upload function provided in Arduino IDE to load program. That’s a more convenient way compared to using a programmer.

  3. Hi Low5545,
    This is a programmer, so i dont think it can. At least, that’s my understanding.
    Yes, if you are using the programmer, the USB port is not used during the programmng. Actually this example is more suitable for people who want to construct their own Arduino circuit. The circuit will become more simple without construct the USB to Serial circuit.

  4. Low5545,

    No, it won’t be able to communicate with the computer with Serial.println(). The programming interface (SPI) is only for programming and reading the flash/eeprom.

    And yes, the does mean that the USB port and adaptor is no longer needed.

  5. Dear Mr
    This is for Arduino 21 as the pictures show. I think it will work for Arduino 22 and 23. But the question is if this is valid for Arduino 1.0. Or what to do when you are using Arduino 1.0 and want to use all the memory for programs (so no bootloader).
    Thank you

  6. I followed the steps with my MEGA1280 under Arduino IDE 1.01, but it threw out ‘Serial port COM1 not found’ and could not upload hex to the board.

  7. I am using arduino 22 and when trying to upload the blnk sketch, I am getting the following error:

    java.lang.NullPointerException
    at processing.app.debug.AvrdudeUploader.getProgrammerCommands(AvrdudeUploader.java:106)
    at processing.app.debug.AvrdudeUploader.uploadUsingPreferences(AvrdudeUploader.java:68)
    at processing.app.Sketch.upload(Sketch.java:1603)
    at processing.app.Sketch.exportApplet(Sketch.java:1568)
    at processing.app.Sketch.exportApplet(Sketch.java:1524)
    at processing.app.Editor$DefaultExportHandler.run(Editor.java:2293)
    at java.lang.Thread.run(Thread.java:619)

    Kindly note that I am using USBasp programmer and the device was recognised by the computer and is working fine with other AVR ISP programming software.

    If I use arduino 1.0.3, I get Serial Port COM1 not found

  8. I have a clone, but exactly the same.
    I’m using Arduino 1.0.5, and the drivers
    are good. When uploading the bootloader
    or a programm, getting the next errors:

    cannot set sck period. please check for usbasp firmware update
    verification error, first mismatch at byte 0x1e000 0xff != 0x0d

    any idea?

  9. It’s actually a great and useful piece of information. I am satisfied that you just shared this helpful info with us.
    Please stay us informed like this. Thanks for sharing.

  10. how to i have program the standalone ATMEGA328p-AU controller using USBasp (ISP) programmer kit or USBasp programmer in ARDUINO IDE

Leave a Reply

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