propeller - rs componentsdocuments.rs-components.com/eitc/uk/electronics/robotarticle.pdf · called...

3
New chip on the block f you are just getting started in robotics or have been an experi- menter for a while, you have no doubt spent time looking into the many microcontroller products on the market. In May of this year, Parallax added to your options when it released its first custom-designed microcontroller – the Propeller. Up to now, Parallax has used other microcontrollers in its products (see Table 1). Parallax came up with the idea for the Propeller while researching micros for a BASIC STAMP 3 line, and decided to design its own chip that would have capabilities no other chip had. The Propeller is not your run-of-the-mill eight-bit microcon- troller; this chip actually contains eight 32-bit processors (called “cogs”) operating up to 80 MHz at one time! The eight cogs allow for powerful flexibility in performing multiple, intensive tasks simultaneously that previously could not be performed without an advanced system design. This processor is evidence of a new move- ment in performance enhancement – more and more microchips are using simultaneous processing of tasks for speed enhancements instead of simply increasing clock frequency. The hobbyists and engineers who choose to utilize the Propeller for their designs will have to transform their thinking to make the best use of the parallel processing resources that this controller offers. For instance, imagine a robot with the following features: • Wheel encoders, GPS, compass, and accelerometer sensors • Obstacle avoidance sensors (bumpers, range sensors) • Two motors for locomotion • Four servo motors for control of an arm and gripper • Display device for feedback • Serial communication to a host Implementing all these features with a “standard” microcontroller to a satisfactory level of performance is nothing short of a discouraging task. With a single standard microcontroller, an interrupt service routine (ISR) can be employed to handle the time-sensitive tasks, but critical tradeoffs would need to be made in order to determine the priority of tasks to service. Most system designers would break apart the time-sensitive tasks, such as navigation sensors, servo con- trol, or host communication, and dedicate each one to a single stan- dard microcontroller. The microcontrollers would share a bus, and the designer would set up a communication protocol for sharing information among the controllers. With the Propeller, the ability to implement multiple functions simultaneously and easily in one piece of silicon is finally within the grasp of the hobbyist. The Propeller can be categorized as a general-purpose microcon- troller, meaning there are limited peripherals (counters and video geneators but no serial ports, PWM drivers, etc.) built into it. Without the peripherals built in, the user is not limited to designated I/O pins for a function, but is able to choose which pins he wishes to use for his design. Need a serial port? No problem; just choose any of the I/O pins and assign it in software. If you need true RS232 lev- els, add a converter chip. Need a Pulse-Width Modulated signal? Again, no problem; just use any of the I/O pins. According to forum posts, the Propeller has been used to drive up to 32 servos at once! Can you see the power of Propeller yet? GETTING STARTED There are a couple things you need in order to begin developing with the Propeller. The first thing you need is the Propeller Tool. This is the Windows software used for programming the Propeller and is freely distributed through Parallax’s website. Because of the advanced multi-processor design, a new language was developed called Spin. The Propeller can be programmed in Spin, assembly language, or both. Spin is a full-featured, high-level language and is more difficult to learn then PBASIC. One could learn it, however, with practice, patience and diligent reading of the manual. Parallax has obviously developed Spin and the programming interface for quick and efficient coding. For instance, Parallax developed a I 42 ROBOT MAGAZINE Story and photos by Timothy D. Swieter PARALLAX PRODUCT REVIEW Propeller The Propeller Accessories Kit

Upload: duongnga

Post on 27-Mar-2018

220 views

Category:

Documents


5 download

TRANSCRIPT

Page 1: Propeller - RS Componentsdocuments.rs-components.com/EITC/UK/electronics/robotarticle.pdf · called Spin. The Propeller can be programmed in Spin, ... object just about the Propeller

New chip on the blockf you are just getting started in robotics or have been an experi-menter for a while, you have no doubt spent time looking intothe many microcontroller products on the market. In May of

this year, Parallax added to your options when it released its firstcustom-designed microcontroller – the Propeller. Up to now,Parallax has used other microcontrollers in its products (see Table 1).Parallax came up with the idea for the Propeller while researchingmicros for a BASIC STAMP 3 line, and decided to design its ownchip that would have capabilities no other chip had.

The Propeller is not your run-of-the-mill eight-bit microcon-troller; this chip actually contains eight 32-bit processors (called“cogs”) operating up to 80 MHz at one time! The eight cogs allowfor powerful flexibility in performing multiple, intensive taskssimultaneously that previously could not be performed without anadvanced system design. This processor is evidence of a new move-ment in performance enhancement – more and more microchips areusing simultaneous processing of tasks for speed enhancementsinstead of simply increasing clock frequency.

The hobbyists and engineers who choose to utilize the Propellerfor their designs will have to transform their thinking to make thebest use of the parallel processing resources that this controlleroffers. For instance, imagine a robot with the following features:

