Butterfly Programming

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

Hey guys,

Just recieved my AVRButterfly (where'd they get the name, my mum wants to know!). I understand that programming via the inbuilt bootloader will not erase the bootloader itself, but what about subsequent programmings? How to I "jump" back to the bootloader for the next re-write?

Smokey, this should be right up your alley.
- Dean :twisted:

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

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

Just got my butterfly/tshirt combo too.

It appears that every time the Butterfly is reset from any source (watchdog timeout, reset button, brownout detector, or when it is powered up from being turned off) it automatically starts in the bootloader section. This is accomplished using a certian selection in the AVR's fuse bits. If the BOOTRST fuse is programmed (0) then the AVR will start up every time with PC pointing to the beginning of the bootloader sector, instead of 0x0000. The Butterfly comes from the factory with the BOOTRST fuse programmed. Just make sure you don't accidentally unprogram the BOOTRST bit, or else the bootloader code may become unavailable.

As well, if you include the option in your application code to jump to the bootloader section on a certain command, then you can go directly into the bootloader section at will without rebooting your AVR, even if you did accidentally unprogram the BOOTRST bit. Where do you have to jump to? Examine the BOOTSZ Fuses and read the data sheet - that will give you the address of the Reset vector for the Boot section -- just to a JMP to that location. (It couldn't hurt to do a little housekeeping first if you follow this option -- disable all interrupt sources, mask global interrupts, revert the ports to their default condition. Put the AVR in a state as close to 'default' as possible, to give the bootloader code the initial conditions that it would expect to find when it first starts up.)

However you enter the bootloader section, holding the joystick in the ENTER position will allow you to load your code. Pushing the joystick in the UP position will jump from the bootloader into the application section's Reset vector.

- Luke

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

abcminiuser wrote:
Hey guys,

Just recieved my AVRButterfly (where'd they get the name, my mum wants to know!). I understand that programming via the inbuilt bootloader will not erase the bootloader itself, but what about subsequent programmings? How to I "jump" back to the bootloader for the next re-write?

Smokey, this should be right up your alley.
- Dean :twisted:

Like Luke said, and relax and read the Quick Start Guide. It goes over all this except how it got its name and you have to sign a Non Disclosure Agreement with Atmel to get that information.

Smiley

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

smileymicros wrote:

Like Luke said, and relax and read the Quick Start Guide.
Smiley

Like Smiley said , .... :wink: :wink:

Read the book Luke

Trust the force :-)

/Bingo

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

@Dean

If everything FSCK up , build one of these small curcuits :

Serial ISP dongle:
http://www.olimex.com/dev/images...
http://www.olimex.com/dev/avr-pg...

Parallel ISP dongle:
http://www.olimex.com/dev/images...
http://www.olimex.com/dev/avr-pg...

I use the serial one with PonyProg and M8 and M32 , and it is supposed to support M169 also.

Just dont disable the SPI .... or feed it with more than 4.5v from external.
I think the dataflash might start sending smoke signals if you give it 5v.

But a diode ie. 1N4001 in series with VCC ought to bring a 5v to 4.3v if you only have 5v @ home

/Bingo

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

Bingo600 wrote:

But a diode ie. 1N4001 in series with VCC ought to bring a 5v to 4.3v if you only have 5v @ home

Contrary to what the data sheets imply DON'T EVEN THINK ABOUT GETTING 5V ANY WHERE NEAR A BUTTERFLY! Use two 1.5 V batteries in series or a 3 V wall wart. I've got two fried Butterflys from allowing 5V near them. I have no idea what happened, but it ain't worth the gamble to find out.

Smiley

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

SteveN wrote:
Hi,

I don't mean to be argumentative and I may jinx myself but I have 12 Butterflies that I modified for 5V use. So far so good (as I knock on wood). I removed the battery holder, some zero ohm resistors, added a jumper or two. I also removed the Dataflash. I could go back and see exactly what I did and report it back here if it will help anyone.

Regards,
Steve

That woud be neat Steve

I am wondering if the dataflash is the only "non 5v" thing on the board.

I have tonnz of
MICREL M2920A 33BS
3.3V 400mA Low-Dropout Voltage Regulator
SOT-223 Package

And would like to put such a thing in front of the BF

But as i read the scematic, there is a DUAL BAT54 in betveen the ext power and the vcc , so woth 3.3v in and the voltage drop across the BAT im not sure if VCC will be high enough.

If i bypass the DUAL BAT for the micrel , im not sure if it will still "Block" the connected battery.

Maybe someone can have a look at the schematic (page 37):
http://www.atmel.com/dyn/resourc...

/Bingo

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

I already have a parallel dongle from my ABCmini, this consists of direct connections from the parallel port to a SIL plug. I'd like to make a Butterfly "adaptor" for it (lowering the 5V, changing the pin locations to match the Butterfly). I'm also going to make an adaptor for my ABC serial cable to suit the butterfly; this only needs one pin to be moved.

Why would ATMEL only make a 4.5V dataflash? Seems barmey to me, why not the standard 5V? And I hope you were kidding about the NDA on the Butterfly name...

I think the butterfly would be an incredibly good system to make a home-built RCX, the microcontroller programmable "brick" that power the LEGO Mindstorms Robotics sets. The onboard dataflash, LCD, Beeper, etc. make it almost too good to be true. Just need to lean how to control the &^%* LCD first. The butterfly is also cheaper than an ABCmini, with lots of extra features to boot. So long as it dosn't matter if I drive my standard 16x2 LCD via PORTD (the on-board LCD does not like extended periods of DC apparently), It coudl work out to be a good AU$30 cheaper - and I have more program/liquid data space and a minature user interface for internal setup. Drool.

Hw many Butterfly's you own/blown up, Smokey? I hope you've salvaged the parts off em (or at least kept them) - I'll take them off your hands!!

- Dean :twisted:

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

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

I had two quit working when I had them powered at 5v and put a 5v signal on the ADC. Worked just fine until the ADC. Don't work now. Don't know why. I'm sticking with 3V until somebody else figures this out.

Smiley

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

...Well, i'll have em! Do you mean the A/D converter at the top-left of the board? I'll check the schematics to see what else is running of that pin. Incidentally, the datasheets say that it can handle 5V on the A/D, even when powered by 3V. Go figure.

- Dean :twisted:

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

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

When I get a round tuit I'll try to parallel program them to see if I just messed up some fuses or something, so, no you won't have them. Unless or course you live near an opal mine, then we might talk.

Yeah, the data sheet was why I did it. And it is possible that something entirely coincidental caused the two to die, but it hasn't happened since I stopped letting 5V near them. However, I do live near a major top secret nuclear bomb facility, so who knows, maybe they were testing a weapons system they got off one of the saucers from Area-51. More likely though it was microgremlins.

Smiley

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

I actually had someone give me a round tuit. It was a coin with tuit printed on it. I took me a few head scratching days before I finally figured out the pun. Some folks are entirely too subtle. Fortunately, I'm not.

Anyway, I think the Butterfly, as great as it is, has some money-saving short-cuts that lead to some unpredictable weirdness. For instance, you are supposed to compensate the voltage reference for the ambient light level since the light dependent resistor effects the Vref. Also, I've never seen RS-232 voltages handled quite like it is handled in the Butterfly. It works, but it does seem rather minimal. I haven't reversed engineered enough of the design to see what other short-cuts they took, but considering what all they crammed in and the incredible low cost they charge, I suspect that there may be at least one desirable diode that got left out and may have caused my problem. Anyway, I've not killed another using 3V and I've done everything to them short of punting for a field goal.

Smiley

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

Smokey, just making sure that good parts arn't wasted. Incidentally, I have got a few decent pieces of cut and uncut opal, and I live near an ancient gold mine that was filled in years ago to make space for housing after all the viable material was extracted.

How does the butterfly produce RS-232 voltages from a 3V source? The "killed my butterfly with ADC 5V" seems like a good conundrum to give to those helpful ATMEL folks. I want a rount tuit now, i'm into those subtle jokes.

Everyone, post a picture of yourselves wearing your butterfly and T-Shirt in the off-topic forums already!!

- Dean :twisted:

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

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

Miniuser:
The Butterfly does not produce 'real' RS232 signals. See the schematic of the "UART-Level-Inverter" available in the User's-Manual. As long as you are not using a very old PC the "RS232"-signals from the Butterfly should be ok. Haven't had problems so far. The Atmel AVRISP has an RS232 circuit which is much like the one on the BF.

Smiley:
I'm just interested: which parts are broken on your "dead 5V-BFs"?

Martin Thomas

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

mjthomas wrote:
Smiley:
I'm just interested: which parts are broken on your "dead 5V-BFs"?

I don't know. I had them connected to 5V and then put an intermediate voltage on the ADC. Neither communicated with the PC or showed anything on the LCD afterward. I switched to 3V and had no further problems. I sat them aside, intending to dig later as I had time to see if I could figure out what happened, but I haven't had the time yet. I haven't even tried the ISP or JTAG yet, so who knows? Maybe I should quit warning folks until I've had a closer look.

Smiley