USBasp seems to be not working

Hi,
Tried to program ATTINY85 using USBasp, and i got error...

Sketch uses 248 bytes (3%) of program storage space. Maximum is 8192 bytes.
Global variables use 9 bytes (1%) of dynamic memory, leaving 503 bytes for local variables. Maximum is 512 bytes.
avrdude: set SCK frequency to 187500 Hz
avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: error: program enable: target doesn't answer. 0 
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

Failed programming: uploading error: exit status 1

While using avrdude directly - works perfect...

Is that a bug?

I don't think it's a bug.
It looks like your direct avrdude command does not change the clock frequency of the upload but your IDE upload attempts to change the clock first, which the old firmware in your USBASP adapter does not support.

If you turn on "verbose output" in the settings of your IDE, you can see which commands it sends to your USBASP adapter. I expect you will see -b 187500 somewhere in the command string.

But that normally only generates a warning?

Old firmware? Of course its old :smiley: Newest USBasp firmware is from 2011...

But anyway, should be a way to change command line parameters in arduino IDE...?

The one from Fischl is indeed old.

But others are still working on it. There is even a 3 days old beta release.

Anyway. Assuming you have the one from Fischl I see your Attiny85 is clocked at 1MHz according the fuse setting in your screenshot.

If you have a USBASP adapter like this, you see two holes in the top left corner JP3
solder two pinheaders and put a jumper there and it should go in slow transfer mode, so you can program a 1MHz clocked part or set it to 8 MHz and after that program it in fast mode by removing the jumper.

No, i'm using the one that i built myself, i also have a "factory" one... and it's the same error whichever i use...

Butok, if its a firmware issue, where i can find one that i can trust? I will flash then both of them...

At last I was able to reproduce your error with a USBASP adapter with fischl firmware
Only when I install a libusb0 driver for the USBASP I get your error
I am using Zadig for swapping drivers

image
on the left side you see my active driver, which then results in this error

avrdude: Version 6.3-20190619
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "E:\Arduino\arduino-1.8.13-attinycore\portable\sketchbook\hardware\ATTinyCore\avr/avrdude.conf"

         Using Port                    : usb
         Using Programmer              : usbasp
         Setting bit clk period        : 5.0
         AVR Part                      : ATtiny85
         Chip Erase delay              : 400000 us
         PAGEL                         : P00
         BS2                           : P00
         RESET disposition             : possible i/o
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    12     4    0 no        512    4      0  4000  4500 0xff 0xff
           flash         65    12    32    0 yes      8192   64    128 30000 30000 0xff 0xff
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           calibration    0     0     0    0 no          2    0      0     0     0 0x00 0x00

         Programmer Type : usbasp
         Description     : USBasp, http://www.fischl.de/usbasp/

avrdude: set SCK frequency to 187500 Hz
avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: error: program enable: target doesn't answer. 0 
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.


avrdude done.  Thank you.

When I change back to the WinUSB driver or the LibusbK driver (select "replace driver") the error dissapears.

image

resulting in:

avrdude: Version 6.3-20190619
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "E:\Arduino\arduino-1.8.13-attinycore\portable\sketchbook\hardware\ATTinyCore\avr/avrdude.conf"

         Using Port                    : usb
         Using Programmer              : usbasp
         Setting bit clk period        : 5.0
         AVR Part                      : ATtiny85
         Chip Erase delay              : 400000 us
         PAGEL                         : P00
         BS2                           : P00
         RESET disposition             : possible i/o
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    12     4    0 no        512    4      0  4000  4500 0xff 0xff
           flash         65    12    32    0 yes      8192   64    128 30000 30000 0xff 0xff
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           calibration    0     0     0    0 no          2    0      0     0     0 0x00 0x00

         Programmer Type : usbasp
         Description     : USBasp, http://www.fischl.de/usbasp/

avrdude: set SCK frequency to 187500 Hz
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x1e930b (probably t85)
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: set SCK frequency to 187500 Hz
avrdude: reading input file "C:\Users\Hans\AppData\Local\Temp\arduino_build_476519/Attiny85_and_45_BMP180_integrated_solenoid_driver_V2.0.ino.hex"
avrdude: writing flash (3462 bytes):

Writing | ################################################## | 100% 1.75s

avrdude: 3462 bytes of flash written
avrdude: verifying flash memory against C:\Users\Hans\AppData\Local\Temp\arduino_build_476519/Attiny85_and_45_BMP180_integrated_solenoid_driver_V2.0.ino.hex:
avrdude: load data flash data from input file C:\Users\Hans\AppData\Local\Temp\arduino_build_476519/Attiny85_and_45_BMP180_integrated_solenoid_driver_V2.0.ino.hex:
avrdude: input file C:\Users\Hans\AppData\Local\Temp\arduino_build_476519/Attiny85_and_45_BMP180_integrated_solenoid_driver_V2.0.ino.hex contains 3462 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 1.42s

avrdude: verifying ...
avrdude: 3462 bytes of flash verified

avrdude done.  Thank you.

So I recommend you check with Zadig, which driver you have and change if needed.

When using Zadig, make sure to select "List all devices" from the options menu. Or you won't see your USBASP.

Yep, that helped, works now... :nerd_face:

Hi,

Nice !

If you've some spare time is it possible to try the WCID firmware also ( Release v1.11 · dioannidis/usbasp · GitHub ) ? ( see also GitHub - dioannidis/usbasp: usbasp improved firmware ) .

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.