Fixing USBasp based on ATmega8

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?

On that betamcu USBASP programmer, you need to jumper the two J2 pins together next to the MOSI pin on the 10-pin header. This will pass the reset pin from the header to the reset pin on the mega8L chip. Then you should be able to program it.

hiduino:
On that betamcu USBASP programmer, you need to jumper the two J2 pins together next to the MOSI pin on the 10-pin header. This will pass the reset pin from the header to the reset pin on the mega8L chip. Then you should be able to program it.

Hi hiduino,

I know that. That is what I did (that is also explained in the tutorial I followed). I even tried it without bridging the J2 connector but that way I wasn't even able to read the usbasp. So this is something else I believe.
I've read on the 3th page your post about you had an Atmega8L chip design a while ago and that those didn't come with the USBasp firmware but some kind of emulation instead.
Could it be that the bits are locked and I have to erase them first? If so, how can be this done?
Or I received just a broken usbasp..

The error you are getting indicates the m8l is not being reset. When you attempt to use avrdude on the m8l does the LED on the programmer turn off? If the LED stays on, then the m8l chip is not getting the reset signal.

hiduino:
The error you are getting indicates the m8l is not being reset. When you attempt to use avrdude on the m8l does the LED on the programmer turn off? If the LED stays on, then the m8l chip is not getting the reset signal.

I'm not sure about that, i'll check this once i'm home. With LED on the programmer you mean the LED on the arduino, right? Or the usbasp? Because if I remember correctly the usbasp led never lit up.

this is how I have set it up.

and the usbasp:

I also tried with the 10 pin to 6 pin converter but since the length only gets longer i'm not surprised this will even work.

There is an LED on the USBasp programmer that turn on under normal USB access, it should be off during avrdude access.

Does the LED on the USBasp even light up when you plug it in the USB (with the J2 un-jumpered)? If not then it does sound like it's bad.

USBasp_betamcu.PNG

none of the LED on the USBasp lits up. Not even when I insert the usb normally in the pc. This is indeed not good. But the pc does recognize the sub, but gives unknown device. I did found this though, http://openrcforums.com/forum/viewtopic.php?f=10&t=2571

these are exactly the same as mine. I didn't check if mine has the 221 resistors on it. I will check this later today and perhaps try to remove the 4 packs of resistors and replace them. I contacted the seller on ebay and he said he will send me another one.
Only question I have is if I remove the 221 resistor pack, will I still have to bridge the J2? Or won't this be necessary now?

my usbasp look the same but have a yellow power led that is on all the time. in fact i dab it with black nail polish to dim the glare. if its like mine and theres no light then probably its a bad usbasp? or bad usb port?

also note that changing to a different usb port usually requires running the driver again. however my power led stays on even without driver installed.

why did you update the software? why are you going to change the resistor? you are aware new 100% working usbasp are available on ebay for $2-$3?