This is a collection of questions I asked myself and answers I gathered while experimenting with the AVR Butterfly evaluation kit by Atmel
My first contact with the AVR Butterfly was caused by the article Vielfältiger Schmetterling by Nils Faerber in the german Linux Magazin volume 2004/07.
Although I tried to make this page free of errors, nobody is perfect. If you notice a mistake, don't hesitate to contact me! Use the information on this page at your own risk.
I cannot program the AVR Butterfly via the parallel cable from Linux Magazin and uisp!
Unfortunately there is an error in figure 1. You can find the right pin assignment on page 3-12 of the AVR Butterfly User's Guide. The pins are as follows:
Is it possible to program the AVR Butterfly via a serial cable? Yes! Regarding to the remarks by Martin Thomas on the above mentioned Linux Magazin article, it is indeed very advisable to prefer programming via serial cable and a bootloader.
The following steps are necessary to use the bootloader to program the AVR Butterfly via the serial port:
Start the bootloader by using the demo application (Options/Bootloader/Jump to Bootloader), by power-cycling or by resetting the AVR Butterfly (short-circuit pin 5 and 6 of the ISP/J403 connector).
Press the joystick center button (enter) and keep it pressed. Run the following command (assuming your program is named main.hex and your AVR Butterfly is connected to ttyS0): avrdude -p m169 -c butterfly -P /dev/ttyS0 -U flash:w:main.hex
As soon as avrdude connected to the bootloader, you may release the joystick. Reset the AVR Butterfly to run your application. After the reset the bootloader is started again. You may leave it by pressing the joystick upwards.
Most probably you have unknowledgeable removed the bootloader while programming your AVR Butterfly via the parallel cable and isp. The next paragraphs guide you through the steps which are necessary to install a bootloader again.
programmer id = "swppi"; desc = "Simple wire parallel port interface for ISP connector"; type = par; sck = 1; mosi = 2; miso = 11; reset = 16; ;
The numbers above describe the pins of the parallel port connector to which the four relevant wires are connected to. The numbers in this example correspond to the configuration described in table 2 of the Linux Magazin article mentioned at the beginning.
If you know what you are doing (or have an existing cable), you may of course use (slightly) different pins. See also the existing programmers in the configuration file named dt006 and bascom which are very similar, but use other pin configurations.
Download and compile the avr-gcc-port by Martin Thomas of the original Atmel bootloader from his avr-projects page.
Connect the AVR Butterfly to your parallel port and switch on the external power supply (4.5V) but don't forget to remove the internal battery. Write the bootloader (after compilation in file main.hex) via the parallel port with the command:
Now (a port of) the original bootloader is restored. Follow the guide in the previous question on how to program your AVR Butterfly with the bootloader via the serial port.
As described in the AVR Butterfly User's Guide, no special assignment is necessary (if you know what the pin assignment of a 9-pin serial connector is).
Where can I find more information on the AVR Butterfly?
Try the page of Martin Thomas. Although he mainly describes the windows port of the gnu toolchain, most of the information is useful for linux users, too :-)