Fixing USBasp based on ATmega8

http://www.fischl.de/usbasp/

pito:
USBasp - USB programmer for Atmel AVR controllers - fischl.de

Yep, I've read the readme.txt but it's a bit complicated for me. I've downloaded the usbasp.2011-05-28.tar.gz archive, there is a main.c file, is that the one that I need to load into Arduino IDE?

If I try to use the USBasp as programmer, i.e. in Arduino IDE upload using programmer then I get "avrdude: warning: cannot set sck period. please check for usbasp firmware update.", twice. The readme.txt file states
"- SCK option to support targets with low clock speed (< 1,5MHz)."
So maybe it's not a firmware issue?

Maybe someone here could explain how to do this using avrdude GUI?

The "avrdude: warning" can be ignored. It's just a warning that the programming clock speed is not manually adjustable. You should be able to program most devices with your current firmware in the USBasp programmer. The only time you may need to update the firmware is if you want to program AVR devices running below 1 MHz clocking. Like some ATtiny's running at 128KHz or even down at 16KHz.

Note: the fischl.de firmware is not made for the Arduino IDE. There is already pre-compiled hex files in the archive file, see \usbasp.2011-05-28\bin\firmware\usbasp.atmega8.2011-05-28.hex. You will need to use avrdude from commandline to upload.

You need to give the full path for avrdude and it's config file. Or you can run it from Arduino IDE install path. I find it easier to run from (If from Windows commandline):

C:\> cd C:\Documents and Settings\User\My Documents\arduino-1.0.5\hardware\tools\avr\etc

C:\Documents and Settings\User\My Documents\arduino-1.0.5\hardware\tools\avr\etc>..\bin\avrdude -c arduino -PCOM6 -b19200 -p m8 -v -U flash:w:usbasp.atmega8.2011-05-28.hex

Note: you need to copy the hex file to \arduino-1.0.5\hardware\tools\avr\etc dir.

naut:
I get "avrdude" not found when trying to run this. Have I forgotten something?

The directory where avrdude is probably is not on your path.
It is in {installdir}\hardware\tools\avr\bin

--- bill

hiduino:
It's just a warning that the programming clock speed is not manually adjustable.

Actually it means that the programming clock speed is not settable over the USB by avrdude.
USBASP firmware (unless modified) always allows a manual clock speed setting to a slow
clock with a jumper. The newer versions of the firmware also allow setting the clock
speed via USB through a new USBASP command.
(There is discussion about this earlier in this thread)

I have no idea what this comment means:

Note: the fischl.de firmware is not made for the Arduino IDE.

I can update sketches or bootloaders using the avrdude commandline or the Arduino GUI
with the latest usbasp f/w.

I use the latest fischel image to allow clock setting from avrdude and I also use a later version of
avrdude than what is supplied by the Arduino team.
(I built the later avrdude myself from the avrdude repository)
The one supplied by the Arduino teams works, but later versions of avrdude have support
to skip over flash areas that don't need to be programmed. When burning a bootloader it
reduces the burn/verify time from a few minutes to 2-3 seconds. It is very noticeable.
I also modified my the fischel f/w so that the leds work slightly differently.
One lights when writing to the AVR and one lights when reading the AVR.
It is kind of neat to see the operation progress but when using the newer avrdude
to burn a bootloader, it is so fast that you don't really see much.
For sketches you have more time to see the operation in progress.

--- bill

bperrybap:
Actually it means that the programming clock speed is not settable over the USB by avrdude.
USBASP firmware (unless modified) always allows a manual clock speed setting to a slow
clock with a jumper. The newer versions of the firmware also allow setting the clock
speed via USB through a new USBASP command.

We are talking about the same thing. When I say "manual", I was referring to the command line option -B. You can manually specify it (the sck clock speed) in the command line.

Note: the fischl.de firmware is not made for the Arduino IDE.

I was responding to @naut, was asking how to build the fischl firmware, main.c in the IDE.

