| Author |
Message |
|
|
Posted: Sep 22, 2005 - 05:26 PM |
|


Joined: Nov 17, 2004
Posts: 6137
Location: Great Smokey Mountains.
|
|
|
eieland wrote:
Hi guys!
On the voltage issue, please note that the voltage operating range for the mega169V placed on the AVR Butterfly is 1,8-5,5V. If your batteries are close to empty (and you have changed the BOD settings) programming of the device might be unsuccessfull leading to unpredictable behavior.
A nice tip is to always remove the battery when not using the device .
Best Regards
Andreas
Howsomeever, you can reliably get the 0x0940c error by using the bootloader with the Butterfly powered at 2.4 volts. I am now recommending that users make sure that they have at least 3 volts power and do not use weak or rechargable batteries (2 x 1.2v = 2.4v).
Further, I think this problem could be fixed with a new bootloader for the Butterfly that cannot set fuses. Once a user gets advanced enough to know what a fuse is, then that user can download a more advanced bootloader.
Smiley |
_________________ FREE TUTORIAL: 'Quick Start Guide for Using the WinAVR C Compiler with ATMEL's AVR Butterfly' AVAILABLE AT: http://www.smileymicros.com
|
| |
|
|
|
|
|
Posted: Oct 27, 2005 - 03:42 PM |
|

Joined: Oct 26, 2005
Posts: 11
|
|
It just took me a few days to reach this state. It happend when I tried to program the butterfly using an external power supply. I didn't solder the connection, so the power could have been instable. Now I know that this is dangerous... Fortunately I know somebody who owns an ISP-programming-unit.
But what surprised me: The damaged bootloader still can send its '????????'-string. |
|
|
| |
|
|
|
|
|
Posted: Nov 10, 2005 - 06:53 PM |
|


Joined: Nov 17, 2004
Posts: 6137
Location: Great Smokey Mountains.
|
|
The problem seems to be with the new bootloader that comes with the new Butterflies that allows fuses to be set where the older code didn't. So the power goes flaky for a moment and the bootloader goes insane and sets a fuse. Still the only solution is to reprogram the chip. Please use the code port by MJThomas as he uses the older bootloader. His website:
http://www.siwawi.arubi.uni-kl.de/avr_projects/
This new information comes from Gwen's thread at:
http://www.avrfreaks.net/index.php?name ... highlight=
Maybe we can get Atmel to revert to the old bootloader?
Good Luck,
Smiley |
_________________ FREE TUTORIAL: 'Quick Start Guide for Using the WinAVR C Compiler with ATMEL's AVR Butterfly' AVAILABLE AT: http://www.smileymicros.com
|
| |
|
|
|
|
|
Posted: Nov 16, 2005 - 10:59 AM |
|


Joined: Oct 21, 2004
Posts: 29
Location: San Jose, California
|
|
Hello freaks,
One short question, the ones who have observed the problem, are they using AVROSP or AVRPROG?
As you guys know we have tried to recreate this problem without success, I have now also talked to the guy who wrote the bootloader and he told me that he had heard of this problem using AVRPROG, but that he was not able to recreate it either. AFAIK no one has seen this problem using the latest version of the bootloader and AVROSP.
-Andreas |
|
|
| |
|
|
|
|
|
Posted: Nov 18, 2005 - 01:20 AM |
|


Joined: Nov 17, 2004
Posts: 6137
Location: Great Smokey Mountains.
|
|
Andreas,
I've only used AVRProg in AVRStudio 4.11. Since I sell Butterflies and have someone complain about once a week, would you like for me to have them send you their Butterfly in exchange for a new one? Magnu Wessberg had about 20 students create this error using rechargeable batteries and letting the voltage get below 2.4 V.
Smiley |
_________________ FREE TUTORIAL: 'Quick Start Guide for Using the WinAVR C Compiler with ATMEL's AVR Butterfly' AVAILABLE AT: http://www.smileymicros.com
|
| |
|
|
|
|
|
Posted: Nov 28, 2005 - 03:14 AM |
|

Joined: Nov 27, 2005
Posts: 5
|
|
I'm one of the SmileyMicro customers that has just got this problem...
If I understand correctly, what you are all saying is that a design flaw in the bootloader allows a corrupted datastream (possibly caused by a low voltage or hitting the joystick while progamming) to set some lock bits which it cannot then unset. The only way to unset them is via a more expensive programmer using the ISP or JTAG interface.
A suggestion for SmileyMicros - if there is an alternate bootloader that does not have this "feature" it might be worth you reprogramming the butterflies you sell before shipping them, to save on the customer support calls.
I'm now debating whether to invest in a STk500 (what would it give me other than a way to recover my broken butterfly?), try to come up with some other cheap ISP programmer, buy another butterfly, or go back to PIC.....
Richard |
|
|
| |
|
|
|
|
|
Posted: Nov 28, 2005 - 04:26 PM |
|


Joined: Nov 17, 2004
Posts: 6137
Location: Great Smokey Mountains.
|
|
All is speculation, we don't really know for sure what is going on yet. Most folks are lucky and don't run into this problem. If you plan to get into AVRs seriously, then the $79 STK500 is required. If you just want to do ISP programming the $29 AVRISP will do, and a new Butterfly is $19.99.
I'm personally a bit embarassed by this problem and I think Atmel should be also. I sell the Butterfly mainly to sell the book and the margin is so low that it almost isn't worth the trouble to sell it, considering that I also add a DB9 connector and wire. Contact me at: joe@smileymicros.com and we can discuss other alternatives.
Read a bit more on this site before going back to the PIC, especially the AVR vs. PIC threads. The Butterfly is not the AVR, just a cheap evaluation board for the Atmega169. If you get this problem it is very frustrating. But what does the least expensive comparable PIC solution cost when you consider that the AVR has a free unlimited C compiler, my C programming book, and this forum for support -- do you get a better deal with PIC? If so, I'd like to hear about it.
Smiley |
_________________ FREE TUTORIAL: 'Quick Start Guide for Using the WinAVR C Compiler with ATMEL's AVR Butterfly' AVAILABLE AT: http://www.smileymicros.com
|
| |
|
|
|
|
|
Posted: Nov 28, 2005 - 05:03 PM |
|


Joined: Aug 04, 2005
Posts: 1267
|
|
I also had the same exact problem with my butterfly.
I still program PICs as well as AVRs...
Do NOT forsake AVRs for PICs!
AVR is just sooo superior.
I advise getting the STK500..it is reasonably priced and
if you are at all serious about working with controllers you
will need this...it's an isp programmer, a hi-voltage programmer
and a development board.
Atmel has the new USB version of the avrisp coming in a few weeks.
It will retail for 34$ and I advise getting it also...I am eager to get mine.
If you want a nice low-cost USB prgrammer right away then get the
new one from ere...it looks very nice. You could use it to rescue
a wayward butterfly..all you would need to do is make up a 10-pin
to 6-pin adapter cable (ere sells cheap cables also)
the ere ISPAVRU1 is 29$ and here is a link to the manual
(PDF) http://www.ere.co.th/download/ispavru1_051018A.pdf
I think this programer can also provide a clock source for the chip if you
need it.
Quote:
I'm personally a bit embarassed by this problem
Don't sweat it Smiley...how could you have known the butterfly
would turn out a bit flakey. |
|
|
| |
|
|
|
|
|
Posted: Nov 28, 2005 - 06:05 PM |
|


Joined: Aug 04, 2005
Posts: 1267
|
|
here is the 10 to 6 pin adapter from ere..it is 1.20 ea
/ProductImages/I106_256x256.jpg) |
|
|
| |
|
|
|
|
|
Posted: Nov 29, 2005 - 10:55 PM |
|

Joined: Nov 29, 2005
Posts: 110
|
|
Ok, I also experienced the problem and toasted 2 brand new Butterflies in 2 days.
No, the problem isn't voltage related.Both happened with brand new 3v button batteries. Also not related to having the latest and greatest AVRProg... I just downloaded mine.
The first Butterfly bit the dust when I tried downloading the original code (just to see if I can download anything). I had never used AVRProg before so I didn't know what behavior to expect or when to release the button etc.
On the second one, after reading this thread, I was a lot more careful. Exact sequence of operation:
1. Connected brand new butterfly with serial cable to a computer with the latest AVRStudio and WinAVR tools installed.
2. Verified computer talks to butterfly using name download.
3. Used butterfly menu to go to the bootloader section, then held button down and started AVRProg. After a short delay the AVRProg popped up its menu, I selected the factory hex file, downloaded ok. (First sucess!)
4. Repeated above with the GCC port, made sure it works by trying new keyclick menu. Success!
5. Made a very slight change to source and recompiled, modified "Butterfly" name so that I can tell what version is running. Downloaded as above, worked fine, unit shows new name.
6. Made 2 other slight changes, 1) commented out call to osc. calibration because AVR studio would get stuck in that routine during simulation and for the moment I don't care about exact calibrations. 2) added a couple calls to UsartTx() to send out a few characters in the menu loop.
7. Tried downloading, AVRProg warned me that program extends into boot section, so I cancelled the download.
8. Now Butterfly won't respond to up-arrow.
9. Restarted AVRProg with button held down, starts as before. Tried downloading factory hex file again, wouldn't take, complained about the 940c.
10. Still no response to up arrow, but will respond to AVRProg, but anything I try will result in same 940c error message.
This was within minutes of using brand new Butterfly with brand new battery, so not a voltage issue. Maybe this will help you debug ?
Separately, I have a total AVR newbie question: How can I tell from the map file whether my modified program extends into the boot section? I only added a couple of function calls, was the code so tightly packed that you have to delete stuff before adding any line of code ? |
|
|
| |
|
|
|
|
|
Posted: Nov 30, 2005 - 03:05 PM |
|


