Bill;
Thanks for the little kick in the butt. It went quickly and very well uploading the newer firmware and now it all still works but with no silly clock warning message at the end of operations.
Lefty
Bill;
Thanks for the little kick in the butt. It went quickly and very well uploading the newer firmware and now it all still works but with no silly clock warning message at the end of operations.
Lefty
bperrybap:
Locked/unlock AVR on the USBasp doesn't matter. You can simply erase the chip to remove the lock, set the fuses again, then burn/upload the image you want.
it definitely matters if the unit was locked and stops working with other firmware and we were not able to restore original because we couldnt read it. fortunately this happened with very few models.
bperrybap:
You could use a different programmer. Many like the newer USBtiny or the Dragon have logic levelers and will adjust
to the targets voltage level.
i own mkII, dragon, and a couple usbtiny. they all had issues and more problems in my applications than usbasp. then theres the fact that i can buy 20 usbasp for the cost of one dragon and 10 for the cost of a mkII. of course usbasp dont have jtag or dbw ability but neither do my chips so dragons pretty much sitting on a shelf.
bperrybap:
I'm surprised they work at 1Mhz without a slower SCK. Are you sure the CLKDIV8 fuse is set and the processor is running at 1Mhz?
i.e. are they really running 1Mhz or are they running 8Mhz?
im positive the div8 is on. after programming literally thousands of chips ive never seen one come from the factory with it off. and i check each during flash and again before shipping. no menus or icons being clicked. a cmd line bat file makes it pretty foolproof.
some usbasp do 1mhz chips w/o -B and some need it. its always used just to be sure. none of mine have a slow clock jumper. it depends on what chinese firmware was used and whether they have grounded pc2 under the chip. from what i can tell by lack of warning and -B response not all use the official images. i think its important to know that there are other versions floating around out there. on rare occasions using official firmware (old or new) causes units to stop working properly. personally id advise against reflashing unless there is good reason and its known to be safe. i think in most cases it is but anyway...
i do need to pick up one of those hk units even though a little pricey. they are not available on ebay. ali, dx, etc and appears tony hand commissioned a new design. im glad he stuck with Fischl compatibility.
i do need to pick up one of those hk units even though a little pricey. they are not available on ebay. ali, dx, etc and appears tony hand commissioned a new design. im glad he stuck with Fischl compatibility.
Just to review what I found with this specific Hobby King version of the USBasp programmer. I only had to tack solder a two pin male header to the two solder pads labeled R8, then install a shorting clip to it and then wired up the unit to my USBtiny programmer and burn the firmware file named usbasp.atmega8.2009-02-28.hex as this unit has a AVR8A chip. No errors were reported during the firmware upload and after testing with the arduino IDE all operations still worked (as before) but the SCK warning messages now don't print out at the completion of operations.
Lefty
john1993:
bperrybap:
Locked/unlock AVR on the USBasp doesn't matter. You can simply erase the chip to remove the lock, set the fuses again, then burn/upload the image you want.it definitely matters if the unit was locked and stops working with other firmware and we were not able to restore original because we couldnt read it. fortunately this happened with very few models.
True that having a locked AVR on the USBasp will prevent reading the original firmware
to save it away for the possibility of restoring it, but
from your previous comment:
you are lucky to find one unlocked but all mine came locked.
I was assuming you were referring to LOCK fuse bits and the inability to update
the AVR if the LOCK bits were set.
LOCK fuse bits being set doesn't prevent the AVR from being re-programmed
so a locked avr on a USBasp device won't matter with respect the ability to re-flash
a new/updated USBasp firmware image.
bperrybap:
You could use a different programmer. Many like the newer USBtiny or the Dragon have logic levelers and will adjust
to the targets voltage level.i own mkII, dragon, and a couple usbtiny. they all had issues and more problems in my applications than usbasp. then theres the fact that i can buy 20 usbasp for the cost of one dragon and 10 for the cost of a mkII. of course usbasp dont have jtag or dbw ability but neither do my chips so dragons pretty much sitting on a shelf.
I brought up the other devices as devices that could be used to update the firmware on the
the USBasp devices that you ship to your customers.
I wasn't intending that that be used as alternatives for programming devices for the customers.
personally id advise against reflashing unless there is good reason and its known to be safe.
I wouldn't go that far.
I'd say updating is actually a good thing as it removes a bothersome warning from avrdude
and also adds in functionality that can be required in some environments.
However, I'd also say don't just blindly flash an updated Fischl image into the device.
The key is to reflash an image that works with the target hardware.
So in order to be sure the image works with his hardware, the
USBasp device hardware design must be compared to the Fischl reference design.
The USBasp hardware is very simple. It is typically on dual sided PCBs so it is very easy
to follow all the traces and decide if it matches the Fischl hardware.
If it doesn't exactly match, the user can then decide if they wish
to tweak the firmware source code to match the wiring using on their PCB and rebuild it
or whether to not do the re-flash.
--- bill
bperrybap:
I was assuming you were referring to LOCK fuse bits and the inability to update the AVR if the LOCK bits were set.
i think everyone here must know by now you can always erase/reflash as long as the dreaded rstdsbl bit aint on. it would be nice if i could have read some of those locked units though because they were much better behaved than the 'fficial firmware.
bperrybap:
I brought up the other devices as devices that could be used to update the firmware on the the USBasp devices that you ship to your customers. I wasn't intending that that be used as alternatives for programming devices for the customers.
it looked like you were responding to my comments about lack of passthrough on the usbasp. in any case we agree they are not replacements. the usbasp will certainly never be as useful for debugging some chips as the dragon and hard to beat those $3 ebay deals for an excellent all round programmer.
i did just bit the bullet and tacked one onto a hobbyking order. i wish they wouldnt play games with shipping weight to make things look cheaper than they really are. still these are a great deal with that 6pin cable and i just cant hold back curiosity over whatever other little construction details.
I have purchased several of these Chinese USBasp programmers with the metal case covers. These are very nicely built.
You can also get them cheaper in bulk for about $4.00 ea.
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.
very interesting. i have one of those in my collection and wondered why it didnt work. since it cost more than the others i didnt try reflashing or anything. strange they would choose oddball firmware. it would be nice if the avrdudes switched to hid because that libusb baloney is a real pain in the butt.
Dear folks,
first of all thank you all very much for all the replies. I was really sick the past week, barely able to get outta bed. I'll be reading through all that went on in the thread and try and assimilated all the valuable info. I have not forgotten about this and I am still interested in the subject, trust me!
retrolefty:
i do need to pick up one of those hk units even though a little pricey. they are not available on ebay. ali, dx, etc and appears tony hand commissioned a new design. im glad he stuck with Fischl compatibility.
Just to review what I found with this specific Hobby King version of the USBasp programmer. I only had to tack solder a two pin male header to the two solder pads labeled R8, then install a shorting clip to it and then wired up the unit to my USBtiny programmer and burn the firmware file named usbasp.atmega8.2009-02-28.hex as this unit has a AVR8A chip. No errors were reported during the firmware upload and after testing with the arduino IDE all operations still worked (as before) but the SCK warning messages now don't print out at the completion of operations.
Lefty
Lefty, check my post count. This clearly isn't my area of expertise :), but I am going to try to update my HobbyKing USBasp programmer firmware as well. I've read (or at least skimmed) this entire thread, as well as dozens of others, but I don't want that stupid error either. I've used the USBasp on my Arduino and gotten the same error. This discussion is waaaaaay over my head right now, but I'll do my best. I have an Arduino Duemilanove that I'd like to use as an ISP in order to update the firmware on my HK USBasp. I know the File --> Examples --> ArduinoISP code exists, so....what do I do next? I have no idea how to build a hex file either, but I have stumbled upon this site with the latest driver (libusb-win32 download | SourceForge.net --> Download section --> Project Download Site [or just click here: libusb-win32 - Browse Files at SourceForge.net> "Download libusb-win32-bin-1.2.6.0.zip (913.2 kB)") for my USBasp, and wonder if it has what I need right here.
Also, what program do I use? Do I need AVRdude? Or can/should I use Extremeburner AVR or one of these other programs found in the list here: USBasp - USB programmer for Atmel AVR controllers - fischl.de under "Software"?
....my brain feels dead. I've spent all day on this. ...and I got an Arduino LED to blink.....
To upgrade the firmware on your Hobbyking USBASP programmer you can use avrdude with your Duemilanove as ArduinoISP. Don't forget you will need to disable the auto-reset on the Duemilanove by connecting a 10uF electrolytic capacitor between the reset and GND on the headers. Note the capacitor leads may not contact well into the Arduino headers so you may need to jumper it to a breadboard.
You will need to short the two solder pads labeled as R8 on the USBASP. This will connect the reset from the 10-pin header to the reset on the ATmega8A, to allow it to be programmed. Then jumper the ISP connections from your USBASP 10-pin header to the Arduino headers.
10-Pin header to Uno ArduinoISP
pin 5 RESET D10
pin 1 MOSI D11
pin 9 MISO D12
pin 7 SCK D13
pin 2 VCC 5V
pin 4 GND GND
Download the firmware http://www.fischl.de/usbasp/usbasp.2011-05-28.tar.gz
Extract the \usbasp.2011-05-28\bin\firmware\usbasp.atmega8.2011-05-28.hex file.
Then use avrdude to upload the firmware. Adjust the COM port to your Duemilanove.
avrdude -c arduino -PCOM6 -b19200 -p m8 -v -U flash:w:usbasp.atmega8.2011-05-28.hex
Thanks, I'll give this a shot! Before I do though, how do I back up the current firmware inside my HK USBasp, just in case I screw something up and want to put it back in? And before you go on and tell me this is unnecessary, it's a good learning experience regardless, so I'd still like to know how to do it. Thanks again!
Just use avrdude to read the flash and save to file.
avrdude -c arduino -PCOM6 -b19200 -p m8 -v -U flash:r:usbasp.hobbyking_backup.hex:i
Then to restore back the original firmware.
avrdude -c arduino -PCOM6 -b19200 -p m8 -v -U flash:w:usbasp.hobbyking_backup.hex
On a side note, you can also test your connections first to make sure it can communicate with the chip properly.
avrdude -c arduino -PCOM6 -b19200 -p m8 -v
It should reply back with something like.
avrdude: Version 5.11, compiled on Sep 2 2011 at 19:38:36
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch
System wide configuration file is "...\Arduino\arduino-1.0.4\hardware\tools\avr\bin\avrdude.conf"
Using Port : COM3
Using Programmer : arduino
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 : Arduino
Description : Arduino
Hardware Version: 2
Firmware Version: 1.18
Topcard : Unknown
Vtarget : 0.0 V
Varef : 0.0 V
Oscillator : Off
SCK period : 0.1 us
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.02s
avrdude: Device signature = 0x1e9307
avrdude: safemode: lfuse reads as 9F
avrdude: safemode: hfuse reads as D9
avrdude: safemode: lfuse reads as 9F
avrdude: safemode: hfuse reads as D9
avrdude: safemode: Fuses OK
avrdude done. Thank you.
Hey hiduino, thanks a ton! I haven't had a chance to do this yet but I will when I can. As for the capacitor, to disable the duemilanove's auto-reset, you said to use a 10uF electrolytic capacitor, but I am assuming that's the minimum size required. Is a 470uF ok instead? That's what I have on hand: a Rubycon ZLH 470uF 25V. Also, how does this work exactly? I mean, what signal is the reset input on the header looking for, in order to force a reset, and how does the capacitor fix this? This is more of a "why" question than a how-to question, as I like understanding how/why stuff works.
PS. I have a pretty good understanding about capacitors in general, so I understand they store charge and are high-speed devices, and can smooth ripple currents and voltages, smooth switching power supply outputs, etc.
A larger value capacitor should be fine.
Lookup the Automatic Reset under http://arduino.cc/en/Main/ArduinoBoardDuemilanove.
Basically when avrdude opens the connection to the Arduino Duemilanove the FT232 chip pulls DTR signal low to force a reset to the ATmega chip, which in turn will cause the bootloader to run. Thus allowing normal sketch uploads. However, when using the Arduino as ISP programmer, you do not want this to happen. We want the Arduino to continue running the ArduinoISP sketch.
Putting the capacitor between the reset and GND will have enough charge to keep the reset line high, thus avoiding a reset condition. This will allow the Arduino to continue running the ArduinoISP sketch and look like a programmer to avrdude.
Excellent, thanks! Very informative. Makes a lot of sense.
Then use avrdude to upload the firmware. Adjust the COM port to your Duemilanove.
Code:avrdude -c arduino -PCOM6 -b19200 -p m8 -v -U flash:w:usbasp.atmega8.2011-05-28.hex
I get "avrdude" not found when trying to run this. Have I forgotten something?
p.s.
does anyone have the source code for the USBASP firmware? I'd like to load it into Arduino IDE and just load it from there using my 2009 as ISP programmer.
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