[DIS] [BUTFLY] Solution to the Butterfly 0x940c error

Go To Last Post
51 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

THE PROBLEM
A small percent (see: http://www.avrfreaks.net/index.p...) of Butterfly users have experienced an error when programming the Butterfly. This error has the hex number 0x940c in the error message and basically means the Butterfly Bootloader is temporarily futzed and the bootloader will have to be reloaded with an ISP programmer. This is simple to fix. There have been many posts in a variaty of threads on this topic and it has become difficult to find the latest information on the problem. So the purpose of this tutorial is to post what we think we know. Please add your thoughts to the thread and I'll update this first post to keep users abreast of the problem.

POSSIBLE CAUSE:
* The newer (date unknown) Butterflies have a bootloader that allows setting lock bits. Earlier Butterflies did not have this capability and do not suffer the 0x940c error (I think).

* The problem seems to occur most reliably when the power drops below 2.7V while the bootloader is running. Since the RS232 communications use a lot of power, even a seemingly healthy battery might glitch during the bootloading causing the power to drop, the code to run wild, and the bootloader to set a fuse preventing further bootloading.

* Some folks have observed this problem when they pressed the joystick while the bootloader was running.

PREVENTION:
* Do not use the coin cell battery to do bootloader programming. It will drain rapidly and can cause the problem.

* Do not use rechargable external batteries in lieu of regular batteries. Two regular AA batteries produce above 3v, while some rechargable AA batteries only produce 2.5v

* If you use a regulated wall wart, make sure you filter the output. I recommend a 220uF cap between V and GND.

* If you use an external power supply of any type and a voltage regulator such as an LM317, then in addition to the 220uF cap, you must have a current sink to keep the regulator regulating since the Butterfly will not draw enough current and the regulator will bounce about. One way to do this is to use a power indicator LED to draw 6 mA.

CURES:
*Any AVR programmer should fix the problem. I recommend using the Butterfly code from Martin Thomas' web site:
http://www.siwawi.arubi.uni-kl.d...
More specifically for the old (and better) bootloader:
http://www.siwawi.arubi.uni-kl.d...

*If you can't beg, borrow, or steal an AVR programmer, then send your Butterfly to me and I'll reprogram it for you. You pay all the shipping. (No guarantees since your Butterfly might really be zapped)(Also, I am insanely busy so it may take a few days for me to get to it.)

*Giorgo_k has made a bootloader without lock bit setting. It has the added advantage of being very small, thus freeing up an additonal 1k of space for your programs. You can get this at: http://www.avrfreaks.net/index.p...

*There is a post below by gutzeit that discusses a quick hardware construction project to fix this problem. He says he was able to do it in 3 hours, so give it a look if you are hardware oriented.

*On the second page of this thread, Cell "hacked together the 'bsd' programming cable as described here:
http://www.bsdhome.com/avrdude/ " He includes a picture and a link to a website with further pictures. Looks like a good cheap way to reprogram Butterflies, if you have a parallel port.

ATMEL SPEAKS!
Just in (3/6/05) from Andreas at Atmel:

Quote:
Hi Freaks,

We have now reduced the functionality of the AVR Butterfly bootloader (ie. removed the possibility to program the lockbits). This should prevent people from encountering this problem. We have testet this bootloader on several Butterflies here in the office today and even when deliberately trying to program the lockbits, we were not able to change them.

I have attached the new bootloader to this post and notified our manufacturer, so that new Butterflies will be shipped with this bootloader.

Best Regards
Andreas
Atmel AVR Technical support

Link to the download: http://www.avrfreaks.net/index.p...

This hopefully will fix the problem in the future.

*TODO - TUTORIAL ON DOWNLOADING THE OLD BOOTLOADER - COMING SOONER OR LATER

AND LIKE I SAID ABOVE, USEFUL CONTRIBUTIONS TO THIS THREAD WILL BE ADDED TO THIS TOP POST. SO PLEASE CONTRIBUTE.

Smiley

Last Edited: Thu. May 4, 2006 - 01:16 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Nit-pick:

Quote:
...a bootloader that allows setting fuse bits...

It's the lock bits, right? IIRC, the datasheet doesn't state that fuse bits can be reprogrammed by software. It does talk about software that can reporgramming lock bits.

It might help newer users if they can avoid potential confusion about firguing out the difference between fuses and locks.

Additional info:

The AVR109 bootloader appnote comes with a zip file containing a reference design for a butterfly bootloader (including joystick control), using the IAR EW jumpstart compiler. Maybe it would be worthwhile to look into using it as a starting point for building a GCC-based, guaranteed-lock-bit-safe bootloader version.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

lfmorrison wrote:
Nit-pick:
Quote:
...a bootloader that allows setting fuse bits...

It's the lock bits, right? IIRC, the datasheet doesn't state that fuse bits can be reprogrammed by software. It does talk about software that can reporgramming lock bits.

Fixed.

lfmorrison wrote:

The AVR109 bootloader appnote comes with a zip file containing a reference design for a butterfly bootloader (including joystick control), using the IAR EW jumpstart compiler. Maybe it would be worthwhile to look into using it as a starting point for building a GCC-based, guaranteed-lock-bit-safe bootloader version.

It would be great if somebody would do this. My time constraints right now are horrendous (I visit AVRFreaks to relax for a few minutes between bouts of coding frenzy)

Smiley

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

lfmorrison wrote:

The AVR109 bootloader appnote comes with a zip file containing a reference design for a butterfly bootloader (including joystick control), using the IAR EW jumpstart compiler. Maybe it would be worthwhile to look into using it as a starting point for building a GCC-based, guaranteed-lock-bit-safe bootloader version.

Since it's a boot loader (Standalone app) couldn't someone with an IAR CC make it , and then it it could be decided if the original it's lock-bit safe.
Unless it is the one the BF loader is based on , then it has proved not to be.

/Bingo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Martin Thomas has a port of the older Butterfly bootloader that doesn't allow lockbits to be set. http://www.siwawi.arubi.uni-kl.d...


My AVR Site

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

How about a quicky KISS cable/software combo for ISP programming combined with a HEX dump of a good bootloader and a simple tutorial online as a solution for newbies like me that run into trouble?

I'm willing to do the leg-work if someone points me in right direction. How about AVRDude?
Could that be combined with a no-parts cable as a fix?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have a STK 500 and 3 dead butterflies, All have this same error. I was wondering if anyone hade a guilde that I could read on how to use the programmer to download the HEX file to the butterfly.

Ryan Nunn-Gage

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you have Studio 4 installed on your computer, you connect a 9-pin serial port to the STK500 serial port and then connect an ISP6 connector from STK500 to Butterfly ISP6 connector.

Make sure you remove any other AVRs that might be on the STK500 Board.

Then you enter TOOLS>Program AVR>AUTOCONNECT from inside Studio4. (If you don't have Studio4 it is a FREE download from the Atmel site at atmel.com)

At this point the STK500 program "box" should appear.

Where it says "Flash" you select a *.hex file from your harddrive of a replacement bootloader. (from the line where it says "Input HEX FIle")

Then you click the [Program] Button.

You will then see the GREEN LED near the ISP connector on the STK500 change from GREEN to RED as it re-programs the Butterfly, then it changes back to GREEN when it is done.

At the bottom of the STK500 "box" you will see:

Erasing Device... OK!
Programming FLASH... OK!
Reading FLASH... OK!
FLASH contents is equal to file... OK!
Leaving programming mode... OK!

If you don't have cables correct, the program will report a problem.

PS. If you can't fix'em I'll give you $20 for the dead Butterflies!

Attachment(s): 

Last Edited: Fri. Apr 14, 2006 - 04:56 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

RetroDan wrote:
Make sure you remove any other AVRs that might be on the STK500 Board.

I don't believe this is necessary. All you need to do is disconnect the STK500 AVRISP from the STK500 and connect it to the Butterfly.

Don

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, Don is right. You should never try to program more than one AVR in parallel (via ISP) on the STK500, which is why you should only ever have on in at a time. I *believe* you could even have multiple AVRs on the STK500 at the same time so long as both are happy at the set VTARGET voltage and both are on differently coloured sockets - since only one of them will ever be connected to the ISP jumper.

The Butterfly connects directly to the STK500's ISP out, skipping all the target sockets and circuitry. Thus even if every single socket is occupied, your STK500 only ever sees the Butterfly. What happens when you then replace the ISP headder onto your AVR-laden STK500 afterwards is a different matter, however...

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

abcminiuser wrote:

Quote:
I *believe* you could even have multiple AVRs on the STK500 at the same time

That would be true if only one microcontroller was programmed or you could gurantee that interconnected pins between microcontrollers would not be called upon to be outputs similtainously.

You will need to know exactly which pins were outputs and be sure that no two electrically connected I/O pins are any of the installed microcontrollers are configured as outputs at the same time.

If more then one microcontroller, whose socket pin are electrically interconnected to any other socket pin with a microcontroller installed is connected as an output, you would have output pin drive or, logic level contention causing excessive output pin drive current, causing possible I/O pin damage.

You can avoid reality, for a while.  But you can't avoid the consequences of reality! - C.W. Livingston

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Indeed so. I was referring to using the STK500 as an ISP programmer only. If you were trying to run multiple AVRs at the same time it would be a different story as all the MCU's IOs would be tied together at the headers as you mention.

Since the MCU's would execute immediatly upon being released from /RESET then you'd have a conflict anyway. Me culpa.

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm trying to experiment with my butterfly and I followed the following instructions

Quote:
9-pin serial port to the STK500 serial port and then connect an ISP6 connector from STK500 to Butterfly ISP6 connector.

Make sure you remove any other AVRs that might be on the STK500 Board.

Then you enter TOOLS>Program AVR>AUTOCONNECT from inside Studio4. (If you don't have Studio4 it is a FREE download from the Atmel site at www.atmel.com)

At this point the STK500 program "box" should appear.

Where it says "Flash" you select a *.hex file from your harddrive of a replacement bootloader. (from the line where it says "Input HEX FIle")

I have connected the ISP header to my butterfly as said (following the picture on page 16 of http://www.atmel.com/dyn/resourc...). I was able to connect to the butterfly but I could not program it. I got the following message

Quote:

Reading FLASH input file.. OK
Setting mode and device parameters.. OK!
Entering programming mode.. FAILED!
Leaving programming mode.. OK!

These are the setup I have on
Program tab:
device: ATMEGA169
ISP: checked
Erase device before programming: checked
Verify device after programming: check

Board tab:
VTARGET: 3.1
AREF: 3.0

Auto tab: unchecked all
Advance tab: 8MHz

I first have the battery in the butterfly and then I took it out. Eitherway, I got the same error message

Please anybody knows how to properly connect the ISP header to butterfly for programming help me, and please let me know what I did wrong.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

anhluulinh,
I can't see how this relates to the OP which concerns the 0x940c error, and thus you are unlikely to get any responses here. I'd suggest you start a new thread in the general forum with a title that might attract some assistance.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you for your advice smileymicros! I was searching for some helps and RetroDan's post seems to be close to my problem . . . and I popped the question.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

One fellow I talked to that used the above method I mentioned had to upgrade the firmware in the STK500 first. I just got mine a few weeks ago and first time I used it, the software forced me to upgade for the STK500 from the Atmel webisite. If your's is older perhaps it need the same upgrade first (?)

Also make sure there are no other chips in the STK500. I know there are people here that say this is not necessary, but I could not re-program my Butterflies unless I removed the factory installed 8535 first. My guess is that if you really know how to use the STK500 you can configure it to ignore any inserted chip, but I only use it for my Butterflies and had to remove it before it would work.

The cable you need is the six-pin ISP connector that runs from the STK500 its labeled ISP6PIN on mine and it is between the large EXPAND1 connector and the ISP10PIN connector (which is itself right next to the [PROGRAM] button. This cable will connect to the six-pin ISP connector on the Butterfly located under the Joystick.

The program that you use inside studio is the "Program AVR" at the bottom of TOOLS and click on Auto Connect.

Are you the same fellow in another thread that pruchased the Butterfly+Book from Simely?

Best of Luck!

Last Edited: Sat. Apr 15, 2006 - 10:54 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

Ignore Smiley's un-helpful resonse because this appears to be the exact thread for fixing the Butterfly's "0940" verify problem.

OK, Dan, please help us see where anhluulinh's post exposes anything that makes it relate to the 0x940 problem.

For all I know the 0x940 problem exposes itself at the verification of the flash contents, and anhluulinh get his error when the programming mode is to be entered, which is earlier in the process than verification.

IMHO Smiley was correct, and the advice on starting a new thread was quite good and in no way un-friendly.

"He used to carry his guitar in a gunny sack, or sit beneath the tree by the railroad track. Oh the engineers would see him sitting in the shade, Strumming with the rhythm that the drivers made. People passing by, they would stop and say, "Oh, my, what that little country boy could play!" [Chuck Berry]

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Honest mistake.

Someone contacted me about using STK500 to fix a "locked" Butterfly and thought it was this fellow. My apologies for getting the two confused. I meant no harm.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hey Joe and everybody,

Thanks for your advice. Last week I got a problem with 0x940c error.
As a novice in programming, I have made a search for simple serial ISP programmer ( I do not like to disturb my printer).

I have decided to use Scott-Falk Huhn's schematics of simplified SI-Prog ISP serial programmer for PonyProg at http://s-huehn.de/elektronik/avr.... The site is in German, so I used Babelfish translation option from www.altavista.com. Circuit was fast constructed on breadboard. Power supply is 3 AA Alkaline batteries (about 4.75V). I have downloaded a newest version of Ponyprog for Windows v2.06f BETA (http://www.lancos.com/prog.html). Bootloader for Butterfly was Martin Thomas's bf_boot_20050503 (http://www.siwawi.arubi.uni-kl.d...). File from archive was bf_boot_gcc.hex.

Butterfly was connected through isp connector to programmer. After setup of PonyProg for device Atmega169, calibration and interface setup to serial and Siprog I/O, memory was erased. Programming is nice explained on site with programmer schematics.
So it took me about 3hr to get my butterfly working again. Searching a web took me much more.

All the best,
Alex Gutzeit

[/url]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

For what it's worth -- I received a Butterfly that either A. was locked on receipt or B. locked during my first write to it -- as in, I tried to write my first program to it and got the 0x940c error.

I just "happened to have" a parallel-port Wigger clone I had bought off ebay last year for a different project -- I opened it up and made it match this schematic http://elm-chan.org/works/avrx/x... and used avrdude -c xil to reflash the thing, which worked. I now have a neat flashing "GCC" on my butterfly!

I just wanted to point out that a lockup doesn't necessarily happen after a successful program. (I was using a 5v power supply brick.)

FWIW, before I erased the unit, my lockbits read out as 0xE1 through the serial port and 0x21 through the ISP header before I erased it, and 0x3f (both ways) after reprogramming. (No idea why the values changed...)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The dataflash may be trashed if you use >4.5 volts.

Smiley

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

smileymicros wrote:
The dataflash may be trashed if you use >4.5 volts.

... er, that should have been "... was using a 5v wall brick with the ECROS carrier board, regulating it down to 3.3v".

(edit)

...er... I didn't realize there was a diode in series with the voltage regulator on board the ECROS carrier, so when I finally measured it my 5v is getting regulated down to 3.0v, which probably isn't good. Never mind. :/

Ben

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello!

I'm trying to fix 0x940c error. I have two Butterflies and I've borrowed STK500 board to fix the problem, but I can only reprogram one of my Butterflies. The other gives some error like Entering programming mode failed, check the ISP programming frequency... I set the ISP programming frequency to 115.2kHz, 57.6kHz, 4kHz, and lower, but it didn't work. My connections and jumper settings should be fine I guess, because I could reprogram one of them. Also, I cannot change fuses and lock bits. It gives the same error. Please, help!!!

Thanks.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I just wanted to chime in with my experience. Total newbie here, so I was completely mystified by the 0x940c error until someone pointed out this thread to me.

I read http://www.bsdhome.com/avrdude/ (BSD programmer?), and built the cable to connect to the ISP port on the AVR Butterfly:

DB25 pin 7 --------------------------------------------- ISP pin 5 (RST)
DB25 pin 8 -----------1KOhm resistor ---------- ISP pin 3 (SCK)
DB25 pin 9 ---------- 1KOhm resistor ---------- ISP pin 4 (MOSI)
DB25 pin 10 ------------------------------------------- ISP pin 1 (MISO)
DB25 pin 18 ------------------------------------------- ISP pin 6 (GND)

(ISP pin layout:
2 4 6
1 3 5)

Instead of VCC=+3V for normal operation of the butterfly, I used VCC=+5V during the following programming operation. I don't know if this is necessary, but that's what I did since the above poster said he used 4.75V.

Turned on the power, and ran avrdude:

# avrdude -p m169 -c bsd -U flash:w:bf_boot_gcc.hex

where bf_boot_gcc.hex is downloaded from http://www.siwawi.arubi.uni-kl.d...

It seemed to work (no errors)!

One thing to note -- after removing the parallel cable and going back to 3V and AVRprog in AVR Studio, I tried to "Verify" and got the 0x940c error once again. So, I thought the above rescue op had failed. However, once I hit "Program", AVRprog erased, programmed, and verified the Flash successfully. No more 0x940c errors!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi guys, another 0x940c problem here.

I constructed the parallel cable described at http://bluebat.dnsalias.org/howto/butterfly/

I then added the entry to avrdude.conf:

programmer
  id    = "swppi";
  desc  = "Simple wire parallel port interface for ISP connector";
  type  = par;
  sck   = 1;
  mosi  = 2;
  miso  = 11;
  reset = 16;
;

however, I am still getting this error from avrdude:

# avrdude -p m169 -c swppi -P /dev/parport00 -U flash:w:/tmp/blinky2.hex

avrdude: AVR device not responding
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.


avrdude done.  Thank you.

I then tried using the -F flag:

# avrdude -F -p m169 -c swppi -P /dev/parport00 -U flash:v:/tmp/blinky2.h ex

avrdude: AVR device not responding
avrdude: initialization failed, rc=-1
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0xffffff
avrdude: Yikes!  Invalid device signature.
avrdude: verifying flash memory against /tmp/blinky2.hex:
avrdude: load data flash data from input file /tmp/blinky2.hex:
avrdude: input file /tmp/blinky2.hex auto detected as Intel Hex
avrdude: input file /tmp/blinky2.hex contains 174 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.05s

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0000
         0x0c != 0xff
avrdude: verification error; content mismatch

avrdude: safemode: Fuses OK

avrdude done.  Thank you.

any ideas? The linked article mentioned using an external 4.5v power supply, but I just fed 3v to the +3v pin using two AA batteries (non rechargeable).

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ok, I hacked together the 'bsd' programming cable as described here:

http://www.bsdhome.com/avrdude/

here is what it looks like:

However, I only had 2.2KOhm resistors on hand, and I used those between every connection except for ground.

I ran the following:

avrdude -p m169 -c bsd -P /dev/parport00 -U flash:w:/tmp/blinky2.hex

but I am still getting the same error message (avr not responding).

I thought perhaps my parallel port wasn't working correctly, so I used the '-E vcc' option, and was then able to meansure 3 volts off of pin 2, so avrdude appears to be controlling the parallel port successfully.

Also, I tried using the parallel pin 2 to ISP VCC to power the avr, and then tried using my two AA batteries connected to +3v on PORTD, but neither of those appeared to make a difference.

I don't think I have fried my avr, because the last program I was able to flash into it still works (it lights an LED on PORTD pin 2).

Perhaps tomorrow I will go buy some 1KOhm resistors and try again.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

SUCCESS!!!

Ok, I also had some 150 Ohm resistors lying around, so I tried those instead, and it worked!

# avrdude -p m169 -c bsd -P /dev/parport00 -U flash:w:/tmp/blinky2.hex

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e9405
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "/tmp/blinky2.hex"
avrdude: input file /tmp/blinky2.hex auto detected as Intel Hex
avrdude: writing flash (174 bytes):

Writing | ################################################## | 100% 0.07s

avrdude: 174 bytes of flash written
avrdude: verifying flash memory against /tmp/blinky2.hex:
avrdude: load data flash data from input file /tmp/blinky2.hex:
avrdude: input file /tmp/blinky2.hex auto detected as Intel Hex
avrdude: input file /tmp/blinky2.hex contains 174 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.05s

avrdude: verifying ...
avrdude: 174 bytes of flash verified

avrdude: safemode: Fuses OK

avrdude done.  Thank you.

The configuration which worked was having the parallel VCC (pin 2) connected to AVR ISP VCC (pin 2), *and* connecting a 3V power source to the +3V pin next to PORTD.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I put up an album of photos with a little bit more detail for the rest of you who may encounter this problem.

http://jason.pepas.com/photos/bsd-flash

here are the pin connections, just for reference.

parallel ->           -> ISP
---------------------------
    2    ->  150 Ohm  ->  2
    7    ->  150 Ohm  ->  5
    8    ->  150 Ohm  ->  3
    9    ->  150 Ohm  ->  4
   10    ->  150 Ohm  ->  1
   18    ->  -------  ->  6

ISP pinout
+--+--+--+
| 2| 4| 6|
+--+--+--+
| 1| 3| 5|
+--+--+--+

ISP with parallel pin connections
+--+--+--+
| 2| 9|18|
+--+--+--+
|10| 8| 7|
+--+--+--+
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Good work Cell, I've added a note to the OP to refer to your posts.

Smiley

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

also, you may need to (as I did) create your parport device nodes before you can use them.

from http://www.ussg.iu.edu/hypermail/linux/kernel/9907.2/0139.html:

mknod /dev/parport00 c 99 0
mknod /dev/parport01 c 99 1
mknod /dev/parport10 c 99 16
mknod /dev/parport11 c 99 17
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

also note: rather than unplugging your parallel cable each time you want to switch your avr from flash mode to run mode, you can instead simply disconnect pin 5 of ISP (the reset pin). I find it easier to simply pull a wire out of my breadboard than to disconnect the DB25 connector.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Any new guys with an ISP should check those fuse and lock bits.

Wow that was hard! as you may have guessed I am a newbie. I have an AVR ISP and a Butterfly and had all the problems that everyone else is having. Thanks to everyone at AVR Freaks, Smiley, siwawi and Atmel, I now have made it to the cyclone eyes in Smiley's book (the "Quick Start"). I can honestly say that one of my biggest troubles was making myself stop and READ. A newbie is so ready to get started its hard to make yourself do all the leg work. Once I read the AVR ISP help and did a manual firmware upgrade to the ISP, I was then able to think about using it to put a new bootload on the butterfly. at the end of the ReadMe in siwawi's file (yes it is the first time in my life I read a readme.txt) I saw the fuse and lock bit settings for the butterfly. I did have to make a change to my settings to match what siwawi instructed. The default settings were not what I wanted. I read through Smiley's first part again about how to compile a .c (I had to compile siwawi's code) and a quick program later this stuff is finally working. I hate it when stuff doesn't work.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I followed both unprovoked and cells instruction, but all I get is

Quote:
avrdude: AVR device not responding
. I am using windows xp with the following par setup:

DB25 pin 7 ------------100Ohm resistor---------- ISP pin 5 (RST)
DB25 pin 8 -----------1KOhm resistor ---------- ISP pin 3 (SCK)
DB25 pin 9 ---------- 1KOhm resistor ---------- ISP pin 4 (MOSI)
DB25 pin 10 ---------100Ohm resistor----------- ISP pin 1 (MISO)
DB25 pin 18 ------------------------------------------- ISP pin 6 (GND)

avrdude -p m169 -c bsd -U flash:w:bf_boot_gcc.hex

I checked the pins about 20 times. I am sure they are correct. IMO putting those 100Ohm should not affect anything since Cell got it to program with 150Ohms. Initially I used all 100Ohm, then I changed pin 8 and 9 to 1kOhm. Also, I am using the Carrier with a 12V supply. The output at the regulator is 3.3V. What seems to be the problem? Someone please help me =( I am going crazy.

One newbi question... What is the difference between Flash and EEPROM when you are using the AVR Prog? I accidently press program on the EEPROM when I first tried to load blinky in. It verified but did not do anything. Then I got the 0x940c error of death!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Try it without the Resistors and see what happens. The SCK line is probably your problem.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I know it isn't the "no money down" way to do it but the AVR ISP does work and it only $20. Please don't flame me for suggeseting it. I haven't tried any other method for putting a boot loader on the butterfly but once I got my ISP working everything went very smooth. so if all else fails.... you could drop $20 and at least you would get a cool little ISP out of it.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

oops! It was pointed out to me that the $20 ISP that I mentioned is really $30. Sorry about that.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I got the same 0x940c error, but I managed to program it with ISP though I managed to change the internal clock to external clock so my butterfly wouldnt run.

This is how I fixed it, I wrote a small tutorial about it:

http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=38958

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

RetroDan wrote:

Then you enter TOOLS>Program AVR>AUTOCONNECT from inside Studio4.

Thanks for the tip.

I found that these instructions are good for the latest version of Studio, but don't apply to the version I got with Smiley's book.

Oh well. I'm a Better Person for having struggled.

~LMG

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quoted from above:

"A small percent (see: http://www.avrfreaks.net/index.p... ... 35#214435) of Butterfly users have experienced an error when programming the Butterfly. This error has the hex number 0x940c in the error message and basically means the Butterfly Bootloader is temporarily futzed and the bootloader will have to be reloaded with an ISP programmer"

I have had mine do it to me 3 times in a week :evil:

I have purchased a lotto ticket :shock:

Ken Munger

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ken,

Smiley Micros, AVRFreaks, DigiKey, and ATmel all distribute these things and the percentage IS small as discussed above. Sorry you had the problem, but it you load the original bootloader which you can get from the link in the OP you will not see this problem again. I'll reprogram it for you if you want to send it to me.

Smiley

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well I sure appreciate the offer smiley but I am having no problem resetting the lock bit. That little ICE Cube I got works real well... so far.

What I did was go to Atmels site and download the Bootloader from there making the assumption that since they are using a new bootloader for their newer butterflies as stated in a previous post by an Atmel gent then they surely had that same bootloader on their site.

Serious, serious flawed logic on my part I suppose. :roll:

Anyhow I have installed the new bootloader that the Atmel gentleman in the previous post has said would take care of this problem.

muchos regardos
Ken

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

? One would hope they are posting a bootloader that works, but I know that Martin Thomas' port of the original bootloader to GCC works just fine, so if you see the 0x940c error again, try his.

Smiley

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

FYI: Rev4 of the Butterfly bootloader has recently been added to Atmel's website. Does anyone know what has changed in this version?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well, for one thing - no more 0x940c errors so I guess the bootloader can't set fuses.

Smiley

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi there,

I recently encountered this issue on my butterfly.
Is there someone in this community who lives near Brisbane (Australia) and who can help me fix it?

Regards,

Tilman

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

tweiers wrote:
Hi there,

I recently encountered this issue on my butterfly.
Is there someone in this community who lives near Brisbane (Australia) and who can help me fix it?

Regards,

Tilman

If you are serious, you need to start your own thread and put a specific title on it. Such as 'Brisbane Butterfly Battler Beseeches Brethren'. If you start a new thread and provide some information about the problem then lots of folks will jump in to help.

Smiley

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

My Butterfly has also come up with the 0x940c problem. I see that I need a new bootloader so can one use one of the USB tinyISP as a bootloader?

Thank you

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It has been years since anyone has seen this problem. Did you read this thread to learn how to fix the problem? It is all here, including my offer to program it for you, so no need to repeat it.

Smiley

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

That I did and will send you my dead insect.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Great! I'll be expecting it.

Smiley