Go Down

Topic: Fixing USBasp based on ATmega8 (Read 73496 times) previous topic - next topic

tack

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.

bperrybap


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

sakhir

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.

michaeli

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.http://cgi.ebay.ca/ws/eBayISAPI.dll?ViewItem&item=300956937549
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 http://tinyurl.com/o3cxma3 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 http://tinyurl.com/l9ts8wb, i am fine with that too.

Help me, and I would be grateful.

M


hiduino

See my reply #34 earlier in this thread, http://forum.arduino.cc/index.php/topic,149668.msg1138408.html#msg1138408.

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, http://forum.arduino.cc/index.php?topic=149668.msg1200311#msg1200311.

Stefanoxjx

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

Code: [Select]

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 :(
Can you help me?
Thanks.
Regards.

Stefano

sina_80

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.

bperrybap

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

sina_80

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

bperrybap

Thanks a lot.
I implemented the associated lines to the usbasp 2011.05.28 version and it works fine.
 :)
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

aster94

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:

Code: [Select]
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 http://blog.lincomatic.com/?p=1480 but obviusly it didn t let me do it

DrAzzy

#86
Sep 15, 2016, 01:13 am Last Edit: Sep 15, 2016, 01:14 am by 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.
ATtiny core for 841+1634+828 and x313/x4/x5/x61/x7/x8 series Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts (some assembled), mosfets and awesome prototyping board in my store http://tindie.com/stores/DrAzzy

bperrybap

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: https://github.com/bperrybap/usbasp/tree/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

aster94

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:

Code: [Select]

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 :(
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

bperrybap

bill, it is a atmega8 :(
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

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy