can you set all the Butterfly fuses and lock bits with the AVRISP?

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

I have a Butterfly and an AVRISP that I have connected with a USB-serial converter on a windows 10 machine.  I would like to work through smileymocros tutorial using the bootloader functions of the butterfly.  It appears that my butterfly has the BOOTRST bit set incorrectly as the butterfly goes straight to running the built in demo at start up.  I see the butterfly user guide has data regarding these bits.  When I try to set them in the AVR studio 4 gui, it appears to work but I don't think it actually does and my butterfly continues to boot to the demo program.

 

Is the AVRISP capable of setting these bits?

 

PS Why the heck does my cursor return to the top left of the text box every time I hit the enter key when I am using this forum?  It only happens to me on this forum and oh my gosh is it annoying. indecision

 

Thanks

 

Attachment(s): 

This topic has a solution.
Last Edited: Wed. Mar 15, 2017 - 11:22 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

the bootrst fuses are only for telling the chip to first go and check a specific location, plus that IIRC it enables some instructions for instance to write to flash instead of only reading.

by default there is no bootloader program in the CPU. I am not sure though if the butterfly demo code has a boot loader integrated if it has, there probably is a special way to let the butterlfy code know that you want to go into bootloader mode.

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

meslomp wrote:
the bootrst fuses are only for telling the chip to first go and check a specific location, plus that IIRC it enables some instructions for instance to write to flash instead of only reading. by default there is no bootloader program in the CPU.
Sorry but What are you talking about?

 

(a) the Butterfly comes preload with an AVR109 bootloader (which is why you can program it with nothing more than a serial cable - kind of the original "Arduino" in fact!)

 

(b) BOOTRST says "at power on fetch first opcode from start of bootloader not start of app section at 0x0000" - there's no "check" in this - it simply dictates where execution starts

 

(c) it has nothing to do with writing to flash. There is simply a limit on megaAVRs that SPM can only execute in the high (bootloader) part of the chip but this is not related to any fuse

 

flyingblindonarocketcycle wrote:
When I try to set them in the AVR studio 4 gui, it appears to work but I don't think it actually does and my butterfly continues to boot to the demo program.

But the default action of the bootloader IS to start the app code isn't it? I seem to remember you had to press the joystick or something to make the Butterfly stay in "bootloader mode" at power on. (though it's a long time ago since I lasted used one!).

 

I wonder what you mean by "AVRISP"? Are you talking about an AVRISPmkII from Atmel:

 

https://images-na.ssl-images-amazon.com/images/I/218PcWJxm7L.jpg

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

