Pages: 1 2 3 [4] 5 6   Go Down
Author Topic: Fixing USBasp based on ATmega8  (Read 40342 times)
0 Members and 2 Guests are viewing this topic.
Rapa Nui
Offline Offline
Edison Member
*
Karma: 60
Posts: 2086
Pukao hats cleaning services
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

geo. area called Italia
Offline Offline
Full Member
***
Karma: 0
Posts: 196
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


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?
http://sourceforge.net/projects/avrdudegui/?source=dlp
Logged

Wahiawa, Hawaii
Offline Offline
God Member
*****
Karma: 36
Posts: 668
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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):
Code:
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.

Logged

Dallas, TX USA
Offline Offline
Faraday Member
**
Karma: 70
Posts: 2763
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Dallas, TX USA
Offline Offline
Faraday Member
**
Karma: 70
Posts: 2763
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
Quote
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
Logged

Wahiawa, Hawaii
Offline Offline
God Member
*****
Karma: 36
Posts: 668
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Quote
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.
« Last Edit: June 10, 2013, 06:57:44 pm by hiduino » Logged

geo. area called Italia
Offline Offline
Full Member
***
Karma: 0
Posts: 196
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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.

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



* avrdue_2009_usbasp.jpg (95.28 KB, 804x201 - viewed 92 times.)
Logged

geo. area called Italia
Offline Offline
Full Member
***
Karma: 0
Posts: 196
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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?
Logged

Dallas, TX USA
Offline Offline
Faraday Member
**
Karma: 70
Posts: 2763
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Dallas, TX USA
Offline Offline
Faraday Member
**
Karma: 70
Posts: 2763
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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
Logged

Wahiawa, Hawaii
Offline Offline
God Member
*****
Karma: 36
Posts: 668
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have purchased several of these Chinese USBasp programmers with the metal case covers.  These are very nicely built.
http://www.ebay.com/itm/New-USB-ISP-USBISP-USBasp-ASP-Programmer-For-51-ATMEL-AVR-WIN7-64-/180937536014?pt=LH_DefaultDomain_0&hash=item2a20b7b20e

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.

Code:
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):

Code:
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):
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):
Code:
# default_bitclock = 2.5;

Remove the comment tag and change it to somewhere around 10 to 20:
Code:
default_bitclock = 15;

That should slow the programming down enough.
Actually, if you want to be more specific.

For target AVRs down to running at 1MHz you can use:
Code:
default_bitclock = 3;
 

For target AVRs down to running at 128KHz you can use:
Code:
default_bitclock = 32;
 

Then if you dare go down to 16KHz:
Code:
default_bitclock = 128;
 
Logged

Switzerland
Offline Offline
Jr. Member
**
Karma: 1
Posts: 66
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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:

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


* USBasp.jpg (80.09 KB, 640x426 - viewed 128 times.)
« Last Edit: July 27, 2013, 03:11:16 am by flurin » Logged

Dallas, TX USA
Offline Offline
Faraday Member
**
Karma: 70
Posts: 2763
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:

Code:
avrdude: warning: cannot set sck period. please check for usbasp firmware update.
Not surprising. Your device has old firmware.
Logged

Switzerland
Offline Offline
Jr. Member
**
Karma: 1
Posts: 66
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Pages: 1 2 3 [4] 5 6   Go Up
Jump to: