Error while burn sketches with UsbASP

Hello, i'm trying to burn sketches using USBAsp in three differents Arduino, the first is Atmega128 and it's almost work, except the clock . example if i put delay(2000) the led blinks with 4s. The second and third have the same problem , this erros below:

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.

Which version of Arduino AVR Boards are you using? You can check at Tools > Board > Boards Manager.

Also, which operating system are you using?

When you encounter avrdude problems you should do File > Preferences > Show verbose output during > upload(check). Then try again. You will get much more information in the output. When you post that verbose output to the forum it will make it much easier for us to help you, in this case it would have answered both of my questions.

When you post error/warning messages or code to the forum please use code tags(</> button on the toolbar) to ensure proper formatting and make it easier to read and copy.

"target doesn't answer" is typically a wiring error.

I was thinking the problem was the driver issue I had with Arduino AVR Boards 1.6.2(https://github.com/arduino/avrdude-build-script/issues/1, which gave me the same error. After reading the this again, the fact that it was successful on one chip makes me think DrAzzy is right.

avrdude: Version 6.0.1, compiled on Apr 15 2015 at 19:59:58
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : usb
         Using Programmer              : usbasp
         AVR Part                      : ATmega2560
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PA0
         RESET disposition             : dedicated
         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    10     8    0 no       4096    8      0  9000  9000 0x00 0x00
           flash         65    10   256    0 yes    262144  256   1024  4500  4500 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
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

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

avrdude: auto set sck period (because given equals null)
avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e9801
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: auto set sck period (because given equals null)
avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: reading input file "C:\Users\ANACLA~1\AppData\Local\Temp\build9c9ef3bdfe2fccb480bc6e4bac749e41.tmp/Blink.ino.hex"
avrdude: writing flash (1554 bytes):

Writing | ################################################## | 100% 0.73s

avrdude: 1554 bytes of flash written
avrdude: verifying flash memory against C:\Users\ANACLA~1\AppData\Local\Temp\build9c9ef3bdfe2fccb480bc6e4bac749e41.tmp/Blink.ino.hex:
avrdude: load data flash data from input file C:\Users\ANACLA~1\AppData\Local\Temp\build9c9ef3bdfe2fccb480bc6e4bac749e41.tmp/Blink.ino.hex:
avrdude: input file C:\Users\ANACLA~1\AppData\Local\Temp\build9c9ef3bdfe2fccb480bc6e4bac749e41.tmp/Blink.ino.hex contains 1554 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.48s

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

avrdude done.  Thank you.

Not the driver issue because it’s avrdude 6.0.1.

Below is the error with my own board with atmega2560

avrdude: Version 6.0.1, compiled on Apr 15 2015 at 19:59:58
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : usb
         Using Programmer              : usbasp
         AVR Part                      : ATmega2560
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PA0
         RESET disposition             : dedicated
         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    10     8    0 no       4096    8      0  9000  9000 0x00 0x00
           flash         65    10   256    0 yes    262144  256   1024  4500  4500 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
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

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

avrdude: auto set sck period (because given equals null)
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.

Sounds like a wiring issue (or defective board) - you've demonstrated that the ide and usbasp is perfectly able to program stuff, even the same chip.

Is that an own - made board? If so, do other boards of same design work? If no post the schematic. If yes, ohm out the programming pins looking for bridged or poorly soldered connections.

Re issue with delay being wrong, you need to do burn bootloader first to set the fuses. By default it's set to run at 1mhz, so if you build with it set to 8mhz, things will run at the wrong speed.

The error indicates one of several problems. If it is raw chip, never used before, it runs at 1MHz internal clock by default. USBasp could have a problem with slow SCK. Try to short JP3 - slow SCK on USBasp programmer. It is close to USB connector.

USBasp_jumpers

DrAzzy: Sounds like a wiring issue (or defective board) - you've demonstrated that the ide and usbasp is perfectly able to program stuff, even the same chip.

Is that an own - made board? If so, do other boards of same design work? If no post the schematic. If yes, ohm out the programming pins looking for bridged or poorly soldered connections.

Re issue with delay being wrong, you need to do burn bootloader first to set the fuses. By default it's set to run at 1mhz, so if you build with it set to 8mhz, things will run at the wrong speed.

is the same schematic, i'm try to burn bootloader first but appers the same errors

Budvar10: The error indicates one of several problems. If it is raw chip, never used before, it runs at 1MHz internal clock by default. USBasp could have a problem with slow SCK. Try to short JP3 - slow SCK on USBasp programmer. It is close to USB connector.

USBasp_jumpers

is there any way to change the sck by software ? in the path, hardware/arduino/avr board.txt ? its strange cause with atmega1280 i dont have any problem, is just only with atmega2560 and below , im looking for how is to short jumper in my usbasp board, cause its different

http://forum.arduino.cc/index.php?topic=98294.0 Here i find that i can ignore the warning of set SCK and the error is programm enable: target doesn't answer. 1 is probably cause the micro dead, i will change it for a raw micro today and lets see what will happen

s there any way to change the sck by software ? in the path, hardware/arduino/avr board.txt ? its strange cause with atmega1280 i dont have any problem, is just only with atmega2560 and below , im looking for how is to short jumper in

In your version seems that pads for jumpers are missing. It is pin 25 on ATmega8 to be conected to GND somehow - see the schmatics on fischl.de.

Warning can be ignored, but as I mentioned the raw chip is running on internal 1MHz and the result is that the USBasp cannot communicate with the MCU if it is the problem. SW change doesn’t work. That is why jumper you have to use. .

I tested with a raw chip and it worked, i uploaded a blink and it runned. i change the conf in iom2560.h and fuse.h to lfuse: 0xF2 hfuse: 0xD9 efuse:0xFD before i changed it the sketch was uploading but not working But when i did it for the third turn it stopped working and gave the error below:

avrdude: auto set sck period (because given equals null)
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.

any guess?

First you say:

AnaClara: i uploaded a blink and it runned.

Then you say:

AnaClara: before i changed it the sketch was uploading but not working

Which is it? Did the LED blink or not. How did you upload, standard upload over USB using the bootloader(Sketch > Upload) or Sketch > Upload Using Programmer?

AnaClara: i change the conf in iom2560.h and fuse.h to lfuse: 0xF2 hfuse: 0xD9 efuse:0xFD

If you want to change the fuse values set when you do Tools > Burn Bootloader you can edit boards.txt. You should change those files back to their original state.