Arduino compatible object class for Parallax Propeller

Hi all, I've been putting together some educational bits and pieces for a class that I am planning at a local Maker spot. In the process of doing this I decided to look into Arduino because it is very popular.

I have written a light implementation of the Arduino base SDK for the Parallax Propeller. The intent was to give Arduinites the ability to explore the Propeller with some familiar tools and functions, so you don't have to completely relearn another microcontroller to dabble with it.

This is not a retargeting of the Arduino development environment, it's a class object that implements many of the functions listed in the Arduino online reference.

I refer to it as a light implementation because it doesn't seek to be perfectly compatible or have the same limits as the Arduino SDK. That said, you can do all of the things in the Arduino SDK with native SPIN objects, better, than my compatibility class.

I endeavored to make the SPIN object not require any dedicated COGs, so you can use all of these methods in one COG, giving you 8 simultaneous Arduino light micros.

You can find my class here: http://obex.parallax.com/objects/810/

I have also posted a topic on the Parallax forum describing what functions are available here: http://forums.parallax.com/showthread.php?136273-Announcing-the-release-of-the-Arduino-LIGHT-object

You may wonder why I wanted to write for the Propeller?

Every 5 or 6 years I have explored what was new or the accepted standard in micros. In 2001 I was developing on the 16-bit Hitachi H8/3664 micro in C. In 2006 I tinkered with the Atmel SAM7 ARM mcu, 55Mhz, 55Mips, builtin USB, etc. A few months back I looked into the current lot and found it was really Arduino & Propeller. What drew me to the Propeller was the on-chip hardware to generate video signals. Each COG can generate a video signal independently. Also, aside from the counters, there isn't any fiddly subsystems to have to figure out by reading a cryptic datasheet that's 300 pages, 15 times. All peripherals are implemented in software, relying on the speed of the micro to implement serial, SPI, and just about any other protocol you could want. The Propeller chip is $8, is available as a 40-pin DIP, only needs an EEPROM and crystal, and is 160MIPS.

What you are doing sounds interesting. Sounds like it has potential. One thing, I think you need to add the word compatible to the Arduino Light name because "Arduino" is a trade mark.

I wrote/ported a demo for the Propeller that plays tunes using the Arduino_light object I wrote. I found a program that plays RTTL songs and ported it to the Propeller. The original program is at http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1253920105 and the SPIN version is http://obex.parallax.com/objects/download/aux/168/

This demo program will run directly on the Parallax Propeller Quickstart board that RadioShack sells. You simply wire a little giftcard speaker between pins 16 and 17 of the header (count 0-2-4-6-8-10-12-14-16 from the left where the USB plugs in).

I thought this would be an educational bit of code that would illustrate the similarities and differences between SPIN and C.

Beware, you might annoy other family members if you let it run continuously, since it plays all songs in a loop.

I added another demo that uses the Arduino_light object to play a WAV file. The demo takes each 8 bit sample and stuffs it directly into analogWrite() to produce a digitized output. The demo is here http://obex.parallax.com/objects/download/aux/169/

It is a short sample 8bit 8Khz unsigned PCM RAW of Arnold in Terminator saying "I'll be back".

This isn't really new, but it is just something to get people excited and is something to start with to do even neater things (like 16 Arnolds chattering away?).