Go Down

Topic: Can't Update The Firmware On My USBasp Atmega8 Using Arduino (Read 12511 times) previous topic - next topic

angelosanzeri

Thank you everyone and thanks about the "ok" on the schematics.
Now I can proceed flashing my USBasp.
I'll let you know, thanks again!

john1993

John, I couldn't disagree more about having a reason to run the latest USBasp firmware.
i know you have more experience playing with the firmware but we will have to agree to disagree this.  ive had a few hundred of the Ebay units pass through here for academic and business use and never saw a single case where virgin 8mhz chips needed jumper or -b.  i don't know how to explain our differences but can only relate my own experience.

i will say that the particular unit op has suffers from a fatal circuit design flaw. over a dozen of the exact same version (lc 2.0, purchased from different sources) were recently sent to me for testing and 3 failed with a particular bare m8 circuit.  the fault was traced to lack of output cap on the lm1117 regulator ic. This is easily verified by the photos in post #1.  my theory is this is the real cause of many issues brought up here and elswhere on the net. in any case tacking a 1mf ceramic across pins 1-2 fix the defect.

as mentioned before better solution is to order the "baite" type with skewed m8 which does not suffer from this defect. only a few pennies more and which now has a 3v-5v switch instead of the current lc with jumper or previous lc rev with neither.

of course i have not checked every single unit manufactured since that version came out 4 yrs ago so who knows. ymmv.


bperrybap

i know you have more experience playing with the firmware but we will have to agree to disagree this.  ive had a few hundred of the Ebay units pass through here for academic and business use and never saw a single case where virgin 8mhz chips needed jumper or -b.  i don't know how to explain our differences but can only relate my own experience.
Virgin 8mhz chips?
Virgin AVR chips like the m8/168/328 are internally clocked at 1Mhz by the factory set fuses and that is what can create the problem.
The way the AVR is implemented, the MCU uses the programmed MCU system clock during ISP programming.
see section 8.2.1 of the manual:
http://www.atmel.com/images/doc8161.pdf

So when it is using the internal 1Mhz clock or using an external clock that is even slower, you have to slow down the ISP clock frequency during ISP programming in order to be able to program the part because the ISP clock cannot be faster than 1/4 the frequency of the MCU clock.
Many ISP programming devices use an ISP clock that is faster than than what will work with a 1Mhz AVR.

Some USBasp devices are shipped with modified USBasp firmware to always run a slow ISP clock by default or reverse the jumper operation where out means slow and in means fast.
While this ensures it will work with factory AVR parts, once the AVR is running faster it is programming the AVR much slower than what is possible.

Here is an video from Atmel that explains and demonstrates the issue:
https://www.youtube.com/watch?v=vZ4ssr4N0qw

But like I said the best option is to have USBasp firmware that supports setting the clock speed so you can run slow when you have to and fast/faster when you can.


--- bill



john1993

Virgin 8mhz chips?
yes, i should have said 8mhz w/div8.  my point was there was never need for me to change speed with jumper or in avrdude.  not in 100s of thousands of chips flashed. some rare failures but not for that.

Some USBasp devices are shipped with modified USBasp firmware
this may explain our difference of opinion. i know for a fact the chinese units i am buying do not use the old or the new official firmware.  the images do not match.  most likely they started with the older rev and fixed the important issues like clock speed.  these are not slow pokes though.

But like I said the best option is to have USBasp firmware that supports setting the clock speed so you can run slow when you have to and fast/faster when you can.
i would agree but to be honest i dont recall ever having to change the speed for a usbasp. what i do know is the fischel images (old and new) caused trouble for me and chinese versions did not.  im convinced most "problems" are due to beginners not knowing the difference between the harmless update warning which should be ignored and real errors.  and issues encountered when following that (what i consider) bad advice.

imo statistically second to that would be misbehaviors due to hardware defects like the one mentioned above.

angelosanzeri

I tried everything you told me to do and that's what Avrdude says:

http://i.imgur.com/fDQXUFy.png

What I should do now?

bperrybap

