Problem with a USBasp

I have got this programmer USBasp from ebay "http://www.ebay.co.uk/itm/USBasp-USB-ISP-Programmer-3-3V-5V-AVR-ATMEL-ATMega8-Download-Pin-IDC-Cable-USB-/350887076068?pt=UK_BOI_Electrical_Components_Supplies_ET&hash=item51b27fe0e4"

When I connected to the PC I get:

Apr 20 01:03:42  udevd[1442]: invalid rule '/etc/udev/rules.d/80-Arduino_usbasp.rules:10' 
Apr 20 01:03:58 udevd[1442]: unknown key 'SYSFS{idVendor}' in /etc/udev/rules.d/80-Arduino_usbasp.rules:10 
Apr 20 01:03:58  udevd[1442]: invalid rule '/etc/udev/rules.d/80-Arduino_usbasp.rules:10' 
Apr 20 01:04:02 kernel: [52631.070078] usb 6-1: device descriptor read/64, error -71
Apr 20 01:04:02  kernel: [52631.284091] usb 6-1: device descriptor read/64, error -71
Apr 20 01:04:02  kernel: [52631.600062] usb 6-1: device descriptor read/64, error -71
Apr 20 01:04:02  kernel: [52631.814058] usb 6-1: device descriptor read/64, error -71
Apr 20 01:04:03  kernel: [52632.425054] usb 6-1: device not accepting address 40, error -71
Apr 20 01:04:03 kernel: [52632.935039] usb 6-1: device not accepting address 41, error -71
Apr 20 01:04:03  kernel: [52632.935073] hub 6-0:1.0: unable to enumerate USB device on port 1

This is the rule:

SUBSYSTEM=="usb", SYSFS{idVendor}=="16c0", SYSFS{idProduct}=="05dc", MODE="0666" , SYMLINK+="/ttyACM0"

It does create the link, but when I go to properties it does say "broken link"

Also in Arduino 1.0.2 it does say Serial port '/dev/ttyACMO' not found With avrduve it does say file not found.

I went to "http://www.fischl.de/usbasp/" and I did a pin out test and it looks it's the same

Now is the question, do I need to flash the programmer? What do I need to do to get this programmer up and running? Thanks

USBasp is not a serial device.
AVRdude uses libUSB to talk to the device directly using bulk transfers.

Here is the udev entry that I use on Linux Mint13

# USBasp - USB programmer for Atmel AVR controllers
# Copy this file to /etc/udev/rules.d

SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="05dc", MODE="0666", GROUP="plugdev"

Then make sure you are member of the plugdev group.

— bill

Hi Bill,

How should it call the device? I try this in a comand line:

avrdude -F -V -c arduino -p ATMEGA328P -P /dev/ttyACM0 -b 115200 -U flash:w:test.hex

it says: can't open device "/dev/ttyACM0"

I looked at the Dev is not there. Thanks

Update:

I looked a "dmesg" and I get this now:

[46436.500223] usb 6-1: USB disconnect, device number 13
[46438.456176] usb 6-1: new low-speed USB device number 14 using uhci_hcd
[46438.614430] usb 6-1: New USB device found, idVendor=16c0, idProduct=05dc
[46438.614437] usb 6-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[46438.614442] usb 6-1: Product: USBasp
[46438.614446] usb 6-1: Manufacturer: www.fischl.de

So there firmware is there, right?

Again, usbASP is not a serial port. Trying to talk to it and use it like a serial port ISP programmer will not work. avrdude talks to the usb device directly using libusb. usbASP is a known programmer type.

The most important command line options are:

-cusbasp -Pusb

-F should normally not be needed if everything is configured properly.

You can see the full avrdude command line if you turn on the verbose output during upload in the IDE.

There are tons of examples out there if you Google around for how to use USBasp with avrdude.

--- bill

Sorry I haven't realized I was sending serial command.

I now try this:

avrdude -V -c usbasp -p ATMEGA328P -U flash:w:test.hex

(end though I have not connected anything to the USBasp)

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.


avrdude done.  Thank you.

Which is the same message that I get in the Arduino IDE when I select "burn bootloader"

Update:

Also try this

avrdude -V -c usbasp -Pusb -p ATMEGA328P -U flash:w:test.hex

same result as previously.

Update 2:

I connected it to a UNO board and it's seen to be working I got this:

bash-4.2# avrdude -V -c usbasp -Pusb -p ATMEGA328P -u -U flash:w:test.hex

avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e950f
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: reading input file "test.hex"
avrdude: input file test.hex auto detected as Intel Hex
avrdude: writing flash (202 bytes):

Writing | ################################################## | 100% 0.12s



avrdude: 202 bytes of flash written

avrdude done.  Thank you.

It's still getting some warnings, Do I need to update? How do I know what firmware its on it?

Peter2013: Sorry I haven't realized I was sending serial command.

Really? Even though you told avrdude to use a tty device and specified a baud rate and to use the "arduino" serial protocol?

I now try this:

avrdude -V -c usbasp -p ATMEGA328P -U flash:w:test.hex

(end though I have not connected anything to the USBasp)

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.

avrdude done.  Thank you.




Which is the same message that I get in the Arduino IDE when I select "burn bootloader"

The key thing to be noticed from those messages is that it appears that avrdude is able to talk to the USBasp device. So now avrdude is seeing the usbASP device correctly.

The warning is because avrdude attempts to set the ISP sck clock speed by default and older USBasp firmware does not have this capability. While the newer USBasp f/w is better, the older f/w can still be used.

The error is because the USBasp device is not seeing the AVR chip. This can be because the AVR chip is dead or more that likely it is just as the error message states in that there is a connection issue on the wires between the usbASP and the AVR chip.

note: -F will not resolve the issue here as avrdude reported that the target doesn't answer rather than a chip type signature mismatch.

you could try to turn on more status information by using sever -v options. i.e. -v -v -v -v

But the problem is more than likely a wiring issue between the USBasp and the AVR or another issue that comes up is that the AVR has the fuses set for an external oscillator and no external oscillator is attached.

--- bill