how to use a usbasp? - Page 1
Forum section: electronics / general

author: rickselectricalprojects
author_rank: Regular Contributor
timestamp: March 15, 2015, 09:07:32 am
content: hi everyone,i am getting started in programming microcontrollers and i cant afford a official atmel programmer (like an avrisp) but i have a usbasp and i was wondering what software i need, if i can use it with atmel studio 4 (i don't like atmel studio 6) and just basic information on how to use it because i see alot of people here on the forum use it.(please don't be to harsh because i am only 14 and i don't know everything)thanks

author: chamod
author_rank: Contributor
timestamp: March 15, 2015, 09:15:31 am
content: I haven't used atmel studio. However, I've used avrdude to program the compiled output .hex file with a USBASP programmer.Command line is like thisCode:avrdude –c usbasp –p m328p –U flash:w:test1.hex-p specifies which chip you are programming. -c says you're using a usbaspHope this helps

author: Psi
author_rank: Super Contributor
timestamp: March 15, 2015, 09:18:12 am
content: You may find issues with avrstudio4 not supporting a number of newer ATtiny/mega MCU's.But yes, you can use it, but you need to set it up manually.Basically you need to write a simple windows batch file to run avrdude.exe with the right parameters to upload the hex file after a compile.avrdude -c usbasp -p m328p -E noreset -e -U flash:w:myhexfile.hexThen you call this batch file from avrstudio by adding this to the post built events.call "C:\wheremybatchfileis\mybatchfile.bat"Then when you hit compile in avrstudio you will see all the normal compile messages and then the avrdude upload process.

author: JohnnyBerg
author_rank: Frequent Contributor
timestamp: March 15, 2015, 09:23:20 am
content: In the Arduino IDE you can use the tools -> programmer menu. Set it to USBasp and you're ready to goYou can then burn a bootloader (menu tools->bootloader) into the Atmel chip.You can put a sketch into the Atmel chip using the File->upload sketch using programmer menu.You can also use AVRDude. I use AVRdudess as a graphical frontend. Select "Any usbasp programmer with correct VID/PID" as Programmer -c.You then can read fuse settings, read chip ID and upload images.I do not have Atmet studio 4 at hand, but in Atmel studio 6, you configure it to use avrdude, with the correct programmer.Use the Tools->External tools menu to add a tool. Fill in the dialog and press ok. Now you have a extra menu in the tools menu, for programming.

author: Stonent
author_rank: Super Contributor
timestamp: March 18, 2015, 03:40:06 pm
content: There ate two kinds of the cheap USB asp. One appears as a USB hid device and one used libusb. Depending on which you have will determine how to use the programming part. I think they are just using firmware but also they are wired differently so if you flash the other firmware the USB will stop working. There's some modified firmware out there to correct that.

author: Mr Smiley
author_rank: Frequent Contributor
timestamp: March 18, 2015, 10:54:31 pm
content: You can use it in the Arduino environment, just select file/Upload using programmer.

author: fergaletto
author_rank: Newbie
timestamp: March 24, 2015, 06:52:24 pm
content: hi, i got the same question a month ago and i am 28 haha. anyway, i worked it out following this link.http://shannonstrutz.com/engineering/setting-up-usbasp-for-use-with-atmel-studio-6

author: Unknown
author_rank: Unknown
timestamp: August 23, 2015, 04:45:02 pm
content: NOTE: This message has been deleted by the forum moderator Simon for being against the forum rules and/or at the discretion of the moderator as being in the best interests of the forum community and the nature of the thread.If you believe this to be in error, please contact the moderator involved.An optional additional explanation is:

author: ralphd
author_rank: Frequent Contributor
timestamp: August 23, 2015, 05:28:42 pm
content: Quote from: Psi on March 15, 2015, 09:18:12 amThe -E noreset is ignored with -c usbasp.

author: ralphd
author_rank: Frequent Contributor
timestamp: August 23, 2015, 05:32:28 pm
content: Quote from: lachini on August 23, 2015, 04:45:02 pmI've reported your commercial plug. For 1/10th the $30 rip-off you are selling, one can buy a USBasp and a mini-breadboard.

author: obiwanjacobi
author_rank: Super Contributor
timestamp: August 24, 2015, 02:20:55 pm
content: I made an avrdude command line entry in the External Tools menu. So when I am done compiling, I hit my custom tools menu item - that starts up avrdude and programs the MCU.Works for me.EDIT: ExampleCommand: C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avrdude.exeArguments: -C"C:\Program Files (x86)\Arduino\hardware\tools\avr\etc\avrdude.conf" -pm1284 -cstk500v1 -P\\.\COM4 -b19200 -Uflash:w:"$(TargetDir)$(TargetName).hex":iNote that the m1284 is a customized profile.

author: rickselectricalprojects
author_rank: Regular Contributor
timestamp: August 26, 2015, 12:16:53 am
content: thanks everyone for your help!the main problem i have is because my computer is windows 8.1 i can install any of the drivers.

author: obiwanjacobi
author_rank: Super Contributor
timestamp: August 26, 2015, 08:24:02 am
content: Yeah, you need to find the driver for the chip that's on the usb board (mine had a CH341) and possibly take windows out of the I-only-install-signed-drivers mode...I remember I had to (also Win8.1). If you have bitlocker installed you'll also need that key.