I am getting an error message when uploading a program using USBasp programmer. I think I am using a duplicate USBasp, anyhow it doesn't matter. I first get two Warning messages, then an Error message, but it shows Done Uploading:
Binary sketch size: 1,056 bytes (of a 32,256 byte maximum)
avrdude: Warning: cannot query manufacturer for device: error sending control message: Operation not permitted
avrdude: Warning: cannot query product for device: error sending control message: Operation not permitted
avrdude: error: could not find USB device with vid=0x16c0 pid=0x5dc vendor='www.fischl.de' product='USBasp'
You can try with 'sudo', or add the USBasp somewhere to a file for known devices (I forgot how to do that, I'm in Windows now).
Can you type 'lsusb' to see if your stick is connected. Perhaps it uses different numbers for vid or pid.
Below is the result of the lsusb. I think both vid and pid matches the one shown at Arduino IDE.
Bus 002 Device 004: ID 05c8:021e Cheng Uei Precision Industry Co., Ltd (Foxlink)
Bus 002 Device 008: ID 16c0:05dc Van Ooijen Technische Informatica shared ID for use with libusb
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0a5c:21e3 Broadcom Corp. HP Portable Valentine
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
In the above code, in the 2nd line you can see the IDs 16c0:05dc. These were the things shown at Arduino IDE, except that in Arduino IDE it showed:
avrdude: Warning: cannot query manufacturer for device: error sending control message: Operation not permitted
avrdude: Warning: cannot query product for device: error sending control message: Operation not permitted
avrdude: error: could not find USB device with vid=0x16c0 pid=0x5dc vendor='www.fischl.de' product='USBasp'
I think you don't have to change it in the Arduino IDE, I remember that I changed a system file to avoid the use of 'sudo'.
Can you type 'lsusb' in a terminal, connect the USBasp stick and type 'lsusb' again. See what has been added, and copy that line and paste it into your post.
Bus 002 Device 004: ID 05c8:021e Cheng Uei Precision Industry Co., Ltd (Foxlink)
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0a5c:21e3 Broadcom Corp. HP Portable Valentine
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
After Plugging USBasp:
Bus 002 Device 004: ID 05c8:021e Cheng Uei Precision Industry Co., Ltd (Foxlink)
Bus 002 Device 008: ID 16c0:05dc Van Ooijen Technische Informatica shared ID for use with libusb
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0a5c:21e3 Broadcom Corp. HP Portable Valentine
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
I started Arduino IDE using sudo. When I tried to upload, it showed the following error message:
avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: error: programm enable: target doesn't answer. 1
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.
The previous error didn't come up. The error above was the same one which came to me when I was trying to upload a program using Windows 7. Due to that error in Arduino in Windows 7, I had to switch to Arduino IDE in Ubuntu.
I am sure the SCK pins in the ATMega328P and the ISP 10 pin are connected properly. As far as I know, USBasp doesn't need drivers in Mac and Linux. I need help. Can you please ask other members to look into this problem. I think I can ignore the warning, but I cannot ignore the error.
I also ran avrdude using Terminal with sudo with the command:
sudo avrdude -P COM1 -p m328P -c usbasp -F
I got the following result:
avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: error: programm enable: target doesn't answer. 1
avrdude: initialization failed, rc=-1
avrdude: AVR device initialized and ready to accept instructions
avrdude: Device signature = 0xc87722
avrdude: Expected signature for ATmega328P is 1E 95 0F
avrdude done. Thank you.
The USBasp doesn't have a good connection to the Arduino.
Either some timing problem or it is damaged or the wiring is wrong. Older USBasp sticks did have more timing problems.
Please don't use the "-F" option, it is dangerous. It can write wrong code into the Arduino.
Why do you use COM1 ?, a programmer like the USBasp doesn't need a serial port.
Try this: sudo avrdude -c usbasp -p m328P -vvv
You can slow down the programmer with something like this: "-B 5 -i 100".