clawson -  I seem to remember you had to press the joystick or something to make the Butterfly stay in "bootloader mode" at power on. (though it's a long time ago since I lasted used one!).

 

I would quote you but I can't seem to get that to work...

 

I should have been a little more descriptive in my question.  I do indeed hold the joystick down while cycling power on the Butterfly and it ignores me and boots the demo anyway.  That's where I end with the question about BOOTRST.  I read short tutorial in avrfreaks somewhere that mentioned the BOOTRST fuse getting set wrong would prevent the butterfly from ever going into bootloader.  The tutorial did no go on to tell me how to fix this if I get painted into that corner.

 

That AVRISPmkII is VERY close to what I have except mine has a serial port input and no USB input.  I have a USB to serial adaptor cable that I use to run the AVRISP.

http://www.atmel.com/tools/matureavrisp.aspx?tab=documents

 

Atmel appears to no longer publish the documentation.  I thought I had uploaded a third screen shot which I do not see right now.  I believe it the missing screen shot shows fuses set wrong.  I change them, save the changes, and the Butterfly acts like I didn't change them.  I reload the demo.hex with the fuses set how they should go and after the successfully programing, the fuses are back to they way they were before I changed them.  Im don't have access to that PC until tonight or I would post the screen shot now.

 

Thanks a lot for looking at this with me.

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

flyingblindonarocketcycle wrote:
That's where I end with the question about BOOTRST. I read short tutorial in avrfreaks somewhere that mentioned the BOOTRST fuse getting set wrong would prevent the butterfly from ever going into bootloader. The tutorial did no go on to tell me how to fix this if I get painted into that corner.
I seem to remember that Atmel made/released a batch of Butterflys that had the bootloader programmed but where they forgot to set the fuses (including BOOTRST) so it would only ever work once. Presumably that is what you have. You need an ISP programmer to repair that.

 

If you really have the original AVRISP from about the turn of the millenium I'm not sure any current Atmel software will support it (not even sure about AS4) but avrdude.exe almost certainly will. So I would get a copy of that and give it a go. Clearly you need to read the existing fuses just verify that the only "fault" is the absence of BOOTRSt then program back that one fuse byte to switch the state.

 

Of course there is then an argument that says: "if you have a working ISP programmer why bother with bootloaders at all?". The bootloader in the Butterfly was only really there (just like Arduino these days!) so that those who did not own an ISP programmer could still program the AVR.

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

flyingblindonarocketcycle wrote:
When I try to set them in the AVR studio 4 gui, it appears to work but I don't think it actually does and my butterfly continues to boot to the demo program.

 

Is the AVRISP capable of setting these bits?

 

You can use the demo program to start the bootloader.

A jump to the boot section can be done from the application,

    "Options -> Bootloader -> Jump to Bootloader"

 

If you don't already have them, you can download the Butterfly User Guide and Quick Start documents (Link).

 

You can download the AVRISP User Guide at the link in post #1 (Link).  Just click on the '?', download the file, and then click on the file name.

 

 

 

Also, to test the AVRISP, change the Boot Reset fuse bit and then read out the fuse bytes to see if the bit changed.

 

 

Finally, you can download the latest Butterfly Bootloader and Application firmware (Link).

 

Edit: added link.

 

Last Edited: Tue. Mar 14, 2017 - 07:18 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:

If you really have the original AVRISP from about the turn of the millenium I'm not sure any current Atmel software will support it (not even sure about AS4) but avrdude.exe almost certainly will. 

 

I really do have an antique AVRISP.  AV4 "does" support it except I can't seem to get the fuses to stick when I program them.  They program, they verify, they don't work.

 

clawson wrote:

Of course there is then an argument that says: "if you have a working ISP programmer why bother with bootloaders at all?". 

 

I can not justify or defend my OCD.  Its just the fact that it doesn't work fully as it should that will annoy me to no end! 

 

I started reading an AVRDUDE tutorial last night and slowly trying some of the commands.  It will be interesting if AVRdude can fix it when the AVS4 "supports" AVRISP and lets me believe I am changing bits in the GUI.

 

Thanks

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

Chuck

 

Thanks for the suggestions.  I didn't mention it in an effort to keep my cry for help short but I had already tried all the the things you suggested before coming to the forum.  No joy on all accounts.

 

One curious note: have you downloaded the AVRISP help files from Atmel?  I bet you haven't.  When I do, all I get is a help file menu with no actual help files.  If its working for you, how are you using it?

 

Thanks all

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

flyingblindonarocketcycle wrote:

One curious note: have you downloaded the AVRISP help files from Atmel?  I bet you haven't.  When I do, all I get is a help file menu with no actual help files.  If its working for you, how are you using it?

 

Oops!  I stopped when I saw the help file menu.

 

Chuck99 wrote:

Finally, you can download the latest Butterfly Bootloader and Application firmware (Link).

 

If you couldn't start the Bootloader from the Application menu, you can use your AVRISP to reprogram the Butterfly's Bootloader.

 

 

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

No worries chuck! When a newb shows up asking for help on antique gear, providing guidance is going to be difficult at best. Why on earth would anyone be looking at documentation for this extinct stuff right? So your suggestion of using the avrisp to load just the bootloader is a good idea which I tried last night. It's so weird, because that sort of looks like that works. I can get "?" Marks when pushing the center button while looking at a serial connection AND I can get avr S4 to recognize the chip with its old serial program mode. BUT I can NOT have the butterfly demo with the bootloader running at the same time. It's either bootloader only or butterfly demo only. I have not yet tested actually programming with the bootloader on the chip. As clawson pointed out, it may be a silly effort at this point. To sum up, it looks like the butterfly lives " sort of " on windows 10.

Thanks for the assist fellas

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Oh yea so the avrisp does appear to set fuses with no problem, I think I just have a misbehaving butterfly.