Butterfly Programming

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

Hi,

I started smileys tutorial for the butterfly. I am having a hard time programming the butterfly.

I can connect to it using hyperterminal and i sent it a name so i'm somewhat confident in my rs 232 connection, but when i try to download a program it keeps saying the device is not supported.

I have reset and ground on the isp header shorted while I hold the joystick and click the avrprog button.

Can anyone please shed some light on what i might be doing wrong?

I suspected it to be my usb to rs232 cable (using a mac in parallels), but i have the same behavior on my pc using an rs232 cable : connects to hyperterminal, but cannot program.

please help?

thank you kindly and a big hello to everyone on this board.

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

seasick wrote:
it keeps saying the device is not supported.
What is the 'it' and what exactly is it saying?

In the meantime you might check out the Butterfly FAQ in the downloads section of my website.

Smiley

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

"it" is AVRstudio using AVRProg.

I tried the tips you recommendeded in your supplmental butterfly document with no success.

I briefly read a thread about fuse bits and the AVR. I'm lucky enough to have a STK500 so the next thing i'm going to try is hooking that up to it and setting fuse bits or something...

If you think i'm getting ahead of myself, let me know.

thanks,

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

I don't know if this is a problem or not, but you say

Quote:
it keeps saying the device is not supported.
But AVRProg will say 'No Supported Board Found'. IIRC AVRDude has an error that says something like 'device not supported' so I was wondering if you might have confused the two? Maybe you can post a screenshot of your error message.

STK-500 is great and means you will be fully independent in you learning the Butterfly since there is little that one can screw up that the STK-500 can't fix. But I'd recommend figuring out how to use the bootloader on the Butterfly first since your problem at the moment is probably something simple (frustrating yes, but probably head smacking simple when you figure it out.)

Good Luck,
Smiley

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

The first thing I would determine is whether the infamous boot fuse is correct or not. Just reset the thing (or pull and replace the battery) without messing with the joystick. If it sits there like a lump, you may be OK. If it starts scrolling the banner on the LCD after a couple of seconds, it's the fuse.

With the STK500 you'll be able to fix it, so you're in much better shape than most who encounter problems with their first Butterfly.

It's always helpful to know where you're located, so you might consider putting in your location in your profile. There may be someone down the street from you who can help you out.

As Smiley says, good luck. You might check out my Butterfly tutorials as well.

one
another one

Chuck Baird

"I wish I were dumber so I could be more certain about my opinions. It looks fun." -- Scott Adams

http://www.cbaird.org

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

Hi Smiley,

thanks for replying. I attached a screenshot of my desktop.

if i can connect using hyperterminal and send a name, but not connect using brays or avrprog is it possible that i have to fix something through the stk500 or can you say that it is an operation error on my part?

i'm getting ready to hook it up to my stk500 but i'm not sure how..this is all i know so far..

-connect the 6 pin isp cable from the stk to the butterfly

do i have to power the butterfly board independently?
do i leave the Vtarget jumper shorted on the stk500?
i'm assuming that i have to change the board voltage level on the stk500 to 3 v?

Attachment(s): 

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

yes my device starts scrolling AVR Butterfly ----blah blah after i short the reset and gnd pins on the isr. how can i go about programming it thorugh the stk? i'm confused on the connections / power settings.

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

Well, I'm not at home at the moment, so I have to rely on my bad memory. What I would do:

Pull the Butterfly's battery

Download AVR Studio and apply any service packs

Solder a 6 pin header on the Butterfly's ISP holes, pins facing up

Remove all cables and chips from the STK500

Connect STK500 to PC with a serial cable

Fire up Studio and connect to the STK500. Set the ISP speed fairly low. Set the target voltage at 3 volts. Write it (otherwise it won't set it on the STK500).

Turn off STK500. Cable the Butterfly to the STK500 with a 6 wire cable using the ISP connectors on both. Set the VTARGET jumper.

Turn on the STK500. Run Studio, select ATmega169 as the target chip. Read the signature. If it doesn't read correctly, turn everything off. If it does, read the fuses.

Note the BOOTRST fuse. Change it. Write it. Turn everything off. Unplug Butterfly's ISP cable. Put battery back into Butterfly. See if it sits there like a lump. Jiggle joystick. See if banner magically appears.

If so, all is well in the universe. If not, ask again.

I've probably left something out. Hopefully someone will jump in here with additions and corrections.

Chuck Baird

"I wish I were dumber so I could be more certain about my opinions. It looks fun." -- Scott Adams

http://www.cbaird.org

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

Chuck to the rescue :D

BTW, where did you get your Butterfly?

Smiley

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

Quote:
BTW, where did you get your Butterfly?

And when? We're trying to figure out when good ideas went bad...

Chuck Baird

"I wish I were dumber so I could be more certain about my opinions. It looks fun." -- Scott Adams

http://www.cbaird.org

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

Hi seasick,
I suggest you try to communicate with terminal monitor like HyperTerminal in Window but I don't have mac.

1) Prepare terminal monitor at baud rate 19200 and select com port that you use
2) Press down and hold the joystick and then power toggle the butterfly
3) while keep hold the joystick, check at the terminal monitor, if you see some strange characters or moving cursor, the butterfly is now ready for communicating with AVRProg. If not redo again from step (2).
4) If OK, close the terminal monitor program and try to communicate with AVRProg, try to run AVRProg for 2 or 3 times. it should work now. :D

5) Still problem? :oops:
You need some programmer like STK500 or home-brew one to check the fuse setting. Here is my favourite programmer http://elm-chan.org/works/avrx/avrx_lpt.png . Try to check on boot start section, it should be HIGH=0x98 LOW=0xE2 in STK500 http://www.siwawi.arubi.uni-kl.de/avr_projects/bf_def_fuses.html

If fuse setting is OK, then your hex is corrupt and you have to flash the hex file to AVR butterfly by using some AVR programmer. The hex file is from Atmel http://www.atmel.com/dyn/resources/prod_documents/butterfly_boot_rev04.zip

Happy Microcontroller Programming!!

pak

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

thank you guys so much for the help, it actually works now.

i had to reprogram it using my stk500.

this butterfly was bought from digikey about a month ago. I will report later and tell you how awesome all this microcontroller stuff is!

cheers!