Update, Sept 27, 2010: My hardware abstraction layer has become part of the official Firmata 2.2 release, which is now included in Arduino 0019.

I also wrote a "firmata_test" program. This stand-alone program makes testing Firmata 2.2 on your board much easier.

 

 


Most of the development informtation below this line is outdated or obsolete.

 

Glad you're interested in helping test the Firmata hardware abstractions. Here are some instructions.

The permanent page for Firmata for Teensy is:

http://www.pjrc.com/teensy/td_libs_Firmata.html

This should compile and run on Arduino Mega(**) and all Teensy boards. A set of compiled images for all Teensy boards are available, so you can just put it on your Teensy using the Teensy Loader, without needing to use the Arduino IDE at all. If you're using Arduino Mega, you'll need to replace the Firmata directory withing your Arduino software with the source version.

(note: this applies to Arduino 0018 and earlier... eventually this code is expected to become part of the official Firmata distribution........ after it's been well tested)

Update, July 20, 2010: This code has been merged into Firmata's svn trunk, and other new developments are being added. For the latest code, please get a fresh checkout from Firmata's svn.

To use it from Pd, you'll need a recent copy of Pduino. Here is a modified copy named Pduino-0.5beta6-mega.zip . This is the same as the original, but it includes "mega-test.pd", which is modified to show all 16 analog inputs and I added boxes so you can enable them.

There are still lots of limits in mega-test.pd, and if you are good with Puredata, it would be incredibly helpful if you could expand it. For example, inside the "sending digital outs", there is code which assumes only the first few ports are implemented, so it doesn't pulse all the pins on a Teensy++ or Arduino Mega. Likewise, for reading digital inputs, there are currently only boxes to enable the first 3 ports (24 pins), and only boxes to show input port bits 2 to 13. If you have time to edit this, expanding those to more pins would be most excellent.

Likewise, there is a 24x5 grid (orange) in the upper right that controls the mode of each pin. This only lets you control pins 2 to 23, so pins 0-1 and 24+ stay in their default mode.

You MUST SET THE MODE correctly before a pin will work with the controls for that mode, and for inputs, reporting needs to be enabled. The big orange box does not necessarily initialize to a state that reflects the actual configuration on your board, which can be very confusing when you're trying to get input from pin 6, for example, and you've enabled reporting on port 0. Until you actually click the pin modes in that orange box, it's only random chance if the setting shown in the box actually matches the setting on your board. At least I found this confusing.....

There are other ways to communicate with Firmata, and if you can try any, please do! So far I've only done testing with this modified Pduino.

Eventually this hardware abstraction may become part of Firmata. What's really, really needed is feedback from you! Does it work? If there's bugs, I need to be able to reproduce them so I can fix them.

 

-Paul
paul@pjrc.com

 

 

ps: a bug in Pduino was discovered where 2 (or more?) input pins on the same 8 bit port changing at the same instant will not be properly parsed by Pduino (only 1 will update in Pduino). This bug exists on the PC side, not in Firmata. Hopefully it will be fixed soon. The code above definitely has this bug.  

 

(**) Arduino 0017 has a known bug with analog inputs 8 to 15. If you haven't already applied a fix, here is the page with details and instructions: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1250970792