Author Topic: how to use a usbasp?  (Read 7270 times)

0 Members and 1 Guest are viewing this topic.

Offline rickselectricalprojectsTopic starter

  • Regular Contributor
  • *
  • Posts: 188
  • Country: au
how to use a usbasp?
« on: March 15, 2015, 09:07:32 am »
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 :)
 

Offline chamod

  • Contributor
  • Posts: 20
  • Country: nz
Re: how to use a usbasp?
« Reply #1 on: March 15, 2015, 09:15:31 am »
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 this

Code: [Select]
avrdude –c usbasp –p m328p  –U flash:w:test1.hex

-p specifies which chip you are programming. -c says you're using a usbasp
Hope this helps
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 9951
  • Country: nz
Re: how to use a usbasp?
« Reply #2 on: March 15, 2015, 09:18:12 am »
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.hex


Then 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.
« Last Edit: March 15, 2015, 09:21:52 am by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline JohnnyBerg

  • Frequent Contributor
  • **
  • Posts: 474
  • Country: de
Re: how to use a usbasp?
« Reply #3 on: March 15, 2015, 09:23:20 am »
In the Arduino IDE you can use the tools -> programmer menu. Set it to USBasp and you're ready to go ;)
You 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.
 

Offline Stonent

  • Super Contributor
  • ***
  • Posts: 3824
  • Country: us
Re: how to use a usbasp?
« Reply #4 on: March 18, 2015, 03:40:06 pm »
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.
The larger the government, the smaller the citizen.
 

Offline Mr Smiley

  • Frequent Contributor
  • **
  • Posts: 324
  • Country: gb
Re: how to use a usbasp?
« Reply #5 on: March 18, 2015, 10:54:31 pm »
You can use it in the Arduino environment, just select file/Upload using programmer.

 :)
There is enough on this planet to sustain mans needs. There will never be enough on this planet to sustain mans greed.
 

Offline fergaletto

  • Newbie
  • Posts: 2
Re: how to use a usbasp?
« Reply #6 on: March 24, 2015, 06:52:24 pm »
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


 

lachini

  • Guest
Re: how to use a usbasp?
« Reply #7 on: August 23, 2015, 04:45:02 pm »
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:
« Last Edit: August 23, 2015, 05:34:12 pm by Simon »
 

Offline ralphd

  • Frequent Contributor
  • **
  • Posts: 445
  • Country: ca
    • Nerd Ralph
Re: how to use a usbasp?
« Reply #8 on: August 23, 2015, 05:28:42 pm »
avrdude -c usbasp -p m328p -E noreset -e  -U flash:w:myhexfile.hex
The -E noreset is ignored with -c usbasp.
Unthinking respect for authority is the greatest enemy of truth. Einstein
 

Offline ralphd

  • Frequent Contributor
  • **
  • Posts: 445
  • Country: ca
    • Nerd Ralph
Re: how to use a usbasp?
« Reply #9 on: August 23, 2015, 05:32:28 pm »
You Can also use ProgIsp :

I've reported your commercial plug.  For 1/10th the $30 rip-off you are selling, one can buy a USBasp and a mini-breadboard.
Unthinking respect for authority is the greatest enemy of truth. Einstein
 

Offline obiwanjacobi

  • Frequent Contributor
  • **
  • Posts: 988
  • Country: nl
  • What's this yippee-yayoh pin you talk about!?
    • Marctronix Blog
Re: how to use a usbasp?
« Reply #10 on: August 24, 2015, 02:20:55 pm »
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: Example
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" -pm1284 -cstk500v1 -P\\.\COM4 -b19200 -Uflash:w:"$(TargetDir)$(TargetName).hex":i

Note that the m1284 is a customized profile.
« Last Edit: August 25, 2015, 05:10:22 pm by obiwanjacobi »
Arduino Template Library | Zalt Z80 Computer
Wrong code should not compile!
 

Offline rickselectricalprojectsTopic starter

  • Regular Contributor
  • *
  • Posts: 188
  • Country: au
Re: how to use a usbasp?
« Reply #11 on: August 26, 2015, 12:16:53 am »
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.
 

Offline obiwanjacobi

  • Frequent Contributor
  • **
  • Posts: 988
  • Country: nl
  • What's this yippee-yayoh pin you talk about!?
    • Marctronix Blog
Re: how to use a usbasp?
« Reply #12 on: August 26, 2015, 08:24:02 am »
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.
Arduino Template Library | Zalt Z80 Computer
Wrong code should not compile!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf