AVR USBasp Users Manual PDF
AVR USBasp Users Manual PDF
HEADtoTOE
ProductUsersManualAVRUSBasp
AVRUSBasp
AVRUSBaspProgrammer
User'sManual
V2.0
Dec2013
CreatedbyCytronTechnologiesSdn.Bhd.AllRightsReserved
ROBOT.HEADtoTOE
ProductUsersManualAVRUSBasp
Index
1. Introduction
2. SystemOverview
3. PackingList
4. BoardLayoutandspecification
5. Installation
6. ExampleCircuit
12
7. SoftwareUsing
13
7.1AVRdude
13
7.1.1ProgrammingforLEDBlinking
13
7.1.2ProgrammingforBootloader
15
7.2
ArduinoSoftware
17
7. BurnBootloader
28
8. Warranty
30
CreatedbyCytronTechnologiesSdn.Bhd.AllRightsReserved
ROBOT.HEADtoTOE
ProductUsersManualAVRUSBasp
1.Introduction
AVR USBasp is a USB incircuit programmer and it can use to program most of the Atmel
AVR controllers.ItsimplyconsistsofanATMega8and acoupleofpassivecomponentssuch
as resistors, capacitors, LEDsandect.TheprogrammerusesafirmwareonlyUSBdriverand
there is no special USB controllerisneeded.ByusingAVR USBasp,itis easierandsimpler,
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
capabilitiesandfeaturesof:
USBaspworksundermulltipleplatforms.Linux,MacOSXandWindowsaretested
Itsspeedfortheprogrammingisupto5kBytes/sec.
ItsSCKoptionissupportedtothetargetswithlowclockspeed(<1.5Mhz).
6waycableiscompatiblewithArduinosISPpins.
USBaspMethod
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
microcontrollerswhicharealsosupportedbyAVRUSBaspProgrammer.
MegaSeries
ATMEGA48
ATMEGA8
ATMEGA88
ATMEGA8515 ATMEGA8535
ATMEGA16
ATMEGA162
ATMEGA163
ATMEGA164
ATMEGA168
ATMEGA169
ATMEGA169P ATMEGA32
ATMEGA324
ATMEGA35
ATMEGA3250
ATMEGA328P ATMEGA329
ATMEGA3290
ATMEGA64
ATMEGA640
ATMEGA644
ATMEGA645
ATMEGA6450
ATMEGA649
ATMEGA6490
ATMEGA128
ATMEGA1280 ATMEGA1281
ATMEGA2560
ATMEGA2561
ATMEGA165
CreatedbyCytronTechnologiesSdn.Bhd.AllRightsReserved
ROBOT.HEADtoTOE
ProductUsersManualAVRUSBasp
TinySeries
ATTiny12
ATTiny13
ATTiny15
ATTiny24
ATTiny25
ATTiny26
ATTiny2313
ATTiny44
ATTiny45
ATTiny84
ATTiny85
AT90S2323
AT90S2343
AT90S1200
AT90S8515
ClassicSeries
AT90S2313
CanSeries
AT90CAN32
AT90CAN64
AT90CAN128
PWMSeries
AT90PWM2
AT90PWM3
CreatedbyCytronTechnologiesSdn.Bhd.AllRightsReserved
ROBOT.HEADtoTOE
ProductUsersManualAVRUSBasp
2.SystemOverview
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
damagecomputer.
CreatedbyCytronTechnologiesSdn.Bhd.AllRightsReserved
ROBOT.HEADtoTOE
ProductUsersManualAVRUSBasp
3.PackingList
Please check the parts and components according to the packing list. If there are any parts
missing,pleasecontactusat
[email protected]
immediately.
1. 1x
AVRUSBASP
2. 6waysprogrammerrainbowcable
CreatedbyCytronTechnologiesSdn.Bhd.AllRightsReserved
ROBOT.HEADtoTOE
ProductUsersManualAVRUSBasp
4.BoardLayoutandSpecification
Label
Function
USBAtype(male)
LEDs
JP4andJP5forprogrammerandspeed
6pinsIDCconnectorforinterfacetomicrocontroller
USBAtype(male)
ThisisforUSBconnection.
LEDs
TheUSBASPprogrammerhas2LEDs.Thefunctionislistedbelow:
LED1(GreenLED)Power
LED2(RedLED)Programmercommunicatingwiththetargetdevice
JP4andJP5
JP4 is for programmer and JP5 is for speed. Normally we are not using JP4 because JP4
function is to update the firmware on it. JP5 is only used fornewmicrocontroller.Itwillnot
be used for others than new microcontroller because we want to increase the speed of the
process of programming. Users may use mini jumper to connect it and remove it ifnotused
(notnewmicrocontroller).
6pinsIDCconnector
The6pinsISPconnectionprovidesaninterfacetothemicrocontroller.This6pinsISPis
compatiblewithArduinoICSPconnection.
CreatedbyCytronTechnologiesSdn.Bhd.AllRightsReserved
ROBOT.HEADtoTOE
ProductUsersManualAVRUSBasp
5.Installation
Inordertocompletetheinstallation,youneedtofollowseveralsteps:
The first step is to direct connect the AVRUSBasp programmertotheUSBportofyourPC.
For the AVR USBasp programmer will work on a wide variety of operating systems, this
procedurewillonlyfocusonWindowSeven.
1. Requireditems
AVRUSBaspprogrammer
3. ProceduretoinstalltheAVRUSBaspprogrammer
InserttheprogrammerintoandavailableUSBportinyourPC.
Go into the devicemanagerandfindtheentryfortheUSBaspanditshouldbe
displayed with a yellow alert icon on it. Then right click on the device and
selectUpdateDriverSoftware.
CreatedbyCytronTechnologiesSdn.Bhd.AllRightsReserved
ROBOT.HEADtoTOE
ProductUsersManualAVRUSBasp
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
youunzippedthedriverfilesthenclickNext.
CreatedbyCytronTechnologiesSdn.Bhd.AllRightsReserved
ROBOT.HEADtoTOE
ProductUsersManualAVRUSBasp
Next, the windows will prompt out a Windows Security witha redwarning
dialog. Do not worry about it, and just click Install this driver software
anywayandthedriverwillinstall.
After click it, the next step is to wait a few seconds to let your computer to
processtheinstallationofdriversoftware.
CreatedbyCytronTechnologiesSdn.Bhd.AllRightsReserved
10
ROBOT.HEADtoTOE
ProductUsersManualAVRUSBasp
Now, you can use the AVR USBasp to do the programming for the
microcontroller.
CreatedbyCytronTechnologiesSdn.Bhd.AllRightsReserved
11
ROBOT.HEADtoTOE
ProductUsersManualAVRUSBasp
6.ExampleSchematic
In thisexample,wewillshowthe portlayoutfor6pinsISPconnectionforAVRUSBaspand
the connection between AVR USBasp with the microcontroller Atmega328. This 6 pins ISP
iscompatiblewithArduinoICSPconnection.
6PinsISPconnectionofAVRUSBasp
SchematicofAVRUSBaspwithAtmega328
7.SoftwareUsing
There are varieties of software which can be work also for the programmer AVR USBasp.
ROBOT.HEADtoTOE
ProductUsersManualAVRUSBasp
Theseareincluding:
AVRdudeVersion5.2orlater.AVRdudeisavailableformanyplatforms.
ArduinoSoftwareNormallyweareusingthissoftwaretoprogrammostof
the
Arduinoboard.
KhazamaAVRProgrammerAnAVRdudeGUIforMSWindows.
BASCOMAVRVersion1.11.9.6orlater
eXtremeBurnerAneasytouseGUIapplicationforMSWindows.
For the list of the software above, we have no responsibility to teach users how to use,
usersmuststudythemselvesinordertouseit.
7.1AVRdude
AVRdudeisaverypopularandcommonforthecommandlineprogramfortheprogramming
of AVR chips. Here are some examples that you can try to load the program using AVR
USBasp.
7.1.1ProgrammingforLEDBlinking
Command:
avrdudecusbasppm328pe
Explanation:
Todeletetheprogramofthemicrocontroller.
cmeanswhichprogrammerthatyouareusing,inthisstage,weareusingUSBasp.
pmeanswhichmicrocontrollerthatyouareusing,inthisstage,weareusing328p.
emeanstodeletetheprograminsidethemicrocontroller.
Command:
avrdudecusbasppm328puUflash:w:Blink.cpp.hex
Explanation:
When you write the Blink.cpp.hex for the LED Blinking, youneedtomakesurethatthehex
ROBOT.HEADtoTOE
ProductUsersManualAVRUSBasp
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 driveofC:\Users\Phang,itmeansthatIneedto
copytheLEDBlinkinghexfiletothefolderofC:\Users\Phang.
ROBOT.HEADtoTOE
ProductUsersManualAVRUSBasp
7.1.2ProgrammingforBootloader
Command:
avrdudecusbasppm328pe
Explanation:
Todeletetheprogramofthemicrocontroller.
cmeanswhichprogrammerthatyouareusing,inthisstage,weareusingUSBasp.
pmeanswhichmicrocontrollerthatyouareusing,inthisstage,weareusing328p.
emeanstodeletetheprograminsidethemicrocontroller.
Command:
avrdudecusbasppm328puUflash:w:AtmegaBOOT_168_atmega328.hex
Explanation:
Towritethebootloaderprogramintothemicrocontroller.
CreatedbyCytronTechnologiesSdn.Bhd.AllRightsReserved
15
ROBOT.HEADtoTOE
ProductUsersManualAVRUSBasp
Command:
avrdude cusbasppm328puUflash:r: C:\Users\Phang\AtmegaBOOT_168_atmega328
flash.bin.:r
Explanation:
Read the flash memory from the microcontrollerconnectedtoUSBaspprogrammerandsave
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,Lowandlockfusebytesto0xfd,0xda,
0xffand0xcfrespectively.
CreatedbyCytronTechnologiesSdn.Bhd.AllRightsReserved
16
ROBOT.HEADtoTOE
ProductUsersManualAVRUSBasp
CreatedbyCytronTechnologiesSdn.Bhd.AllRightsReserved
17
ROBOT.HEADtoTOE
ProductUsersManualAVRUSBasp
7.2ArduinoSoftware
ForArduinosoftware,youcandownloaditonthiswebsite:
http://arduino.cc/en/Main/Software
Examples below show on how to load the program of LED Blinking to theArduinoDuemilanove
boardusingAVRUSBaspprogrammer.
1. ConnecttheAVRUSBasptotheUSBportofthePC.
2. Open the Arduino software Arduino.exe to load the program in to the Arduino
Duemilanove board. By using USBasp programmer,wedonot need to loadanybootloader
programinit,andalso,wedonotneedtochoosetheCOMPort,anddirectlyprogramintoit.
CreatedbyCytronTechnologiesSdn.Bhd.AllRightsReserved
18
ROBOT.HEADtoTOE
ProductUsersManualAVRUSBasp
CreatedbyCytronTechnologiesSdn.Bhd.AllRightsReserved
19
ROBOT.HEADtoTOE
ProductUsersManualAVRUSBasp
CreatedbyCytronTechnologiesSdn.Bhd.AllRightsReserved
20
ROBOT.HEADtoTOE
ProductUsersManualAVRUSBasp
4. Ensurethattheprogrammerandboardwasselectcorrectly
CreatedbyCytronTechnologiesSdn.Bhd.AllRightsReserved
21
ROBOT.HEADtoTOE
ProductUsersManualAVRUSBasp
CreatedbyCytronTechnologiesSdn.Bhd.AllRightsReserved
22
ROBOT.HEADtoTOE
ProductUsersManualAVRUSBasp
5. LaststepistouploadthecodeintoArduino.GotoFile>UploadUsingProgrammer.
CreatedbyCytronTechnologiesSdn.Bhd.AllRightsReserved
23
ROBOT.HEADtoTOE
ProductUsersManualAVRUSBasp
6. DoneUploadingwillbedisplayedatthebottomofArduinoIDEiftheuploadingissuccess.
For your information, the hex file for the Arduinos example source code can be found by
CreatedbyCytronTechnologiesSdn.Bhd.AllRightsReserved
24
ROBOT.HEADtoTOE
ProductUsersManualAVRUSBasp
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 microcontrollerby
otherssoftwarelikeAVRdudediscussedatsection7.1whichrequirehexfile.
1. OpentheArduinosoftware.
2. Opentheexamplesourcecode(LEDBlinking,LCD4bit_modeexampleandect.). For
thisexample,wearegoingtoopentheLEDBlinkingSourcecode.
3. Click verified button on the LED Blinking source codes page. Wait untill the
compilingisDone.
4. GotoStartupMenu,type
%temp%
atsearchprogramsandfiles.PressEnter.
CreatedbyCytronTechnologiesSdn.Bhd.AllRightsReserved
25
ROBOT.HEADtoTOE
ProductUsersManualAVRUSBasp
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 havecompiledthecode.Thefoldername
shouldstartwithbuild..tmp.Thehexcodeisunderthatfolder.
CreatedbyCytronTechnologiesSdn.Bhd.AllRightsReserved
26
ROBOT.HEADtoTOE
ProductUsersManualAVRUSBasp
CreatedbyCytronTechnologiesSdn.Bhd.AllRightsReserved
27
ROBOT.HEADtoTOE
ProductUsersManualAVRUSBasp
8.BurnBootloader
The programmer should be connected to the ICSP pins (the 2 by 3 pin header) make sure
userplugitintherightway.
1. OpentheArduinosoftware.
2. Opentheexamplesourcecode(LEDBlinking,LCD4bit_modeexampleandect.). For
thisexample,wearegoingtoopentheLEDBlinkingSourcecode.
3. Selectboardandprogrammer.Tool>BoardandTool>Programmer>USBasp.
4. BurnBootloader.Tools>BurnBootloader
CreatedbyCytronTechnologiesSdn.Bhd.AllRightsReserved
28
ROBOT.HEADtoTOE
ProductUsersManualAVRUSBasp
5. Burningbootloaderwassuccess
CreatedbyCytronTechnologiesSdn.Bhd.AllRightsReserved
29
ROBOT.HEADtoTOE
ProductUsersManualAVRUSBasp
9.WARRANTY
Productwarrantyisvalidfor6months.
Warrantyonlyappliestomanufacturingdefect.
Damagedcausedbymissuseisnotcoveredunderwarranty
Warrantydoesnotcoverfreightcostforbothways.
Preparedby:
CytronTechnologiesSdn.Bhd.
No.16,JalanIndustriRinganPermatangTinggi2,
KawasanIndustriRinganPermatangTinggi,
14100SimpangAmpat,
Penang,Malaysia.
Tel: +6045453867
Fax: +60185866083
URL: www.cytron.com.my
Email:
[email protected]
[email protected]
CreatedbyCytronTechnologiesSdn.Bhd.AllRightsReserved
30