Joined: Nov 17, 2004
Posts: 6137
Location: Great Smokey Mountains.
|
|
|
RayKAvr wrote:
This was within minutes of using brand new Butterfly with brand new battery, so not a voltage issue. Maybe this will help you debug ?
Jeez... I don't know what to say other than I hope you have an ISP programmer handy. This is really frustrating. I haven't calculated the exact percent, but I think about 95% of the Butterflies work okay but there seems to be some flaky ones circulating. If you do get an ISP, see if you can download not just Martin Thoma's GCC port of the Butterfly code, but his port of the old bootloader. I'm suspecting the new bootloader as the source of the problem since it allows setting fuse bits. But who knows?
RayKAvr wrote:
Separately, I have a total AVR newbie question: How can I tell from the map file whether my modified program extends into the boot section? I only added a couple of function calls, was the code so tightly packed that you have to delete stuff before adding any line of code ?
I've never looked at this other than glancing at a few AVRFreaks threads and I don't remember the upshot. I do know that the original IAR code filled the Butterfly and they had to remove seveal songs to get it all in.
I would suggest that once you get these reprogrammed you might look at my Quick Start Guide below and start simple with the Blinky program and build from there.
Good Luck,
Smiley |
_________________ FREE TUTORIAL: 'Quick Start Guide for Using the WinAVR C Compiler with ATMEL's AVR Butterfly' AVAILABLE AT: http://www.smileymicros.com
|
| |
|
|
|
|
|
Posted: Dec 06, 2005 - 04:54 AM |
|


Joined: Sep 10, 2005
Posts: 459
Location: Louisiana,USA
|
|
|
Quote:
The first Butterfly bit the dust when I tried downloading the original code (just to see if I can download anything). I had never used AVRProg before so I didn't know what behavior to expect or when to release the button etc.
I did the same thing and the problem occurred but the butterfly will turn on to pushing "up" on the joystick. On early Olimex JTAGs they had a problem in the boot loader and the same(type) of message appeared http://www.olimex.com/dev/avr-jtag-upgrade.html. This must mean that the problem is the bootlaoder and Atmel should attend to it. I'm also a customer of Smileys but am perfectly happy with my butterfly because I have an ISP. I would advise all to have some kind of backup programer. |
|
|
| |
|
|
|
|
|
Posted: Dec 06, 2005 - 08:09 AM |
|


Joined: Jan 23, 2004
Posts: 9830
Location: Trondheim, Norway
|
|
After about 9-10 months, I finally decided to experiment with my butterfly about an hour ago, rather than just used it as an easily accessible practical demonstration of my hobby to our family friends.
Fist off, solder headers to the pads - check. Second: attach butterfly to "SPARE RS-232" ON STK500 - check. Open terminal program and set mode to "download name" - check. No dice.
Took me five minutes to remember that the butterfly uses funky level shifting circuitry onboard which means it won't work if the signal is already converted via the '500's MAX232. I then changed the connections to interface directly with the serial port and it all worked fine.
Just before I loaded in Martin Thomas's GCC port of the original bufferfly code (which is almost poetic in it's sheer greatness). Works great - and no 0x9C error! All I need to figure out now is what to do with the thing...
I had a poke around on Atmel's website for the bootloader code - and all I found is the HEX. I assume Atmel are protecting their protocol?
- Dean  |
_________________ Atmel Studio 6.1 is now released, grab it here.
Report AS6/ASF bugs here.
|
| |
|
|
|
|
|
Posted: Dec 06, 2005 - 09:28 AM |
|


Joined: Mar 27, 2002
Posts: 18571
Location: Lund, Sweden
|
|
Dean oh Dean, Exposer of the Impatience of Youth!
Go back to the Butterfly page at Atmel. Instead of just diving for the downloads at the bottom, read the text above them:
Quote:
The bootloader source code is available as application note AVR109.
|
|
|
| |
|
|
|
|
|
Posted: Dec 06, 2005 - 10:05 AM |
|


