Sunday, November 30, 2008

Arduino for the Butterfly

Just done a first pass of the butterfly version of the arduino12
You can download my files from

Any thoughts or feedback most welcome.

Things you need to do to make it work:

* copy the files & folders into your arduino Hardware directory.

* change preferences.txt to upload.using=butterfly

This preferences file is found in this folder:

* /Users//Library/Arduino/preferences.txt (Mac)
* c:\Documents and Settings\\Application Data\Arduino\preferences.txt (Windows)
* ~/.arduino/preferences.txt (Linux)

* push the button when uploading starts
* dont hold the button down the entire time.

Things to do in the future:
Build a Butterfly library for
- temperature
- flash
- light sensor
- speaker
- Joystick

* check analog pins (jtag port)
* check digital pinouts on port b and D
* check all the timmings
* check it makes sense.


These are things I've done to my files to make it kind of work. They may or may not have been necessary. I tried using conditional compilation but it wasn't being picked up so I just copied the core andmade changes to that.

* added following to boards.txt to support as a target compilation board



* added Bf_boot to bootloaders dir
- copied hex from bf_boot up to bootloaders/bf_boot and renamed bf_boot.hex

* removed second external interupt from hardware/cores/arduino/WInterrupts.c: -> changes not picked up??

* changed boards.txt core = butterfly
- copied arduino core folder and renamed to be buttefly
- changes to hardware/cores/butterfly/WInterrupts.c
- changes to hardware/cores/butterfly/wiring.c TCCR0 - > TCCR0A
- changes to hardware/cores/butterfly/wiring_analog.c: In function 'analogWrite':
- changes to hardware/cores/butterfly/wiring_digital.c: In function 'turnOffPWM':

* added avrispv2 to programmers.txt
* added butterfly to external programmers

Download these files at