• Wheel encoders, GPS, compass, and accelerometer sensors• Obstacle avoidance sensors (bumpers, range sensors)• Two motors for locomotion• Four servo motors for control of an arm and gripper • Display device for feedback• Serial communication to a host

Implementing all these features with a “standard” microcontroller toa satisfactory level of performance is nothing short of a discouragingtask. With a single standard microcontroller, an interrupt serviceroutine (ISR) can be employed to handle the time-sensitive tasks, butcritical tradeoffs would need to be made in order to determine thepriority of tasks to service. Most system designers would breakapart the time-sensitive tasks, such as navigation sensors, servo con-trol, or host communication, and dedicate each one to a single stan-dard microcontroller. The microcontrollers would share a bus, andthe designer would set up a communication protocol for sharinginformation among the controllers. With the Propeller, the ability toimplement multiple functions simultaneously and easily in onepiece of silicon is finally within the grasp of the hobbyist.

The Propeller can be categorized as a general-purpose microcon-troller, meaning there are limited peripherals (counters and videogeneators but no serial ports, PWM drivers, etc.) built into it.Without the peripherals built in, the user is not limited to designatedI/O pins for a function, but is able to choose which pins he wishes touse for his design. Need a serial port? No problem; just choose anyof the I/O pins and assign it in software. If you need true RS232 lev-els, add a converter chip. Need a Pulse-Width Modulated signal?Again, no problem; just use any of the I/O pins. According to forumposts, the Propeller has been used to drive up to 32 servos at once!Can you see the power of Propeller yet?

GETTING STARTEDThere are a couple things you need in order to begin developingwith the Propeller. The first thing you need is the Propeller Tool.This is the Windows software used for programming the Propellerand is freely distributed through Parallax’s website. Because of theadvanced multi-processor design, a new language was developedcalled Spin. The Propeller can be programmed in Spin, assemblylanguage, or both. Spin is a full-featured, high-level language and ismore difficult to learn then PBASIC. One could learn it, however,with practice, patience and diligent reading of the manual. Parallaxhas obviously developed Spin and the programming interface forquick and efficient coding. For instance, Parallax developed a

I

42 R O B O T M A G A Z I N E

Story and photos by Timothy D. Swieter

PARALLAX

P R O D U C T R E V I E W

Propeller

The Propeller Accessories Kit

Page 2: Propeller - RS Componentsdocuments.rs-components.com/EITC/UK/electronics/robotarticle.pdf · called Spin. The Propeller can be programmed in Spin, ... object just about the Propeller

TrueType font that includes circuit and signal symbols for drawingdiagrams in your code comments.

COMMUNITY DEVELOPED SOFTWAREAnother great feature of Spin is that it is “object” oriented. Simplyput, development through reuse of code is much easier. For instance,say you want to utilize the TV output of the Demo Board. There is anobject (a small program module) that performs the task of generatingthe proper voltages and timing for TV output. Instead of program-ming the complex routine for handling TV output yourself, simplyuse the methods provided by the object coded by someone else.Likewise, you might create an object that handles a specific motorcontroller or integrated circuit interface. You can provide this to thePropeller community through Parallax’s Object Exchange website.The Object Exchange is a place to post your objects and downloadobjects others have created.

Of course, you will also need the Propeller hardware to developany functional circuits. The chip comes in three different form fac-tors; each one has the same capability, just different packages. Theone that is most accessible to the hobbyists is the 40-pin DIP style.The other two form factors are for surface mount designs and aregreat for projects in which you want to design your own circuitboard. Depending on your project’s design, you will also need anexternal EEPROM for permanent storage of the program and a5MHz crystal to reach the max clock speed of 80 MHz.

PROPSTICKTo get you up to speed fast, Parallax offers two products that containeverything you need to get started. The first one is the PropSTICK.

This is a carrier board capable of plugging into a breadboard so thatyou can add your own prototyping circuits. It contains a 40-pin DIPversion of the Propeller, EEPROM, 5MHz crystal, voltage regulatorand RS232 level converter (for programming). This kit does requireassembly, and I would recommend it to those who like to tinker withthe hardware just as much as they like to write software.

The other option is the Propeller Demo Board (see photo). ThePropeller Demo Board is pre-assembled with hardware for demon-strating the capabilities of the Propeller. The Demo Board is great forthose who want to get started right away or for those who like thesoftware aspect much more than the hardware aspect.

The Demo Board has an FTDI USB/Serial conversion chip andattaches to the development computer with a standard USB cable forprogramming. Also on the Demo Board are the necessary compo-

F A L L 2 0 0 6 43

A Propeller Demo Board with a circuit in the prototyping area

One of the handiest features of the Demo Board is the ground lug (the silverobject just about the Propeller Chip) for attaching a ground probe from anoscilloscope.

