Forgive me for converting Arduino into a verb, but I think this is actually acknowledging an existing fact: Arduino has evolved into an action rather than a thing.

It seems to me that Arduino started out applying the Wiring IDE, libraries and simplification of C syntax to a specific hardware platform with 14 Digital I/O and 6 Analog I/O pins. There seems to be a movement to retain the Arduino-ness of a device while moving to different pin numbers, such as talk of an ATmega644 or Xmega Arduino.

Personally, I think that this transition has the potential of either destroying the core value of the Arduino brand, or cementing is as the best way to get started with physical computing. I hope to be able to participate in this process by porting everything Arduino to the AVR Butterfly platform. But, I am very new with the Arduino, so I will need guidance.

[size=12]What you lose by using an AVR Butterfly[/size] Most of the available Butterfly pins are multipurpose so if you want to use them one way, you lose the ability to use them another way (see Butterfly Alternate Pin Use in the download menu of www.smileymicros.com).

For instance, the digital I/O pins on Port D which conform to Arduino pins 0 to 7 are available on the Butterfly for general purpose I/O on a 10 pin dual row pad (8 signal, 1 Vcc, 1 Gnd), but these lines are also used for LCD pins 9,11-16,18 so if you use them for digital I/O you will see the pin state reflected in those LCD elements. This probably won't hurt anything since LCDs use very little current, they won't affect the I/O for the alternate use. There is some concern that the LCD may be damaged if you keep a DC voltage on them for too long, but in my experience (and I have a lot with these things) I have yet to see any damage occur. Then again, I've never plugged one of these pins into a wall socket, something I'm sure some newbie will try.

Also, in order to get 14 digital I/O pins, it will be necessary to re-map Arduino pins 12 and 13 to Port E where we have pins 4,5,6 available.

Finally, we lose 2 of the 6 Analog pins.

[size=12]What we gain by using the AVR Butterfly[/size]We gain three Analog pins that are connected to sensors: a resister divider for measuring voltage, a NTC resistor for measuring temperature, and a light dependent resistor for measuring light. The latter can be left off the board and the pad can be used to replace one of the two analog pins we lost above.

We gain the 5-way joystick button and a piezo speaker (both at the expense of re-mapping pins form Port B to Port E).

We gain the LCD with the caveat that we can only use it if we are willing to sacrifice 8 of the 15 digital I/O pins in order to be able to use the LCD.

We gain a real-time-clock since we have a 32.768 kHz crystal that is used for calibrating the internal oscillator and can be used for accurate counting of seconds. [size=12]What needs to be done.[/size]A Butterfly-Arduino library should be written to allow Arduino-style use of the LCD, joystick, speaker, sensors, and real-time-clock.

Investigate the clock speed to conform to Arduino. I'm not sure how easy it is to adjust Arduiono libraries for clock speeds other than 16 MHz, nor do I know off the top of my head how to adjust the Butterfly to run at 16 MHz which at first glance I think should be doable, but I'll have to dig a bit to see how.[edit]The ATmega169 in the Butterfly can be calibrated to 8 MHz, so I'll need to figure out how to make the Arduino libraries work at lower clock speeds.[/edit]

If it is possible to Arduino-ize the Butterfly, then I need to learn more about how to get this chimera approved by the owners of the Arduino imprimatur. I would like early information on this process since I was already well on my way to creating something similar and if what I am doing is not actually Arduino-able then I should get back on that track and not waste anymore time here.

Oh, and I promise that even though my last name is Pardue, I will not to call this thing Parduino.

There are several Ardunio variants that operate at 8MHz. In theory, you can use pretty much any clock speed with quite minor modifcations. Whether sketchs will will depends on how much they stick to the arduino APIs, and how much they make assumptions.

Are there existing libraries for the Butterfly's actual peripherals that an Arduino-like library should be compatible with?

I'm still tinkering under the hood of Arduino and at this point I have a pile of blackened oily parts laying about the garage floor and I'm hoping I can remember what goes where when I reassemble the thing. I'll probably drill all the way down into Processing before I allow that I understand the underlying infrastructure enough to trust that I know what I'm doing, so this may take a while. A lot of what I am seeing looks simple enough, but there are still some WTFs that I have to figure out before I feel confident.

I'm not sure about the libraries yet. I, of course, intend to use what is already available, but I think I'll have to build my own for the Butterfly LCD since it is a weirdly custom job and probably something for the joystick, the piezo speaker, and the voltage, temperature, and light sensors.

You might want to take a look at the Arduino Libraries for the Orangutan and 3pi Robot and follow the development discussion for them in past forum posts. I see the situations as being similar--adapting an existing board to work within the Arduino environment.

Funny, I was just following Smiley's guide to using the Butterfly as a development platform and got the idea to go looking for Arduino stuff for the Butterfly, and what do I find? Here he is again, doing the work for me. Cool!

Guess I'll have to fight with C for a while longer. In the meantime, I sure hope this project works out, I'd love to use it!