John,
This isn't just a difference of opinion. The ISP clock can't be more than 1/4 the clock of the MCU. If the USBasp devices you are using work with virgin AVR chips, then the ISP programming must done using a slower clock from what can be used when the AVR is running at 16Mhz.
What isn't clear (at least to me) is how or even if the ISP programming devices you are using run a faster clock when possible.

The harmless warning you mention is not so harmless when using official USBasp firmware and virgin AVR chips. Like if trying to set the fuses of a virgin AVR chip.
And that is the main reason I finally upgraded my USBasp device. I got tired of messing with a "slow clock" jumper for virgin AVR chips but still wanted to program fast when possible.


angelosanzeri,
That error can be a few things but looks like the ISP device (your Arduino) is not responding over the serial interface like the Arduino is not talking to avrdude.
Can you put together a post that concisely describes your exact h/w setup and which ISP sketch you are using so I can replicate it here and get you going.
(Guess it's time for me to actually try out Arduino as ISP)
My preference is to have the makefile program the part so once it is working I'll provide a working makefile that uses the Arduino as ISP.


--- bill


angelosanzeri

#21
Dec 03, 2015, 08:49 am Last Edit: Dec 03, 2015, 09:43 am by angelosanzeri
I don't even know what should I need to add to the description I gave you in the first place and I don't know what I should ask in a new post, maybe I should repost everything from the beginning because it's became a little messy here.
I would appreciate if you (bperrybap) and john1993 would not have your private conversation here. I really appreciate your comments, advices and help, seriously, but if you keep talking like this how can people who want to help can find easy to understand the sense of this discussion. Please

Anyway I got this error http://i.imgur.com/fDQXUFy.png since I plugged the 10uF capacitor between RESET and GND

Here's the sketch I uploaded on the Arduino UNO: http://pastebin.com/txan4KWH

The folder tree of the file I'm using: http://i.imgur.com/xfb1C86.png

The path I use: http://i.imgur.com/iG130Cm.png

The folder is this one if you want to download it: https://www.sendspace.com/file/pnsdvj

File path: /bin/firmware/usbasp.atmega8.2011-05-28.hex


bperrybap

angelosanzeri,
Maybe there was some confusion of my request for a new "post". I was asking for a new post in this thread so all the current h/w and s/w information was in one place vs a new thread.
(Perhaps a kind admin will merge them back together)

I will continue to post in this thread vs the other/new one.
Maybe you could remove it or put a link in that other thread pointing back to this one to keep information from being duplicated.


I have been trying to help you get your USBasp device firmware upgraded.
John jumped in and is trying to convince you it is a waste of time. He is incorrect on this and I was trying to provide more accurate information with respect to some of the comments being made.
I had hoped that it would be beneficial for you as well as other thread readers.


I have upgraded my USBasp device and have helped others on the forum get their devices upgraded.
I have built the USBasp firmware from source and have modified/tweaked the USBasp firmware for better LED behavior.
I also almost exclusively run linux, so I can definitely help you get your device upgraded.


The issues you are having are related to using an Arduino board as an ISP programmer.
(I've finally hooked up one and used it for ISP programming and boy what a kludge/mess.....)


In my previous comment (#20) I was asking for basically what you provided other than I was hoping to  see information on your Arduino board and actual hardware setup (like a photo) so we could verify that you are using the proper Auto-reset disable hack.

The errors you are getting look like your Arduino is not running or is not running the Arduino as ISP sketch.

An easy quick test is to hook up your arduino board with nothing attached other than the programming cable.
(No wires, no caps, resistors, nothing....)
Then use the IDE to upload the Arduino as ISP sketch that comes with the IDE.
It is in
[File]->[Examples]->ArduinoISP

Now install your Auto-reset hack. Either the resistor or cap depending on which Arduino board you have.
Turn on verbose mode for uploading by using
[File]->[Preferences]
And  on the line: "Show verbose output during:"
click on [] upload

Then use the IDE to attempt to burn a new bootloader.
[Tools]-[Burn Bootloader]
If the Auto-reset disable hack is working and the ArduinoISP sketech is running you will get device signatures of 0x000000 and an error since the ISP pins are not hooked up to anything.

This will tell you that everything is working and ready to be hooked up to the USBasp device.
If you don't get this, then something is wrong with the Arduino ISP interface and needs to be corrected.

The next thing is how to connect the USPasp device and how to power it.
Given your board has a 3/5 volt option, which uses a voltage regulator, I am assuming it is used to drive the voltage pin on the  ISP header. Because of this it may not be possible to power it from the ISP header and you may have to plug it onto a USB port for power.
If that is the case and you plug in the USBasp device to a USB port for power, DO NOT connect the voltage pin on the USBasp ISP header to anything like 5v power on the Arduino.

First thing is to get the Arduino ISP stuff working, then proceed with hooking it up to the USBasp device.

--- bill

bperrybap

In terms of USBasp f/w version in your device (which PeterVH asked about in the other thread), you need 1.03 or newer to have the s/w control of ISP clock. 1.03 was the 2009 release.

Seems like I had a problem with using the 2011 release on my device. Like maybe it wouldn't fit in the part.
I can't remember but I'm currently running a slightly modified version of the 2009 release.
The only difference is how the LEDs work.

--- bill

john1993

John jumped in and is trying to convince you it is a waste of time. He is incorrect
unlikely anything i say would convince angel of anything. the intent was to possibly help a few with open minds avoid that same "struggling" path.  anyway at the risk of upsetting him again i will insist that contrary to denials this is simply your opinion.  you are certainly entitled.

in addition to personal experience ive observed an enormous number of others flash new chips without jumping through those hoops. little credible evidence of real problems except related to the hardware defect and even that was rare.  literally millions of users have purchased these without the problems you encounter.  ebay would be flooded with opened cases and low feedback.  hobbyking and bangood bankrupt selling bad product.

i am convinced reflashing is of little value in this situation. not having any special window into absolute reality i will admit again that this is just my opinion.

bperrybap

angelosanzeri,
After seeing PeterVH's post on the other thread, I went back and looked at your avrdude command options.
You didn't specify the baud rate. Not sure what the default is but the default is not the 19200 that the ArduinoISP sketch wants.

I was able to reproduce the error you are seeing with a working ArrduinoISP setup when the baud rate was not specified.

Specify the baud rate using "-b 19200"

If you try this:

avrdude -c arduino -p m8 -P /dev/ttyACM0 -b 19200

It should sync up with the ArduinoISP skech and if you have no wires connected to the USBasp device it should report error with signature of 0x000000 vs "not in sync" errors that you are getting.

--- bill

angelosanzeri

#27
Dec 04, 2015, 08:16 am Last Edit: Dec 04, 2015, 08:30 am by angelosanzeri
Before trying your method (bperrybap) I tried the one in the other thread by PeterVH wiring up my USBasp with my Arduino UNO with that auto-reset hack and the add of
Code: [Select]
-b 19200 and I got this error: http://i.imgur.com/5E8o2gB.png

So I decided to try your method doing everything you said:

1) unplug everything except the UNO
2) file-->examples-->upload ArduinoISP sketch
3) set verbose when uploading
4) install the hack (capacitor between RESET and GND)
5) try burn bootloader

Once I did that I got this error: http://pastebin.com/a3RRcnvR.

P.S. I'm not mad to anyone (bperrybap) and (john1993), on the other hand I thank you for the help you're giving me, I'm also interested in your discussion, and if that discussion you were doing once will be in another thread I'll follow it surely, but here I need to receive help about this thing, I just said not to make this thread become one of those with 10 pages where people begin to read willing to help and once they see 5 pages of off-topic matters they left, it just about it, surely don't want to offend anybody, you're helping I would only be stupid to do so.

I got your point (john1993), but I want to do this right, I don't want to give up lefting all these things undone, once I'll make it I'll think about keep going using USBasp etc but until now, I want to end this thing.

Thanks

angelosanzeri


bperrybap

Yes it looks like the avrdude command worked and is correctly talking to the USBaspdevice.
But that command was to read the firmware that was in there and store it in the file you specified.
You still need to update the firmware.
So now you can update the device with the firmware image you want to update it with.

--- bill

Go Up