Screenshot of the Propeller Tool

Page 3: Propeller - RS Componentsdocuments.rs-components.com/EITC/UK/electronics/robotarticle.pdf · called Spin. The Propeller can be programmed in Spin, ... object just about the Propeller

PARALLAX PROPELLER

44 R O B O T M A G A Z I N E

nents for the experimenter to attachdevices such as a mouse, keyboard,VGA monitor, TV and headphones.Other devices on the board include amicrophone, eight LEDs, voltage reg-ulators and a small breadboard foryour own experiments with the eightfree I/O pins.

The USB attachment for program-ming the Demo Board was a gooddesign choice because the serial porton computers is becoming a thing ofthe past. The board ships with agraphics and mouse demo programpreloaded (the program file is alsoinstalled with the Propeller Tool). Tocomplement the Demo Board,Parallax also sells mice, keyboards,and 2.5-inch LCD video displays. Theentry price for getting started withthe Propeller is reasonable. The chips can be purchased for $25each, the PropSTICK costs $79.95, and the Demo Board goesfor $129.95. All products can be purchased from Parallax’swebsite.

FIRST IMPRESSIONSWOW! The first thing I did when I received the Demo Board waspower it up and check out the graphics demo. Granted, thePropeller is no NVIDIA chip, but to think this small microcon-troller has enough power to generate the graphics demo and stillhave several cogs left over for other functions was amazing. Thismade me so excited I immediately dove right into learning Spin.I started by working through the example files found online.Many of the “getting started” samples are well documented toexplain how the code works. In addition, there are examples andtips found in the manual for each of the Spin commands.Unfortunately (for some), the assembly language portion of themanual is not completed yet at the time of writing this review,but a document called “Core Doc.pdf” is installed with thePropeller Tool, and it provides basic information to get you start-ed in understanding the lower-level workings of the chip. I amsure you can imagine the amount of time and effort it takes todocument a whole new hardware design and software language.

From my experience, Parallax has excellent customer serviceand technical support. While using the Propeller for my ownexperiments, I found the documentation useful. The Parallax

forums are an invaluable resourcebecause of the heavy moderation byParallax employees. Even ChipGracey, the inventor of the Propellerand founder of Parallax, posts in theforum. Talk about the ultimate techsupport! The forum is the first place togo for help as it is very active. Manytopics are discussed, from interfacingwith the hardware to understandingSpin and assembly language.

One drawback for some people isthat the Propeller operates on 3.3VDC(CMOS construction). Many of cir-cuits, hardware, and products current-ly available to the hobbyist operatewith 5VDC (TTL construction). Thisproblem is easily overcome, however.TTL circuits can be interfaced with thePropeller with the addition of a 1K

resistor to limit the current between the TTL output and thePropeller’s input. To output to a TTL circuit, use a voltage levelconverter chip such as the commonly available 4504. Check yourdevice’s datasheet to determine if its logic level threshold volt-ages will work with the Propeller.

CONCLUSIONIt has been a pleasure so far learning Spin and investigating thePropeller’s capabilities. The bottom line is that the Propellerrepresents the next step in the evolution of microcontrollers. Ifyou are considering learning a new microcontroller or have achallenging new robot project in mind, I recommend checkingout the Propeller. When dreaming up applications for thePropeller, I have to remind myself constantly to think bigger,because this chip is much more powerful than the controllers Iused to work with. I am excited about utilizing the capabilitiesof the Propeller for future applications! This microcontrollerwill not only appeal to the hobbyist, but engineers may consid-er it for their designs that require the computing power thatonly the Propeller provides. Keep dreaming, keep inventing,and keep having fun.

LinksParallax, www.parallax.com, (888) 512-1024

For more information, please see our source guide on pg. 97.

A blue LED flashes, letting you know that a dataexchange is occurring between the PC and the DemoBoard.

PARALLAX’S MICROSProduct Propeller Javelin Stamp SX Chip Basic Stamp

P8X32A-D40 JS1-IC SX48BD BS2p24-IC

Pacakge 40-pin DIP 24-pin DIP 48-pin TQFP 24-pin DIP

I/O Pins 32 16 36 16 + 2 dedicated serial

Max Clock Freq. 80 MHz. 25 MHz. 75 MHz. 20 MHz.

Program Execution Speed up to 20 MIPS (per COG) up to 12,000 IPS up to 75 MIPS up to 8500 IPS

RAM Size 32K bytes - Global 32K bytes 262 bytes 38 bytes

Voltage Requirements 3.3 VDC 5 - 24 VDC 4.5 - 5.5 VDC 5 - 12 VDC

Notes 8 Processors Uses SX Chip as core Uses SX Chip as core

* Note: Parallax produces several varieties for several of the products above; check Parallax’s website formore detailed comparisons of each product’s capabilities.