AVR USBasp Users Manual v1.1
AVR USBasp Users Manual v1.1
AVR USBasp Users Manual v1.1
HEAD to TOE
Product User’s Manual – AVR
USBasp
AVR USBasp
AVR USBasp Programmer
User's Manual
V2.0
Dec 2013
Index
1. Introduction 3
2. System Overview 5
3. Packing List 6
4. Board Layout and specification 7
5. Installation 8
6. Example Circuit 12
7. Software Using 13
7.1 AVRdude 13
7.1.1 Programming for LED Blinking 13
7.1.2 Programming for Bootloader 15
7.2 Arduino Software 17
7. Burn Bootloader 28
8. Warranty 30
1. Introduction
AVR USBasp is a USB in-circuit programmer and it can use to program most of the Atmel
AVR controllers. It simply consists 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. By using AVR USBasp, it is easier and
simpler, it just needs one step to finish the process which is to connect the AVR USBasp with
computer and with microcontroller, then program it. AVR USBasp has been designed with
capabilities and features of:
● USBasp works under mulltiple platforms. Linux, Mac OS X and Windows are tested.
● Its speed for the programming is up to 5kBytes/sec.
● Its SCK option is supported to the targets with low clock speed (<1.5Mhz).
● 6 way cable is compatible with Arduino’s ISP pins.
USBasp Method
Table below shows some of the microcontrollers that are supported by the AVR USBasp
Programmer, other than the list provided below, there is also having others series of
microcontrollers which are also supported by AVR USBasp Programmer.
Mega Series
ATMEGA48 ATMEGA8 ATMEGA88 ATMEGA8515 ATMEGA8535
ATMEGA2560 ATMEGA2561
Tiny Series
ATTiny12 ATTiny13 ATTiny15 ATTiny24 ATTiny25
ATTiny85
Classic Series
AT90S2313 AT90S2323 AT90S2343 AT90S1200 AT90S8515
Can Series
AT90CAN32 AT90CAN64 AT90CAN128
PWM Series
AT90PWM2 AT90PWM3
2. System Overview
Cautions: There is a 5V which supply directly from USB port of computer to AVR
USBasp; it is advised not to use this power source to power application circuit or device.
Wrong connection such as wrong polarity, wrong voltage, shorted might permanently
damage computer.
3. Packing List
Please check the parts and components according to the packing list. If there are any parts
missing, please contact us at sales@cytron.com.my immediately.
1. 1 x AVR-USBASP
2. 6 ways programmer rainbow cable
Label Function
B LEDs
LEDs
The USBASP programmer has 2 LEDs. The function is listed below:
● LED 1 (Green LED) – Power
● LED 2 (Red LED) – Programmer communicating with the target device
The 6 pins ISP connection provides an interface to the microcontroller. This 6 pins ISP is
compatible with Arduino ICSP connection.
5. Installation
1. Required items
● AVR USBasp programmer
2. AVR USBasp drivers can be downloaded from Cytron Technologies Sdn. Bhd.
product website page.
● After you left click the “Update Driver Software”, it will come out with “How
do you want to search for driver software?” Then choose the second one
which is “Browse my computer for driver software” and click into it.
● After that, you will see the screen which will prompt out “Browse for driver
software on your computer”. In this step, you need to select the folder where
you unzipped the driver files then click “Next”.
● Next, the windows will prompt out a “Windows Security” with a red warning
dialog. Do not worry about it, and just click “Install this driver software
anyway” and the driver will install.
● After click it, the next step is to wait a few seconds to let your computer to
process the installation of driver software.
● Now, you can use the AVR USBasp to do the programming for the
microcontroller.
6. Example Schematic
In this example, we will show the port layout for 6 pins ISP connection for AVR USBasp and
the connection between AVR USBasp with the microcontroller Atmega328. This 6 pins ISP
is compatible with Arduino ICSP connection.
7. Software Using
There are varieties of software which can be work also for the programmer AVR USBasp.
These are including:
● AVRdude – Version 5.2 or later. AVRdude is available for many platforms.
● Arduino Software– Normally we are using this software to program most of the
Arduino board.
● Khazama AVR Programmer – An AVRdude GUI for MS Windows.
● BASCOM-AVR – Version 1.11.9.6 or later
● eXtreme Burner – An easy to use GUI application for MS Windows.
For the list of the software above, we have no responsibility to teach users how to use,
users must study themselves in order to use it.
7.1 AVRdude
AVRdude is a very popular and common for the command-line program for the programming
of AVR chips. Here are some examples that you can try to load the program using AVR
USBasp.
Command:
avrdude –c usbasp –p m328p –e
Explanation:
To delete the program of the microcontroller.
-c means which programmer that you are using, in this stage, we are using USBasp.
-p means which microcontroller that you are using, in this stage, we are using 328p.
-e means to delete the program inside the microcontroller.
Command:
avrdude –c usbasp –p m328p –u –U flash:w:Blink.cpp.hex
Explanation:
When you write the Blink.cpp.hex for the LED Blinking, you need to make sure that the hex
file of LED blinking need to be in the same folder with the drive you has call out just now.
For example, the command below shows the drive of C:\Users\Phang, it means that I need to
copy the LED Blinking hex file to the folder of C:\Users\Phang.
Command:
avrdude –c usbasp –p m328p –e
Explanation:
To delete the program of the microcontroller.
-c means which programmer that you are using, in this stage, we are using USBasp.
-p means which microcontroller that you are using, in this stage, we are using 328p.
-e means to delete the program inside the microcontroller.
Command:
avrdude –c usbasp –p m328p –u –U flash:w:AtmegaBOOT_168_atmega328.hex
Explanation:
To write the bootloader program into the microcontroller.
Command:
avrdude –c usbasp –p m328p –u –U flash:r: “C:\Users\Phang\AtmegaBOOT_168_atmega328
flash.bin.”:r
Explanation:
Read the flash memory from the microcontroller connected to USBasp programmer and
save it in raw binary format in the file name C:\Users\Phang\AtmegaBOOT_168_atmega328
flash.bin.
Command:
avrdude –c usbasp –p m328p –u –U flash:w:AtmegaBOOT_168_atmega328.hex –U
eeprom:w:eeprom.hex –U effuse:w:0xfd:m –U hfuse:w:0xda:m –U lfuse:w:0xff:m –U
lock:w:0xcf:m
Explanation:
Using the default programmer, write the file AtmegaBOOT_168_atmega328.hex to
flash, ,eeprm.hex to EEPROM, and set the Extended, High, Low and lock fuse bytes to 0xfd,
0xda, 0xff and 0xcf respectively.
Examples below show on how to load the program of LED Blinking to the Arduino Duemilanove
board using AVR USBasp programmer.
2. Open the Arduino software “Arduino.exe” to load the program in to the Arduino
Duemilanove board. By using USBasp programmer, we do not need to load any bootloader
program in it, and also, we do not need to choose the COM Port, and directly program into it.
3. 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.
5. Last step is to upload the code into Arduino. Go to File > Upload Using Programmer.
6. “Done Uploading” will be displayed at the bottom of Arduino IDE if the uploading is success.
For your information, the hex file for the Arduino’s example source code can be found by
follow the steps below. By default, hex file will not be generated in Arduino Software. This
allows you to write the code in Arduino Software, but program the AVR microcontroller by
others software like AVRdude discussed at section 7.1 which require hex file.
2. Open the example source code (LED Blinking, LCD4bit_mode example and ect.). For
this example, we are going to open the LED Blinking Source code.
3. Click verified button on the LED Blinking source code’s page. Wait untill the
compiling is Done.
4. Go to Start up Menu, type %temp% at search programs and files. Press Enter.
5. A folder which are contains temp file will pop up. Click a folder refer to date
modified. The date modified is a date users have compiled the code. The folder name
should start with build…………………..tmp. The hex code is under that folder.
8. Burn Bootloader
The programmer should be connected to the ICSP pins (the 2 by 3 pin header) - make sure
user plug it in the right way.
Ensure that users have the right item selected in the Tools | Board menu. Then, just
launch the appropriate command from the Tools > Burn Bootloader menu of the Arduino
environment. Burning the bootloader may take 15 seconds or more, so be patient.
2. Open the example source code (LED Blinking, LCD4bit_mode example and ect.). For
this example, we are going to open the LED Blinking Source code.
3. Select board and programmer. Tool > Board and Tool > Programmer> USBasp.
9. WARRANTY
Prepared by:
Cytron Technologies Sdn. Bhd.
No. 16, Jalan Industri Ringan Permatang Tinggi 2,
Kawasan Industri Ringan Permatang Tinggi,
14100 Simpang Ampat,
Penang, Malaysia.
URL: www.cytron.com.my
Email: support@cytron.com.my
sales@cytron.com.my