Joined: Jan 23, 2004
Posts: 9830
Location: Trondheim, Norway
|
|
I saw that, but all it was was a description of the bootloader, with no code that I could see. I went back to the website and (doh) realised that the code is in a zip file which accompanies the PDF.
In any case, I think it would be interesting to make an ISP programmer out of an AVRButterfly. I doubt you could get it to work with the AVRISP protocol (if you did it would be outdated soon enough anyway) but with AVRProg it should be fine. Since the butterfly's got an onboard screen, joystick, dataflash and whatnot, you could even make it able to store programs and program AVRs in-field...
This calls for some investigation.
- Dean  |
_________________ Atmel Studio 6.1 is now released, grab it here.
Report AS6/ASF bugs here.
|
| |
|
|
|
|
|
Posted: Dec 06, 2005 - 10:22 AM |
|


Joined: Mar 27, 2002
Posts: 18571
Location: Lund, Sweden
|
|
|
Quote:
This calls for some investigation.
Forward, Dean, and onward! (Us cowards will await in the rear until the enemy is defeated...)  |
|
|
| |
|
|
|
|
|
Posted: Dec 06, 2005 - 02:50 PM |
|


Joined: Nov 17, 2004
Posts: 6137
Location: Great Smokey Mountains.
|
|
|
abcminiuser wrote:
In any case, I think it would be interesting to make an ISP programmer out of an AVRButterfly. I doubt you could get it to work with the AVRISP protocol (if you did it would be outdated soon enough anyway) but with AVRProg it should be fine. Since the butterfly's got an onboard screen, joystick, dataflash and whatnot, you could even make it able to store programs and program AVRs in-field...
This calls for some investigation.
- Dean
Dean,
First off look at the bootloader on Martin Thomas website:http://www.siwawi.arubi.uni-kl.de/avr_projects/#bf_boot
Second, your project idea is excellent and the Butterfly could do it. There are plenty of resources for AVR ISP programming both here on Freaks and through Googling. While it would be a large project, it would mostly entail re-engineering existing code AND it would be a contribution to the AVR tribe.
Good Luck,
Smiley |
_________________ FREE TUTORIAL: 'Quick Start Guide for Using the WinAVR C Compiler with ATMEL's AVR Butterfly' AVAILABLE AT: http://www.smileymicros.com
|
| |
|
|
|
|
|
Posted: Dec 07, 2005 - 05:47 AM |
|

Joined: Dec 07, 2005
Posts: 9
|
|
Im that newbie with this same problem...
I have an Atmel Butterfly.
I have successfully loaded half a dozen different programs into it.
I am now not able to upload any new programs to it with AVRprog.
I get to "Verifying" in AVrprog and get a popup that says:
Address: 0x0000, Expcted: 0x940c, Received: 0x0100
Then I get a verify failed.
I have seen references to replacing the bootloader with avrdude and
a connector from the pc parallel port to the jtag port.
Any ideas on how to salvage my butterfly?  |
|
|
| |
|
|
|
|
|
Posted: Dec 07, 2005 - 06:45 AM |
|


Joined: Jan 23, 2004
Posts: 9830
Location: Trondheim, Norway
|
|
kl7r, if you read any of this thread at all you would have realised that the way to fix your butterfly is to use an ISP programmer such as a STK500 or a ATAVRISP.
Smokey: Working on it now. Took damn forever to get the screen and joystick working correctly, but i'm now happy with it. I'm trying to get the blasted serial to function next - looks like i'll be having another look-see in your book. I was browsing the schematics of the butterfly - is it really running of the 32.768KHz crystal? That's what's connected to the occilator pins, as far as I can tell...
- Dean  |
_________________ Atmel Studio 6.1 is now released, grab it here.
Report AS6/ASF bugs here.
|
| |
|
|
|
|
|
Posted: Dec 07, 2005 - 07:51 AM |
|

Joined: Dec 07, 2005
Posts: 9
|
|
Actually I did read the thread. Try to be civil.
That is the reason that I had the following line in my post:
"I have seen references to replacing the bootloader with avrdude and
a connector from the pc parallel port to the jtag port."
That should have read "ISP port".
I got a copy of avrdude and wired up an isp port programmer cable
to go to the ISP port but so far no joy. avrdude doesnt see my butterfly
for some reason. A scope shows data coming out of lpt1 so I know
my drivers are working and I doublechecked my isp cable but no luck so far.
I used the information on http://bluebat.dnsalias.org/howto/butterfly/
and the windows/cygwin version of avrdude that comes with WinAVR
Do I have to do something special to get the butterfly into ISP program
mode? |
|
|
| |
|
|
|
|
|