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 http://www.brokentoaster.com/arduino012_butterfly.zip

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
- LCD
- Joystick

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

NOTES:

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
bfly.name=Butterfly

bfly.upload.protocol=butterfly
bfly.upload.maximum_size=14336
bfly.upload.speed=19200

bfly.bootloader.low_fuses=0xE2
bfly.bootloader.high_fuses=0x98
bfly.bootloader.extended_fuses=0xFF
bfly.bootloader.path=butterfly
bfly.bootloader.file=bf_boot.hex
bfly.bootloader.unlock_bits=0x3F
bfly.bootloader.lock_bits=0x0F

bfly.build.mcu=atmega169

* 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 http://www.brokentoaster.com/arduino012_butterfly.zip