The "avrdude: warning" can be ignored. It's just a warning that the programming clock speed is not manually adjustable. You should be able to program most devices with your current firmware in the USBasp programmer.

yep, I've read in other topics that the "avrdude: warning: cannot set sck period. please check for usbasp firmware update" can be ignored, but I've tried to upload the blink sketch to a Atmega48-20pu chip (same pinout as the 328p) and the led doesn't blink.

C:\Documents and Settings\User\My Documents\arduino-1.0.5\hardware\tools\avr\etc>..\bin\avrdude -c arduino -PCOM6 -b19200 -p m8 -v -U flash:w:usbasp.atmega8.2011-05-28.hex

Note: you need to copy the hex file to \arduino-1.0.5\hardware\tools\avr\etc dir.

I tried it and got this:

I was responding to @naut, was asking how to build the fischl firmware, main.c in the IDE.

So I could add all the needed header and ccp files to the arduino library, open the main.c file in the IDE, use a 2009 as ISP programmer, hit upload and the firmware would be uploaded to the USBasp?

hiduino:

bperrybap:
Actually it means that the programming clock speed is not settable over the USB by avrdude.
USBASP firmware (unless modified) always allows a manual clock speed setting to a slow
clock with a jumper. The newer versions of the firmware also allow setting the clock
speed via USB through a new USBASP command.

We are talking about the same thing. When I say "manual", I was referring to the command line option -B. You can manually specify it (the sck clock speed) in the command line.

ah, ok.
The bummer is that the new avrdude attempts to set the clock rate over USB via the new USBASP command
even if the user does not ask for it to be done via -B.
(By default avrdude sends the command just to tell the USBASP device to use its default clock)
That is why the warning shows up.
I consider that misbehavior.
I think that if the user didn't ask for it, avrdude should not attempt to set it and let
the device run with the built in default clock rate inside the f/w.
This would end up using the same clock rate it is using now since by
default, avrdude sends the USBASP command to set the clock rate
just to tell the f/w to use the default rate inside inside it's f/w.

naut:

I was responding to @naut, was asking how to build the fischl firmware, main.c in the IDE.

So I could add all the needed header and ccp files to the arduino library, open the main.c file in the IDE, use a 2009 as ISP programmer, hit upload and the firmware would be uploaded to the USBasp?

No.
You need to use the makefile to build the usbasp firmware.

--- bill

naut:
yep, I've read in other topics that the "avrdude: warning: cannot set sck period. please check for usbasp firmware update" can be ignored, but I've tried to upload the blink sketch to a Atmega48-20pu chip (same pinout as the 328p) and the led doesn't blink.

That is a different problem not caused by the USBasp firmware version. There could be many other causes for blink sketch not to work. Especially if you are using a non standard ATmega48. You need open a new post for this.

As for updating the USBasp firmware, you are in the wrong directory for the instructions. You should be in the \etc dir and use the relative path for the ..\bin\avrdude. Look more closely at the details of the instructions.

hiduino:
I have purchased several of these Chinese USBasp programmers with the metal case covers. These are very nicely built.
New USB ISP USBISP USBasp ASP Programmer For 51 ATMEL AVR WIN7 64 | eBay

You can also get them cheaper in bulk for about $4.00 ea.

http://www.ebay.com/itm/8pcs-lot-Colors-USB-ISP-USBISP-USBasp-ASP-Programmer-for-51-ATMEL-AVR-Download-/160828867138?pt=LH_DefaultDomain_0&hash=item257225c242

They are based on the USBasp circuit design with an Atmega8L. The problem with these are they do not actually use the USBasp firmware. They do not work direclty with avrdude. They emulate an USB HID device so they can install without any Windows drivers. The catch is they need to use a special Windows GUI (progisp.exe) program to burn AVRs. They are based on the MX-USBISP-V3.00 2012-05-20 pcb. See image.