Make an 'ardorfly' sounds like a really good plan. I've bought a butterfly, and had a good time building a coolwire halloween display using the butterfly carrier, but my new arduino is a lot easier to program.

It looks pretty straight forward, though that does not imply that I think it is the right thing to do. Smiley is right in that multiple chip support can fracture the community.

I think the 169 is similar enough to the 168 that they can play well together, no through hole option though but a pre-assembled butterfly makes a real nice beginners package.

The 644 however adds so many pins and functions that don't benefit the 168 core that I don't see that fully integrating with the IDE without costing the beginners some headache as they wade through arduino.cc with article after article about this one specific chip and what it can do, when it does not even apply to their hardware.

Of course if you make it easy to use a butterfly, then you make assumptions about what accessories are at which port addresses. Which is awesome for beginners with a butterfly, but alienates the blink crowd as they wade through arduino article after article about temperature readings and piezo sound notes based on the butterfly addresses.

But I definitely like the concept of a "standard computing device", with a display of known capacity and some buttons at known port addresses. I've seen a few 168 based ones but the 169 built in lcd controller is nice and low power is a cool angle.

Really what I'm after right now is just a quick hack to get the Arduino stuff loading to and running on the Butterfly, regardless of what libraries end up working. I'm so fed up with the usual open source tool chains and libraries that I just want the simplicity of Arduino. I want to write programs, not infrastructure.

Since the fanciest controller I've got beside the butterfly is a 2313, if I'm going to do it its going to be the butterfly.

At the moment I'm not sure what to do about getting the Arduino IDE talking to the butterfly. avrdude reports an error 'not in sync: resp=03f'. Guess I'll have to chase that down today.

well, if you can get some c working with gcc and avrdude from the command line then you are pretty much there. But it is fundamentally an infrastructure change to introduce the butterfly to arduino, so you kinda have to expect some infrastructure discussion before we can talk about how to program it.

Like I don't know if the butterfly bootloader is compatible with arduino even, or if all the registers/ports have the same names or anything.

But it looks like it is well integrated with avrstudio (which is a nice IDE btw), have you looks at that at all if you are in a hurry?

I'm currently using AVRStudio with WinAVR and am compiling to the Butterfly using the AVRStudio's 'AVR Prog' (which mysteriously cannot see the Butterfly on the serial port on every other attempt). Still working out how to get the clock and timers to do what I want.

I've also got AVRDUDE working on Ubuntu with my ancient parallel port STK200 AVRISP dongle (which involved fabricating a 10-pin to 6 pin adapter ). This was necessary to reload the Butterfly bootloader and fix the 0x940c issue (thanks to Smiley and others who worked that out)).

Now I'm just working with the GCC'd version of the Butterfly software to extend it to what I want, which works, but it's a lot more fiddly than Arduino coding. It's like it's missing some software layers that make it reasonable to use libraries, which is very flexible, but not, IMO, as much fun.

Anyway, to get back to the topic at hand, I suppose a first step would be to check out the bootloader requirements and get the Arduino IDE talking to the Butterfly.

looks like an interesting board. I am thinking of ordering one to play with. The xtal is slow. I would guess that a modification to the bootloader would be required to use the internal 8mhz clock (no xtal required). I believe some of the existing off-beat arduino boards are 8mhz with no external crystal. I would suggest try loading their bootloader onto the butterfly to see if it works.

If is does, a new config file could be created to support it properly.

I see the mouser has some. Lets see if they arrive before xmas...

EDIT:

I have ordered 3 of these. I plan on making a library for this board because it could be a good teaching tool. I envision an arduino library with all of the PINS defined with nice names like "Speaker1" and create a few functions like Sound(), Light(), Temperature(), LCD() to make it easy. I am assuming that I can get a bootloader running in the unit since we can get even a barebones ATMEL running with the bootloader. I'll work on it over the xmas break (school is out in a week).

These are things I've done in the files to make it kind of work. They may or may not be necessary.I tried using conditional compilation but I 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

The xtal is slow. I would guess that a modification to the bootloader would be required to use the internal 8mhz clock

I'm not sure what you mean. The default Butterfly software uses the Mega's clock prescaler to divide the 8MHz clock down to 1MHz, and then uses the Butterfly's 32kHz RTC crystal to calibrate the clock and set the OSCCAL bits.

If you want the 8MHz clock (or something else) you can change the clock prescaling and tweak the OSCCAL bits to get what you want. When using AVR Studio this is something I do as part of the setup for a program. Not sure how this fits in with the Arduino stuff, but I assume it can be done just as easily.

The bootloader that comes on the Butterfly has certain assumptions built in that might not be ideal for use with Arduino, but I suppose it would be simplest to try to keep it. Replacing it would make it more complicated to use off-the-shelf Butterflys, since it requires an ISP cable to reprogram the bootloader.

Great to see that this is progressing! My only Butterfly is currently occupied doing something else right now, or I'd give Nick's updates a try. Maybe I can do that over the holiday break.