Eight 32-Bit Cores Take Flight In Multiprocessor Microcontroller

April 13, 2006
New processor architectures are rare, especially in the microcontroller arena. But Parallax created a chip that could rotate right into your next application. The Parallax Propeller consists of eight identical RISC-style processing units call

New processor architectures are rare, especially in the microcontroller arena. But Parallax created a chip that could rotate right into your next application. The Parallax Propeller consists of eight identical RISC-style processing units called cogs (see the figure).

The chip runs on 80 MHz, but it only consumes 75 mA with all cogs running. If you cut back to one cog using the internal clock at 20 kHz, the power drain drops to the 3-µA range.

Each cog can access all of the 32 I/O pins. Usually, though, an application running on a cog will use only a few pins. A typical example of a cog application is a full-duplex serial port interface that would utilize two pins. Hardware flow control adds two pins. Want two serial ports? Fire up another cog.

A COG IN THE MACHINE This chip takes a new approach to running code in multiprocessing applications. To start up another cog, you just specify what routine to begin executing, or the address of an assembly program, and it automatically loads up and begins executing code internally. The cog can later shut itself off so that it can be reused for some other purpose.

Code can be run on a specific cog. Generally, though, the next idle cog is used instead, because each cog is identical and has the same access to memory and I/O pins. A cog needs to be identified so that another cog can start or stop it, although most communication is completed using the shared system memory.

Access to the shared resources— memory, semaphore bits, and other cogs—is provided in round-robin style, with each cog getting one time slot. This makes system access significantly slower than access to local cog memory, but it simplifies the architecture. The Propeller contains a single memory for code and data.

Self-modifying code is an option. This tends to be less of an issue given the limited memory size. Code modules are likely to be small and concise. In fact, tight coding will be the norm. There's no hardware stack support, but a co-routine switch instruction allows a stack to be implemented in software if necessary.

TAKING A COG FOR A SPIN Don't take off your propeller hat yet. This chip takes a two-level approach to programs.

Spin, a Basic-like programming language with recursion, is executed by a Spin interpreter program that runs in a cog. Spin code resides in shared memory, so Spin runs slower (60 KIPS) than cog code (20 MIPS). Spin applications handle the high-level portion of the application, with cog code handling peripheral control.

Spin isn't multithreaded, but multiple Spin interpreters can be run on different cogs. By default, a Spin interpreter runs on a cog when the chip starts up. Actually, the startup process is a bit more complicated, since the ROM contains a boot loader. Application code and data can be automatically loaded into system RAM via a serial EEPROM or serial port.

Parallax supplies its own development tools designed to handle a mixture of cog and Spin code. The development environment is both polished and rough—its debugging features could use some work. Still, the integrated development environment contains neat features like automatic code documentation support. The hardware architecture and software environment is different enough so that even experienced developers will need to stop and think—and that's a good thing.

The Propeller can perform some surprising tasks, like drive a VGA display from software. It also takes applications like motor control to a new level. Ultimately, though, a new mindset is necessary to take advantage of the architecture.

A low-cost, USB-based dev kit is available for the Propeller. Also, the board contains its own serial EEPROM. Time to fly!

Parallax
www.parallax.com

See the table

About the Author

William G. Wong | Senior Content Director - Electronic Design and Microwaves & RF

I am Editor of Electronic Design focusing on embedded, software, and systems. As Senior Content Director, I also manage Microwaves & RF and I work with a great team of editors to provide engineers, programmers, developers and technical managers with interesting and useful articles and videos on a regular basis. Check out our free newsletters to see the latest content.

You can send press releases for new products for possible coverage on the website. I am also interested in receiving contributed articles for publishing on our website. Use our template and send to me along with a signed release form. 

Check out my blog, AltEmbedded on Electronic Design, as well as his latest articles on this site that are listed below. 

You can visit my social media via these links:

I earned a Bachelor of Electrical Engineering at the Georgia Institute of Technology and a Masters in Computer Science from Rutgers University. I still do a bit of programming using everything from C and C++ to Rust and Ada/SPARK. I do a bit of PHP programming for Drupal websites. I have posted a few Drupal modules.  

I still get a hand on software and electronic hardware. Some of this can be found on our Kit Close-Up video series. You can also see me on many of our TechXchange Talk videos. I am interested in a range of projects from robotics to artificial intelligence. 

Sponsored Recommendations

Comments

To join the conversation, and become an exclusive member of Electronic Design, create an account today!