USBasp error while uploading

HELP! I keep on getting avrdude: error: could not find USB device "USBasp" with vid=0x16c0 pid=0x5dc when I try to directly upload Blink code.

Power LED lights up It detects the Serial Port COM# (I checked the Device Manager and used PL2303ChipVersion to verify) I also checked the Tx and Rx connection between PL2303 and ATmega168 (they interchange)

Note: I can 'Upload Using Programmer' and 'Burn Bootloader' (with help of USBasp)

I don't know what's wrong :( Does it have something to do with fuses?

I'm pulling my hair out! please help -newbie

(deleted)

arduinoTime: HELP! I keep on getting avrdude: error: could not find USB device "USBasp" with vid=0x16c0 pid=0x5dc when I try to directly upload Blink code.

Power LED lights up It detects the Serial Port COM# (I checked the Device Manager and used PL2303ChipVersion to verify)

I'm not sure what you have configured in terms of your device drivers, but a USBasp should not show up as COM port when it is connected. The driver for it appears under the libusb-win32-devices on my windows 7 machine when it has has loaded.

The only thing you should have do from the IDE to configure for programming with USBasp is to check you have USBasp selected under tools|programmer, and then select file|upload using programmer. If the USBasp is connected and the correct driver has loaded, it should be proceed in a very similar fashion as uploading via a COM port/bootloader.

If you are running windows, have a look at your device manager screen while you plug in and unplug the USBasp, and see what driver is being loaded. When the driver is loaded, you can check "properties" to see if it running without errors.

Sorry, what I mean when "It can detect a COM#" is after I disconnect the USBasp from the board--when I try to upload using USB.

pico: The only thing you should have do from the IDE to configure for programming with USBasp is to check you have USBasp selected under tools|programmer, and then select file|upload using programmer. If the USBasp is connected and the correct driver has loaded, it should be proceed in a very similar fashion as uploading via a COM port/bootloader.

I have uploaded Blink Code and it runs perfectly. However, without the help of USBasp, I can't upload via Serial Port. Does it still have something to do with drivers? I'm using windows 8 and I can't determine if it has something to do with compatibility issues :|

arduinoTime: I have uploaded Blink Code and it runs perfectly. However, without the help of USBasp, I can't upload via Serial Port. Does it still have something to do with drivers? I'm using windows 8 and I can't determine if it has something to do with compatibility issues :|

OK. I think I know what's going on. :)

When you uploaded the blink sketch using USBasp you overwrote your bootloader. (This will happen whenever you upload a program via an ICSP programmer.)

So when you now try to upload using the COM serial port method, there's no bootloader to communicate with on your board. That's just not going to work.

The solution? Go to tools|Burn bootloader to reload your bootloader via the USBasp. Then try to upload via the serial port -- this time it should work.

pico: The solution? Go to tools|Burn bootloader to reload your bootloader via the USBasp. Then try to upload via the serial port -- this time it should work.

Nope, it still can't upload via Serial Port

avrdude: error: could not find USB device "USBasp" with vid=0x16c0 pid=0x5dc still continues

run it on another computer,

avrdude: stk500_getsync(): not in sync: resp=0x00

Thanks for the suggestion though

Tx and Rx pin (0,1) is not occupied Chose the right Serial Port(only one is detected) and Board type Pressed reset button before uploading code Also I tried changing bps to 15200

still can't upload :~

How did you upload Blink via USBasp in the first place?

In any case, even if USBasp isn't working on that computer now (driver problem by the sounds of it), then you still won't have a bootloader on the Ardunio, until you reload one (why not try reloading via USBasp on the other computer?)

No bootloader means you won't be able to a COM serial programming upload from any computer.

pico:
How did you upload Blink via USBasp in the first place?

  1. Connected USBasp to my computer
  2. Connected ribbon cable between the boards
  3. Selected Board type and Programmer
  4. Burn Bootloader
  5. LED blinks Done burning bootloader

Am I missing something?

pico:
No bootloader means you won’t be able to a COM serial programming upload from any computer.

Does this mean, it just prints “done burning bootloader” but there’s really no bootloader on the chip?

arduinoTime:

pico: How did you upload Blink via USBasp in the first place?

  1. Connected USBasp to my computer
  2. Connected ribbon cable between the boards
  3. Selected Board type and Programmer
  4. Burn Bootloader
  5. LED blinks Done burning bootloader

Am I missing something?

Yes. Burning the bootloader is not the same thing as uploading a sketch (Blink is a sketch, the bootloader is not a sketch.)

The way you upload a sketch via USBasp is going to "file|upload using programmer" as I mentioned in an earlier post above. This method of uploading a sketch doesn't care if a bootloader is installed or not -- in fact, it will overwrite a bootloader if there is one on there, as I have described above.

arduinoTime:

pico: No bootloader means you won't be able to a COM serial programming upload from any computer.

Does this mean, it just prints "done burning bootloader" but there's really no bootloader on the chip?

It's possible you saw that IDE message even if the avrdude process failed -- the IDE doesn't seem to track errlevel exit codes very well. You would have to be paying attention to the avrdude output in the window to be sure that it had actually succeeded.

avrdude is the program called by the IDE that actually does the programming, either via USBasp or a COM port... the IDE is really just a shell program around a command line based set of development utilities (of which avrdude is one) that are doing all the real work.

Going back a few steps: Did you ever manage to upload anything to the Arduino before you attempted to burn a bootloader using USBasp? The Arduino should have come with a bootloader installed, and so it should have been able to be programmed using the COM serial port method out of the box without ever having had anything to do with USBasp or similar.

Another question: Why do you want to use USBasp rather than the bootloader/COM serial port method for programming sketches? Or do you actually want to use a bootloader for programming sketches, and you only want to use USBasp to get a bootloader installed? If so, what (do you think) happened to the bootloader on the Arduino in the first place?

Sorry, I thought you're asking how did I burn the bootloader via USBasp face palm I followed your procedure--File| Upload using Programmer

pico: Going back a few steps: Did you ever manage to upload anything to the Arduino before you attempted to burn a bootloader using USBasp? The Arduino should have come with a bootloader installed, and so it should have been able to be programmed using the COM serial port method out of the box without ever having had anything to do with USBasp or similar.

Yes, I have uploaded codes before but then it started producing the USBasp error. I thought the bootloader was the problem so I bought USBasp and burn the bootloader. Now I can only upload with the help of USBasp programmer.

pico: Another question: Why do you want to use USBasp rather than the bootloader/COM serial port method for programming sketches? Or do you actually want to use a bootloader for programming sketches, and you only want to use USBasp to get a bootloader installed? If so, what (do you think) happened to the bootloader on the Arduino in the first place?

I want to use Serial Port to upload but I can't. I just used the USBasp to get a bootloader installed. Saddly, I don't know the answer to the last question.

Is it a hardware problem?

arduinoTime: Sorry, I thought you're asking how did I burn the bootloader via USBasp face palm I followed your procedure--File| Upload using Programmer

That's for uploading a sketch via USBasp. To burn the bootloader, you go to "tools|burn bootloader"

arduinoTime:

pico: Going back a few steps: Did you ever manage to upload anything to the Arduino before you attempted to burn a bootloader using USBasp? The Arduino should have come with a bootloader installed, and so it should have been able to be programmed using the COM serial port method out of the box without ever having had anything to do with USBasp or similar.

Yes, I have uploaded codes before but then it started producing the USBasp error. I thought the bootloader was the problem so I bought USBasp and burn the bootloader. Now I can only upload with the help of USBasp programmer.

Wait -- how could you have started producing the USBasp error before you bought the USBasp?

You were getting some sort of error trying to upload sketches before you bought the USBasp, but after you had been successfully uploading sketches previously. So, thinking the bootloader may have been corrupted somehow, you bought the USBasp to try to burn a fresh one, but you aren't having any luck getting the USBasp to work either. Correct?

arduinoTime:

pico: Another question: Why do you want to use USBasp rather than the bootloader/COM serial port method for programming sketches? Or do you actually want to use a bootloader for programming sketches, and you only want to use USBasp to get a bootloader installed? If so, what (do you think) happened to the bootloader on the Arduino in the first place?

I want to use Serial Port to upload but I can't. I just used the USBasp to get a bootloader installed. Saddly, I don't know the answer to the last question.

Is it a hardware problem?

I think it's more likely to be a software problem from what you describe. Your original bootloader may well be still intact from what I can gather. Do you have another machine to see if you can communicate with your Arduino using that?

Sorry it took so long to reply,

pico: It's possible you saw that IDE message even if the avrdude process failed -- the IDE doesn't seem to track errlevel exit codes very well. You would have to be paying attention to the avrdude output in the window to be sure that it had actually succeeded.

Tried using the avrdude to burn bootloader, I think you're right--it failed. I followed the procedure here SETUP

avrdude -B 25 -c usbasp -p m168

avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.02s
avrdude: Device signature = 0x1e950f
avrdude: safemode: Fuses OK
avrdude done.  Thank you.

FUSES

avrdude -B 25 -c usbasp -p m168 -t

>>dump lfuse
0000 df
>>dump hfuse
0000 d6
>>dump efuse
0000 00

I checked here and changed it to lfuse to:62, hfuse to:DF

but got an error when I change efuse to:F9

avrdude -B 25 -c usbasp -p m168 -u -U efuse:w:0xF9:m

verification error, first mismatch at byte 00x0000 0xf9 != 0x01
verification error; content mismatch

--? I don't know

I still proceed to BOOTLOADER

avrdude -B 25 -c usbasp -p m168 -u -U flash:w:ATmegaBOOT_168_atmega328.hex

ERROR: address 0x7810 out of range at line 1 of ATmegaBOOT_168_atmega328.hex
write to file 'ATmegaBOOT_168_atmega328.hex' failed

Maybe the file is out of range because of the efuse? How can I fix it?