I found that you can reprogram these with the fischl.de usbasp.atmega8.2009-02-28.hex or usbasp.atmega8.2011-05-28.hex firmware and they seem to work great.

  1. They usually have the lock bits set so you will have to erase it first.
  2. Also the back of the pcb have three solder bridges that need to be removed. See image.
  3. Short the two holes the arrows are pointing from to the UP label. This is the RESET line for self-programming.


Just a heads up. If anyone get the error like below when using the programmer (after reflashed), it is because the programmer tries to send data too fast.

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.

This programmer doesn't have the jumper to set the speed. Fortunately, the firmware supports the -B bitclock option which can be used to change the ISP speed. If you use avrdude, just pass the -B parameter like below (the the higher the bitclock, the slower the ISP speed):

avrdude -c usbasp -P usb -p m328p -v -B 10

With Arduino IDE, as hiduino have shown me (note there is a semicolon after the bitclock):

hiduino:
There is no direct way to control the programming speed from the IDE. However, you can configure the defaults in avrdude.conf to slow down the programming. Just keep in mind this will affect all programming from avrdude.

Look for this line in avrdude.conf (around line 320):

# default_bitclock = 2.5;

Remove the comment tag and change it to somewhere around 10 to 20:

default_bitclock = 15;

That should slow the programming down enough.

hiduino:
Actually, if you want to be more specific.

For target AVRs down to running at 1MHz you can use:

default_bitclock = 3;

For target AVRs down to running at 128KHz you can use:

default_bitclock = 32;

Then if you dare go down to 16KHz:

default_bitclock = 128;

I've recently purchased one of this USBasp, MX-USBISP-V3.00, 2013-03-15.

I also tried setting -B 10 up to 256 but I still got the warning:

avrdude: warning: cannot set sck period. please check for usbasp firmware update.

USBasp.jpg

flurin:
I've recently purchased one of this USBasp, MX-USBISP-V3.00, 2013-03-15.

I also tried setting -B 10 up to 256 but I still got the warning:

avrdude: warning: cannot set sck period. please check for usbasp firmware update.

Not surprising. Your device has old firmware.

bperrybap:
Not surprising. Your device has old firmware.

Okay. Is there an new version of MX-USBISP or have I to use usbasp.atmega8.2011-05-28.hex?

No special firmware, only the standard fischl releases, usbasp.atmega8.2011-05-28.hex.

hiduino:
No special firmware, only the standard fischl releases, usbasp.atmega8.2011-05-28.hex.

Thanks. I've also found this solution.

I'm still investigating ...

Yes, that Uwezi solution will work when you don't remove the three solder bridges on the back of the programmer.

If you use the standard fischl firmware then you will need to remove the three solder bridges.

Either way they both work.

hiduino:
Yes, that Uwezi solution will work when you don't remove the three solder bridges on the back of the programmer.

If you use the standard fischl firmware then you will need to remove the three solder bridges.

Either way they both work.

Thanks, I did it using Uwezi file 20130212_mega8_usbisp.hex.
(Note I used my Arduino Mega 2560 board as ISP)

Hello,

I'm sorry to bump this up but I recently received a usbasp and I just can't get it to work. To be more specific, it's this one: lIl KK Board AVR USBasp ISP mit 6pin Adapter | eBay

on the chip is written atmega8l

I tried alot of things with avrdude but I just keep getting device signature 0x000000. I'm using an arduino uno where I cleared the eeprom first and than uploaded the ArduinoISP sketch onto it. I basically followed this tutorial: http://www.rogerclark.net/?p=702

But whatever I do I just can't get the thing to work. In the device manager it keeps saying unknown device(tried several drivers).

This is a screenshot when I have connected everything and I do the read:

as you can see it seems to read but in the end it just gives the device signature 0x00000 error.

when I than try to flash the new firmware from USBasp - USB programmer for Atmel AVR controllers - fischl.de I receive the following:

I also tried with the -F and the -B 2(also 6, 8 and 10) options but without any luck. I am able to backup the "original_firmware.bin" version of the board. But again, can't write it back.
I'm starting to believe this usbasp was broken before I even received it.
What you guys think? Is there hope to repair this?