Fixing USBasp based on ATmega8

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?

john1993:
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?

I checked the resistors and mine says its 101. So no reason to change these. Also, none of the LED's works(J2 unbridged). So my guess is this one was broken already, tried all the usb ports and 2 different pc's (win 7 and win xp). As mentioned in the link, you never know what you will get when you order one. I'll check the 2nd usbasp that the sender offered me when I replied that he send my a broken one.
The only reason I ordered an USBasp was that I could reflash my KK 2.0 board. But in the meantime I managed to do this with using the Arduino uno only (http://arduinodev.woofex.net/2013/02/11/how-to-flash-kk-2-0-using-an-arduino-uno/) now i'm also sure the arduino uno wasn't the problem.

[/quote]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?
[/quote]

I haven't updated the software because the moment I received it didn't work. The usbasp didn't accept any of the drivers, so my guess was this came empty and so I tried to upload the new firmware to it. what number does it say on yours usbasp (the 4 pack resistors)?

4pak on all mine, which are mostly betemcu, says 101 (100ohms). there are incompatible usbasp clones out there but rare i think. out of literally hundreds purchased on ebay and aliexpress for my business all of them worked except one. if an item is advertised as usbasp then it should perform 100% as one with avrdude. if not then replacement with one that does or refund is in order.

You guys seem to be wasting lots of time spinning your wheels and just guessing at things.
Guessing is not a good way to go about doing things and incorrect guesses
can lead to breaking things.
My suggestion is to put on your big boy pants, get out your magnifying glass,
and follow the traces on the PCB and see how the chip is wired up.
That way you will end up with a schematic of the board you have and
will know exactly how to hook things up to get it reprogrammed.

At a minimum you need to follow the traces from the AVR for:

  • reset
  • SCK
  • MISO
  • SS
  • where all jumpers are connected.
  • where all leds are connected

It isn't that hard to do I do this all the time on these low cost boards
from USBasp boards to Arduino shields.
It shouldn't take more than half an hour at most, and my guess
is that more than half an hour of time has been burned/lost already
just guessing at things.

Also, keep in mind that not all the vendors wire up the jumpers and LEDs to the same
pins. Some change the connections and then change the firmware to match their wiring.
So after drawing up the schematic for your board, you need to verify that connections
for the LEDs and jumpers match what is used by the firmware you are attempting to burn
into the device.
If you find that your board is not using the default wiring,
you may see that you have to go in and make some small tweaks to the actual
firmware and to make a custom firmware build for that board.
I've had to do this on one occasion.

--- bill

If you get the MX-USBISP-V3.00 boards that don't have the three solder bridges then they are super easy if you have two or more.

Just use one as programmer and the other as target, connected by the 10 pin cable that comes with them.

Jumper the target between the indicated vias (a cut leg from a 0.1uF capacitor makes a perfect removable jumper).

Get the standard Atmega8 latest firmware from fischl.de and flash using avrdude with 'usbasp' as programmer.

I set up various DOS batch files for testing connection, backing up original firmware, restoring original firmware and flashing the new firmware.

Once set up. it literally takes about 20-30 seconds to jumper a programmer, plug it in to the ribbon and double click the batch file to flash the latest firmware.

tack:
Once set up. it literally takes about 20-30 seconds to jumper a programmer, plug it in to the ribbon and double click the batch file to flash the latest firmware.

Once set up
And that is the big step for many folks
since there are so many different versions of the circuit and PCB layout floating around out there
and many people don't want to take the time to analyze their PCB and put their
tools in place to do the update.
As with many things in life, the actual time to do the task is minimal, it is
the prep work that takes all the time.

--- bill

Up date firmware usbasp betemcu.cn

first down load file firmware for betemcu.cn
prepair the usb-FT232 or usb basic breakout for update firmware.
connect j2 on usbasp betemcu and connect to usb ft232 via isp port.
open software for upload firmware
load firmware file for update do upload till done.

after that usbasp can work on eXtreme burner and AVRpal.net

download file for update firmware "arduino as usb asp.zip on google
//code.google.com/p/arduino-as-an-usbasp-programmer/downloads/list
or
//code.google.com/p/arduino-as-an-usbasp-programmer/downloads/detail?name=arduino%20as%20usb%20asp.zip&can=2&q=

notebook with wind7 64bit----->USB basic breakout------------>usbasp betemcu.cn (J2short).

I was test to upload bootloader ATMEGA8 on STK200.

Hey guys and gals. Wondering if I can get some help here. I am trying to upload simonk firmware to my ESC for my quadcopter, and can't seem to get my usbasp working. I have tried several different ways, but I think it is a problem similar to what has been discussed in this thread so far, but its over a year old, and I can't really follow everything or know if it is still viable advise.

here is what I bought.STK500 USBASP AVR Programmer Adapter Board USB 10Pin to 6Pin Adapter For Arduino | eBay
and here is what I got
As you can plainly see, not the exact same thing, and the listing shows a jumper, and mine has nothing.

Now I have several tools available to me but I am not super tech savvy when it comes to hardware.

I have a FTDI USB adapter that is known working. I have used it to upload to Pro Mini so I know it works.
I have several pro mini 5v boards, 2 Unos and a mega and even a decimilanova or however you spell it.
I bought this Radio Control Planes, Drones, Cars, FPV, Quadcopters and more - Hobbyking socket adapter from Hobbyking and would have bought the companion usbasp from them also, but they have been out of stock for a while now. I figured that this ebay one suffice.

If anyone can help me either get this usbasp/isp thing I bought to work, that would be amazing. if there is a way I can wire that socket adapter to an arduino and upload new firmware to my Multistar 30A ESC Radio Control Planes, Drones, Cars, FPV, Quadcopters and more - Hobbyking, i am fine with that too.

Help me, and I would be grateful.

M

See my reply #34 earlier in this thread, Fixing USBasp based on ATmega8 - #35 by hiduino - Microcontrollers - Arduino Forum.

The main point is you will need to short the to holes pointing to "UP". Then connect up the header to another ISP programmer to upload the new image to the atmega8. Similar to reply #38, Fixing USBasp based on ATmega8 - #39 by hiduino - Microcontrollers - Arduino Forum.

Hi guys,
I've bought economic USBasp and I'm trying to update firmware through Arduino ISP (Arduino UNO), but I've these errors:

avrdude -C /etc/avrdude.conf -c avrisp -P /dev/ttyACM0 -b 19200 -p atmega8 -v


avrdude: Version 6.0.1, compiled on Oct 21 2013 at 15:55:32
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "/etc/avrdude.conf"
         User configuration file is "/home/stefano/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyACM0
         Using Programmer              : avrisp
         Overriding Baud Rate          : 19200
         AVR Part                      : ATmega8
         Chip Erase delay              : 10000 us
         PAGEL                         : PD7
         BS2                           : PC2
         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         4    20   128    0 no        512    4      0  9000  9000 0xff 0xff
           flash         33    10    64    0 yes      8192   64    128  4500  4500 0xff 0x00
           lfuse          0     0     0    0 no          1    0      0  2000  2000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  2000  2000 0x00 0x00
           lock           0     0     0    0 no          1    0      0  2000  2000 0x00 0x00
           calibration    0     0     0    0 no          4    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : STK500
         Description     : Atmel AVR ISP

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x14

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x02

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x10
         Hardware Version: 4240346
         Firmware Version: 6714016.0
         Topcard         : STK502
         Vtarget         : 1.8 V
         Varef           : 0.0 V
         Oscillator      : Off
         SCK period      : 0.1 us

avrdude: stk500_initialize(): (b) protocol error, expect=0x10, resp=0x01
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x10

avrdude done.  Thank you.

I tried various tricks to solve this issue, but for me the problem is very hard to solve :frowning:
Can you help me?
Thanks.
Regards.

Stefano

bperrybap:
After that, it was a snap to program the software.
As an added bonus, I went in and modified the firmware to show activity on the green LED.
By default the Green LED just turns on Green and stays green while the device is plugged in.
The RED led turns on when avrdude tells the device to attach to the AVR chip.
I modified the code to turn off the green led while the firmware is actually talking to the
AVR chip and solid green while idle. The result is that the green now LED flickers while
the USBasp device is actually talking to the AVR.

Would you mind giving more explanations on that or writing your code here?
Thanks.

ok, for anybody interested in the modified blinking LED behavior, attached is the main.c file from the 2009-02-28 firmware which has all the needed modifications.
I have included the orignal main.c and my modified one.
If you want the new behavior simply update your main.c with this one and rebuild the firmware.

I have not looked at the newer release, but it is likely that this modified file will not be a drop in for anything but the 2009-02-28 release.

--- bill

USBaspMain.zip (3.62 KB)

Thanks a lot.
I implemented the associated lines to the usbasp 2011.05.28 version and it works fine.
:slight_smile:

sina_80:
Thanks a lot.
I implemented the associated lines to the usbasp 2011.05.28 version and it works fine.
:slight_smile:

I figured it should work as the changes are quite minimal/trival.
I just hadn't taken the time to take a look since the newer firmware won't fit in the device I have.

--- bill

i know it is a old post by the way i couldn t figure out how to program this usbasp

so this is my usbasp with driver from zadig correctly recognized by my windows 10 mount an atmega8A au

this is what i do:

I upload the sketch arduino isp programmer on my uno
Than i make the connection with the usbasp

i try the connection of JP2 and/or 3 to allow the programming
the JP3 is between the pin PC2 of the atmega8A that is a ADC, is possible that is it?
the JP2 is connected to the reset on the ISP

my cmd promt:

D:\Programmi\AVR\bin> avrdude -c arduino -p atmega8 -P COM3 -F -v

avrdude: Version 5.10, compiled on Jan 19 2010 at 10:45:23
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "D:\Programmi\AVR\bin\avrdude.conf"

         Using Port                    : COM3
         Using Programmer              : arduino
         AVR Part                      : ATMEGA8
         Chip Erase delay              : 10000 us
         PAGEL                         : PD7
         BS2                           : PC2
         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         4    20   128    0 no        512    4      0  9000  9000 0xff 0xff
           flash         33    10    64    0 yes      8192   64    128  4500  4500 0xff 0x00
           lfuse          0     0     0    0 no          1    0      0  2000  2000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  2000  2000 0x00 0x00
           lock           0     0     0    0 no          1    0      0  2000  2000 0x00 0x00
           calibration    0     0     0    0 no          4    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : Arduino
         Description     : Arduino
         Hardware Version: 3
         Firmware Version: 4.4
         Vtarget         : 0.3 V
         Varef           : 0.3 V
         Oscillator      : 28.800 kHz
         SCK period      : 3.3 us

avrdude: AVR device initialized and ready to accept instructions

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

avrdude: Device signature = 0x1e950f
avrdude: Expected signature for ATMEGA8 is 1E 93 07
avrdude: safemode: lfuse reads as 0
avrdude: safemode: hfuse reads as 0

avrdude: safemode: lfuse reads as 0
avrdude: safemode: hfuse reads as 0
avrdude: safemode: Fuses OK

avrdude done.  Thank you.

i also tryed to set the fuses according to this guide How to Update the Firmware on a USBasp V2.0 – Lincomatic's DIY Blog but obviusly it didn t let me do it

Uh, I'm going to say you haven't disabled reset, and are using the wrong avrdude command so it is resetting the board and talking to the bootloader on the uno. Disable autoreset with a cap (~10uf is good) between reset and ground on uno after uploading sketch, and that command line is wrong. I know the baud rate is lower. And I think protocol may be different, not sure, on phone now.

I don't know how you have things wired up for your Arduino ISP but it isn't correct.
avrdude: Device signature = 0x1e950f
That signature is for a atmega328p so somehow you are talking to the Arduino AVR and not the USBasp.
(unless the chip on your USBasp is really a atmega328p)

I prefer to use a dedicated AVR programmer like another USBasp, USBTiny, AVR Dragon, etc... when doing ISP programming.

Once you get that resolved, you could use my updated usbasp f/w here: GitHub - bperrybap/usbasp at 1.06-alpha

Use the 1.06-alpha branch.

It has many f/w updates & fixes (inlcuding auto SCK clock detection) and contains some tools to help updating the f/w.
You can use the winflash.bat to do the update and drag and drop the desired image on top of it.
You will have to enter the programmer and port types or alter the .bat file if you want to hardcode them.

In order to program you must connect the reset pin of the AVR chip on the board to the ISP header to allow the programmer to ground it for programming. From your description it sounds like that is JP2.
So JP2 will need to be shorted.

--- bill

DrAzzy:
Uh, I'm going to say you haven't disabled reset, and are using the wrong avrdude command so it is resetting the board and talking to the bootloader on the uno. Disable autoreset with a cap (~10uf is good) between reset and ground on uno after uploading sketch, and that command line is wrong. I know the baud rate is lower. And I think protocol may be different, not sure, on phone now.

i think, but i m not sure, that my comand line is ok, i mean i used the "same" to flash an atmega 644 and it worked

added the cap between reset and ground, no luck
about the baud rate, i m not using it because, if i use it:

D:ProgrammiAVRbin>avrdude -P COM3 -c arduino -p m8  -b19200

avrdude: AVR device initialized and ready to accept instructions

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

avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override
         this check.


avrdude done.  Thank you.

bill, it is a atmega8 :frowning:
anyway i ll for sure use your firmware since i read that the original firmware have a few bugs
grounded jp2 (i also tried to ground jp3) but i still don t have luck

my connection

my finger is there to cover the red led
on the isp there is a gap between brown and red wire for the unused NC
red wire(reset) go to the breadboard where there is a cap to the ground and the green wire to pin 10
power from the arduino

aster94:
bill, it is a atmega8 :frowning:
anyway i ll for sure use your firmware since i read that the original firmware have a few bugs
grounded jp2 (i also tried to ground jp3) but i still don t have luck

The atmega8 is fine. That is what is on the USBasp device that I have and have done lots of testing with it. The stock f/w does not fit into that part. I did lots of updates to get things to fit into that part.

The first thing you have to do is to get the ArduinoISP stuff working correctly.
Since you saw the signature for a atmega328p, DrAzzy is correct in that avrdude is talking to the bootloader code instead of the sketch which talks to the USBasp AVR over ISP.
You have to fix that first. Until you fix that, there is no point in going any further.

And how you "fix" the Arduino board to use the ArduinoISP sketch varies depending on the board. All the "fixes" for this are total hacks but most do tend to work, if you use the correct one for the board you have. But like I said I much prefer using a real ISP programmer since you won't have these sorts of ArduinoISP issues.

USBasp devices are so cheap, I'd recommend just buying two of them.

And for the jumpers. You do not ground the programming jumper. You must short the two pins for the correct header. This connects the reset pin from the AVR to the ISP header on the 10 pin ISP header so that the ISP programmer can control the AVR reset pin. Gounding either of those header jumper pins would not work, and grounding one of them would be bad and might damage the ISP programmer as it wants to control that pin. If you grounded it, there would be a short when the ISP programmers tries to set the pin to high.

--- bill

I wrote it wrong. The reset pin is in the JP1 that as you can see in the picture is correctly connected. On JP2 there is the alimentation.

But i don t understand, why if i check a atmega644 it give me the correct signature but if i look for the atmega8 it answer with the signature of the bootloader of the arduino isp?
Same sketch same connections