Pages: [1]   Go Down
Author Topic: Program an Arduino using USBasp  (Read 2623 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 25
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey there, I got an USBasp programmer. I know that to upload sketch to arduino board , not necessary I have to use USB cable. I can also use this USBasp programmer right ? So, if I wanted to use this programmer to program my arduino atmega 328, do I need to do any modiciation ? Or I simply just plug in the 6 pins header and click File--> Upload using programmer ?

This method apply to any AVR chips? with or without bootloader in it ?

Thank you for the help
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 180
Posts: 8084
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

My USBasp programmer came with a 10-pin ICSP cable.  You'll need a 10-pin to 6-pin adapter.

If you use a factory fresh AVR chip in your Arduino it will, by default, run at 1 MHz instead of 16 MHz.  To set the fuses correctly for the 16 MHz crystal/resonator you will want to burn the bootloader:

Tools->Board->Arduino UNO  (or whatever Arduino board you are programming)
Tools->Programmer->USBasp
Tools->Burn Bootloader

Then you can upload sketches with:

Tools->Board->Arduino UNO  (or whatever Arduino board you are programming)
Tools->Programmer->USBasp
File->Upload Using Programmer
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Offline Offline
Newbie
*
Karma: 0
Posts: 25
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yea, I have the 10 pins to 6 pins adapter. So, means every AVR chip that I want to program using arduino IDE I must burn bootloader ? Burning bootlader means that I can program my chip using arduino language and not those from AVR studio ?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 25
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset



Hey, help. Suddenly I cant progrram my arduino. Why ??? Please help me.

Thank you
Logged

California
Offline Offline
God Member
*****
Karma: 13
Posts: 629
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


Hey, help. Suddenly I cant progrram my arduino. Why ??? Please help me.

Thank you

Do you remember which direction you hooked the 6-pin cable to the ICSP?  There is a pin 1 designated with a little dot on the UNO.  The colored wire (Red or Black) on the ribbon will tell you which side pin 1 is on the connector.

After that, check if it will upload via programmer (Try a slow clock, if you have a jumper for it).  If not, re-burn your bootloader through the Arduino IDE.
Logged


Offline Offline
Jr. Member
**
Karma: 0
Posts: 78
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I do have the same problem,
If I upload a sketch by Uspasp from the IDE (v1.0.1), the sketchs work fine.
But I can't upload sketches anymore by the arduino ide.
I think the bootloader is over writen.
Burning a new bootloader, solves the problem.
[edit]
If you upload by extrenal programmer, you erase the flash memory, and then uploud the sketch.
(so you loose the bootloader). Is there a option to prevent that ?
« Last Edit: August 06, 2012, 07:24:47 am by teding » Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 180
Posts: 8084
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I do have the same problem,
If I upload a sketch by Uspasp from the IDE (v1.0.1), the sketchs work fine.
But I can't upload sketches anymore by the arduino ide.
I think the bootloader is over writen.
Burning a new bootloader, solves the problem.
[edit]
If you upload by extrenal programmer, you erase the flash memory, and then uploud the sketch.
(so you loose the bootloader). Is there a option to prevent that ?

It sounds like you are saying:  "When I burn a fresh bootloader it only works once through USB."  That is a symptom of the auto-reset circuit not working.  Fix the auto-reset and you should get the bootloader to work more than once.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Offline Offline
Sr. Member
****
Karma: 1
Posts: 344
YES! It is possible. Even Impossible Says I m Possible. :)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset



Hey, help. Suddenly I cant progrram my arduino. Why ??? Please help me.

Thank you

uhen uploading the program GOTO File>Upload Using Programmer.
Logged

"Imagination is more important than knowledge."
-Einstein

Offline Offline
Jr. Member
**
Karma: 0
Posts: 63
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Very useful post, my USBasp is now running perfectly after pointers from here. Thanks
Logged

while (z--) { snore; }

Pages: [1]   Go Up
Jump to: