Parallax Propeller Owner's manual

  • Hello! I'm your chat assistant, and I've analyzed the Propeller chip user manual. I'm familiar with its contents, including chip specifications, hardware connections, and programming languages like Spin and Assembly. I'm ready to answer your questions about the Propeller chip and how to use all of its features!
  • What is the warranty period for Propeller products?
    What is the money-back guarantee period for this product?
    Where can I find discussion forums about Propeller products?
Propeller Manual
Version 1.2
WARRANTY
Parallax Inc., dba Parallax Semiconductor, warrants its products against defects in materials and workmanship for a period of 90
days from receipt of product. If you discover a defect, Parallax Inc. will, at its option, repair or replace the merchandise, or
refund the purchase price. Before returning the product to Parallax, call for a Return Merchandise Authorization (RMA)
number. Write the RMA number on the outside of the box used to return the merchandise to Parallax. Please enclose the
following along with the returned merchandise: your name, telephone number, shipping address, and a description of the
problem. Parallax will return your product or its replacement using the same shipping method used to ship the product to
Parallax.
14-DAY MONEY BACK GUARANTEE
If, within 14 days of having received your product, you find that it does not suit your needs, you may return it for a full refund.
Parallax Inc. will refund the purchase price of the product, excluding shipping/handling costs. This guarantee is void if the
product has been altered or damaged. See the Warranty section above for instructions on returning a product to Parallax Inc.
COPYRIGHTS AND TRADEMARKS
This documentation is copyright © 2006-2011 by Parallax Inc., dba Parallax Semiconductor. By downloading or obtaining a
printed copy of this documentation or software you agree that it is to be used exclusively with Parallax products. Any other uses
are not permitted and may represent a violation of Parallax copyrights, legally punishable according to Federal copyright or
intellectual property laws. Any duplication of this documentation for commercial uses is expressly prohibited by Parallax Inc.
Duplication for educational use is permitted, subject to the following Conditions of Duplication: Parallax Inc. grants the user a
conditional right to download, duplicate, and distribute this text without Parallax's permission. This right is based on the
following conditions: the text, or any portion thereof, may not be duplicated for commercial use; it may be duplicated only for
educational purposes when used solely in conjunction with Parallax products, and the user may recover from the student only the
cost of duplication.
This text is available in printed format from Parallax Inc. Because we print the text in volume, the consumer price is often less
than typical retail duplication charges.
Parallax, Propeller Spin, and the Parallax and Propeller Hat logos are trademarks of Parallax Inc. BASIC Stamp, Stamps in
Class, Boe-Bot, SumoBot, Toddler, and SX-Key are registered trademarks of Parallax, Inc. If you decide to use any trademarks
of Parallax Inc. on your web page or in printed material, you must state that (trademark) is a (registered) trademark of Parallax
Inc.” upon the first appearance of the trademark name in each printed document or web page. Other brand and product names
herein are trademarks or registered trademarks of their respective holders.
ISBN 9781928982593
1.2.0-11.06.14-CWR
DISCLAIMER OF LIABILITY
Parallax, Inc., dba Parallax Semiconductor, makes no warranty, representation or guarantee regarding the suitability of its
products for any particular purpose, nor does Parallax, Inc., dba Parallax Semiconductor, assume any liability arising out of the
application or use of any product, and specifically disclaims any and all liability, including without limitation consequential or
incidental damages even if Parallax, Inc., dba Parallax Semiconductor, has been advised of the possibility of such damages.
INTERNET DISCUSSION LISTS
We maintain active web-based discussion forums for people interested in Parallax Propeller products. These forums are
accessible at forums.parallax.com:
Propeller chip – For all customers using Propeller chips and products.
Parallax Semicondutor – For commercial product developers who use Propeller chips.
BASIC Stamp – This list is widely utilized by engineers, hobbyists and students who share their BASIC Stamp
projects and ask questions.
Stamps in Class® – Created for educators and students, subscribers discuss the use of the Stamps in Class series
of tutorials in their courses. The list provides an opportunity for both students and educators to ask questions
and get answers.
HYDRA – for enthusiasts of the Propeller-powered HYDRA videogame development system.
Parallax Educators – A private forum exclusively for educators and those who contribute to the development of
Stamps in Class. Parallax created this group to obtain feedback on our curricula and to provide a place for
educators to develop and obtain Teacher’s Guides.
Robotics – Designed for Parallax robots, this forum is intended to be an open dialogue for robotics enthusiasts.
Topics include assembly, source code, expansion, and manual updates. The Boe-Bot®, Toddler®, SumoBot®,
HexCrawler and QuadCrawler robots are discussed here.
SX Microcontrollers and SX-Key – Discussion of programming the SX microcontroller with Parallax assembly
language SX – Key® tools and 3rd party BASIC and C compilers.
Javelin Stamp – Discussion of application and design using the Javelin Stamp, a Parallax module that is
programmed using a subset of Sun Microsystems’ Java® programming language.
ERRATA
While great effort is made to assure the accuracy of our texts, errors may still exist. If you find an error, please let us know by
sending an email to editor@parallax.com. We continually strive to improve all of our educational materials and documentation,
and frequently revise our texts. Occasionally, an errata sheet with a list of known errors and corrections for a given text will be
posted to our web site, www.parallax.com. Please check the individual product page’s free downloads for an errata file.
SUPPORTED HARDWARE AND FIRMWARE
This manual is valid with the following hardware and firmware versions:
Hardware Firmware
P8X32A-D40
P8X32A-Q44
P8X32A-M44
P8X32A v1.0
CREDITS
Authorship: Jeff Martin. Format & Editing, Stephanie Lindsay.
Cover Art: Jen Jacobs; Technical Graphics: Rich Allred; with many thanks to everyone at Parallax Inc.
Table of Contents
PREFACE ............................................................................................................................... 11
CHAPTER 1 : INTRODUCING THE PROPELLER CHIP....................................................... 13
CONCEPT ............................................................................................................................. 13
PACKAGE TYPES ................................................................................................................... 14
PIN DESCRIPTIONS................................................................................................................ 15
SPECIFICATIONS ................................................................................................................... 16
HARDWARE CONNECTIONS .................................................................................................... 17
BOOT UP PROCEDURE .......................................................................................................... 18
RUN-TIME PROCEDURE ......................................................................................................... 18
SHUTDOWN PROCEDURE....................................................................................................... 19
BLOCK DIAGRAM ................................................................................................................... 20
SHARED RESOURCES............................................................................................................ 22
SYSTEM CLOCK .................................................................................................................... 22
COGS (PROCESSORS) ........................................................................................................... 22
HUB ..................................................................................................................................... 24
I/O PINS ............................................................................................................................... 26
SYSTEM COUNTER ................................................................................................................ 27
CLK REGISTER ..................................................................................................................... 28
LOCKS .................................................................................................................................. 30
MAIN MEMORY...................................................................................................................... 30
MAIN RAM ........................................................................................................................... 31
MAIN ROM........................................................................................................................... 32
CHARACTER DEFINITIONS ...................................................................................................... 32
LOG AND ANTI-LOG TABLES................................................................................................... 34
SINE TABLE .......................................................................................................................... 34
BOOT LOADER AND SPIN INTERPRETER.................................................................................. 34
CHAPTER 2 : SPIN LANGUAGE REFERENCE .................................................................... 35
STRUCTURE OF PROPELLER OBJECTS/SPIN ........................................................................... 36
CATEGORICAL LISTING OF PROPELLER SPIN LANGUAGE ......................................................... 38
Block Designators........................................................................................................... 38
Configuration .................................................................................................................. 38
Cog Control .................................................................................................................... 39
Process Control.............................................................................................................. 39
Flow Control ................................................................................................................... 39
Memory........................................................................................................................... 40
Directives........................................................................................................................ 41
Registers ........................................................................................................................ 41
Constants .......................................................................................................................42
Variable .......................................................................................................................... 42
Unary Operators............................................................................................................. 42
Binary Operators ............................................................................................................ 43
Propeller Manual v1.2 · Page 5
Table of Contents
Syntax Symbols ..............................................................................................................44
SPIN LANGUAGE ELEMENTS ...................................................................................................45
Symbol Rules..................................................................................................................45
Value Representations....................................................................................................45
Syntax Definitions ...........................................................................................................46
ABORT....................................................................................................................................47
BYTE .....................................................................................................................................51
BYTEFILL ..............................................................................................................................57
BYTEMOVE ..............................................................................................................................58
CASE .....................................................................................................................................59
CHIPVER ................................................................................................................................62
CLKFREQ ................................................................................................................................63
_CLKFREQ ..............................................................................................................................65
CLKMODE ................................................................................................................................67
_CLKMODE ..............................................................................................................................68
CLKSET..................................................................................................................................71
CNT .......................................................................................................................................73
COGID....................................................................................................................................75
COGINIT ................................................................................................................................76
COGNEW..................................................................................................................................78
COGSTOP ................................................................................................................................83
CON .......................................................................................................................................84
CONSTANT ..............................................................................................................................91
CONSTANTS (PRE-DEFINED) ...................................................................................................93
CTRA, CTRB...........................................................................................................................95
DAT .......................................................................................................................................99
DIRA, DIRB.........................................................................................................................104
FILE ...................................................................................................................................107
FLOAT..................................................................................................................................108
_FREE..................................................................................................................................110
FRQA, FRQB.........................................................................................................................111
IF .......................................................................................................................................112
IFNOT..................................................................................................................................117
INA, INB ............................................................................................................................118
LOCKCLR ..............................................................................................................................120
LOCKNEW ..............................................................................................................................122
LOCKRET ..............................................................................................................................125
LOCKSET ..............................................................................................................................126
LONG ...................................................................................................................................128
LONGFILL ............................................................................................................................134
LONGMOVE ............................................................................................................................135
LOOKDOWN, LOOKDOWNZ.........................................................................................................136
LOOKUP, LOOKUPZ................................................................................................................138
Page 6 · Propeller Manual v1.2
Table of Contents
NEXT................................................................................................................................... 140
OBJ..................................................................................................................................... 141
OPERATORS ....................................................................................................................... 143
OUTA, OUTB ........................................................................................................................ 175
PAR..................................................................................................................................... 178
PHSA, PHSB ........................................................................................................................ 180
PRI..................................................................................................................................... 181
PUB..................................................................................................................................... 182
QUIT................................................................................................................................... 186
REBOOT ............................................................................................................................... 187
REPEAT ............................................................................................................................... 188
RESULT ............................................................................................................................... 194
RETURN ............................................................................................................................... 196
ROUND ................................................................................................................................. 198
SPR..................................................................................................................................... 200
_STACK ............................................................................................................................... 202
STRCOMP ............................................................................................................................. 203
STRING ............................................................................................................................... 205
STRSIZE ............................................................................................................................. 206
SYMBOLS............................................................................................................................ 207
TRUNC ................................................................................................................................. 209
VAR..................................................................................................................................... 210
VCFG................................................................................................................................... 213
VSCL................................................................................................................................... 216
WAITCNT ............................................................................................................................. 218
WAITPEQ ............................................................................................................................. 222
WAITPNE ............................................................................................................................. 224
WAITVID ............................................................................................................................. 225
WORD................................................................................................................................... 227
WORDFILL............................................................................................................................ 234
WORDMOVE............................................................................................................................ 235
_XINFREQ............................................................................................................................ 236
CHAPTER 3 : ASSEMBLY LANGUAGE REFERENCE ....................................................... 238
THE STRUCTURE OF PROPELLER ASSEMBLY ........................................................................ 238
Cog Memory ................................................................................................................. 240
Where Does an Instruction Get Its Data? .................................................................... 240
Don't Forget the Literal Indicator '#'.............................................................................. 241
Literals Must Fit in 9 Bits .............................................................................................. 241
Global and Local Labels............................................................................................... 242
CATEGORICAL LISTING OF PROPELLER ASSEMBLY LANGUAGE............................................... 243
Directives...................................................................................................................... 243
Configuration ................................................................................................................ 243
Propeller Manual v1.2 · Page 7
Table of Contents
Cog Control...................................................................................................................243
Process Control ............................................................................................................243
Conditions .....................................................................................................................243
Flow Control..................................................................................................................245
Effects ...........................................................................................................................245
Main Memory Access....................................................................................................245
Common Operations.....................................................................................................245
Constants......................................................................................................................247
Registers.......................................................................................................................248
Unary Operators ...........................................................................................................248
Binary Operators...........................................................................................................249
ASSEMBLY LANGUAGE ELEMENTS ........................................................................................250
Syntax Definitions .........................................................................................................250
Opcodes and Opcode Tables .......................................................................................251
Concise Truth Tables....................................................................................................252
Propeller Assembly Instruction Master Table ...............................................................253
ABS .....................................................................................................................................257
ABSNEG................................................................................................................................258
ADD .....................................................................................................................................259
ADDABS................................................................................................................................260
ADDS ...................................................................................................................................261
ADDSX..................................................................................................................................262
ADDX ...................................................................................................................................264
AND .....................................................................................................................................266
ANDN ...................................................................................................................................267
CALL ...................................................................................................................................268
CLKSET................................................................................................................................271
CMP .....................................................................................................................................272
CMPS ...................................................................................................................................274
CMPSUB................................................................................................................................276
CMPSX..................................................................................................................................277
CMPX ...................................................................................................................................280
CNT .....................................................................................................................................282
COGID..................................................................................................................................283
COGINIT ..............................................................................................................................284
COGSTOP ..............................................................................................................................286
CONDITIONS ( IF_X ) ............................................................................................................287
CTRA, CTRB.........................................................................................................................288
DIRA, DIRB.........................................................................................................................289
DJNZ ...................................................................................................................................290
EFFECTS ( WC, WZ, WR, NR ) ....................................................................................................291
FIT .....................................................................................................................................292
FRQA, FRQB.........................................................................................................................293
Page 8 · Propeller Manual v1.2
Table of Contents
HUBOP ................................................................................................................................. 294
IF_X (CONDITIONS)............................................................................................................. 295
INA, INB ............................................................................................................................ 297
JMP..................................................................................................................................... 298
JMPRET ............................................................................................................................... 300
LOCKCLR ............................................................................................................................. 303
LOCKNEW ............................................................................................................................. 304
LOCKRET ............................................................................................................................. 305
LOCKSET ............................................................................................................................. 306
MAX..................................................................................................................................... 307
MAXS................................................................................................................................... 308
MIN..................................................................................................................................... 309
MINS................................................................................................................................... 310
MOV..................................................................................................................................... 311
MOVD................................................................................................................................... 312
MOVI................................................................................................................................... 313
MOVS................................................................................................................................... 314
MUXC................................................................................................................................... 315
MUXNC ................................................................................................................................. 316
MUXNZ ................................................................................................................................. 317
MUXZ................................................................................................................................... 318
NEG..................................................................................................................................... 319
NEGC................................................................................................................................... 320
NEGNC ................................................................................................................................. 321
NEGNZ ................................................................................................................................. 322
NEGZ................................................................................................................................... 323
NOP..................................................................................................................................... 324
NR ...................................................................................................................................... 325
OPERATORS ....................................................................................................................... 326
OR ...................................................................................................................................... 327
ORG..................................................................................................................................... 328
OUTA, OUTB ........................................................................................................................ 330
PAR..................................................................................................................................... 331
PHSA, PHSB ........................................................................................................................ 332
RCL..................................................................................................................................... 333
RCR..................................................................................................................................... 334
RDBYTE ............................................................................................................................... 335
RDLONG ............................................................................................................................... 336
RDWORD ............................................................................................................................... 337
REGISTERS......................................................................................................................... 338
RES..................................................................................................................................... 339
RET..................................................................................................................................... 342
REV..................................................................................................................................... 343
Propeller Manual v1.2 · Page 9
Table of Contents
Page 10 · Propeller Manual v1.2
ROL .....................................................................................................................................344
ROR .....................................................................................................................................345
SAR .....................................................................................................................................346
SHL .....................................................................................................................................347
SHR .....................................................................................................................................348
SUB .....................................................................................................................................349
SUBABS................................................................................................................................350
SUBS ...................................................................................................................................351
SUBSX..................................................................................................................................352
SUBX ...................................................................................................................................354
SUMC ...................................................................................................................................356
SUMNC..................................................................................................................................357
SUMNZ..................................................................................................................................358
SUMZ ...................................................................................................................................359
SYMBOLS ............................................................................................................................360
TEST ...................................................................................................................................362
TESTN..................................................................................................................................363
TJNZ ...................................................................................................................................364
TJZ .....................................................................................................................................365
VCFG ...................................................................................................................................366
VSCL ...................................................................................................................................367
WAITCNT ..............................................................................................................................368
WAITPEQ ..............................................................................................................................369
WAITPNE ..............................................................................................................................370
WAITVID ..............................................................................................................................371
WC .......................................................................................................................................372
WR .......................................................................................................................................373
WRBYTE................................................................................................................................374
WRLONG................................................................................................................................375
WRWORD................................................................................................................................376
WZ .......................................................................................................................................377
XOR .....................................................................................................................................378
APPENDIX A: RESERVED WORD LIST ..............................................................................379
APPENDIX B: MATH SAMPLES AND FUNCTION TABLES.................................................380
INDEX....................................................................................................................................386
Preface
Preface
Thank you for purchasing a Propeller chip. You will be spinning your own programs in no
time!
Propeller chips are incredibly capable multiprocessor microcontrollers; the much-anticipated
result of over eight years of the intense efforts of Chip Gracey and the entire Parallax
Engineering Team.
This book is intended to be a reference guide to Propeller chips and their native programming
languages, Spin and Propeller Assembly. For a programming tutorial and Propeller Tool
details, please refer to the on-line help that is installed with the Propeller Tool software.
Have fun!
Despite our best efforts, there are bound to be questions unanswered by this manual alone.
Check out our Propeller chip discussion forum – (accessible from www.parallax.com via the
Support Discussion Forums menu) – this is a group especially for Propeller users where
you can post your questions or review discussions that may have already answered yours.
In addition to the forum, visit the Propeller Object Exchange (obex.parallax.com) for free
access to hundreds of Propeller objects made by customers and Parallax Engineers. Besides
being immediately useful for your own applications, Propeller objects written by various
authors are a great resource for studying techniques and tricks employed by the very active
Propeller community.
Editor’s Note: About Version 1.2
The changes to this version focus on corrections and small additions to clarify certain
sections. The PDF version of this document highlights each technical change.
In addition, a complete list of technical content changes between Version 1.1 and Version 1.2
can be found in the Propeller Manual Supplement & Errata. The pagination between these
two versions has not changed, so the page numbers cited refer to both versions.
The most significant technical corrections relate to the number of clock cycles required by
certain Propeller Assembly instructions. These include all hub instructions as well as WAITCNT,
p. 368, WAITPEQ, p. 369, WAITPNE, p. 370, and WAITVID, p. 371. These changes are reflected in
each instruction’s Opcode Table, as well as in the the Propeller Assembly Instruction Master
Table and its notes, p. 253. For complete details, revised illustrations, and a list of hub
instructions, see the Hub section, p. 24.
Propeller Manual v1.2 · Page 11
Preface
Page 12 · Propeller Manual v1.2
Other notable changes include:
A clarification about RAM/ROM organization in Table 1-2: Specifications, p. 16.
An expanded explanation of Locks, page 30.
A correction to the XTAL3 external crystal range in the Table 2-3: Clock Mode Setting
Constants, p. 68.
A new section titled Variables in Propeller Assembly, page 103, under the DAT
section’s Writing Propeller Assembly Code (Syntax 2).
An explanation of Cog RAM contents when running Spin and Propeller Assembly, in
COGNEW, p. 78.
Corrections to the arithmetic in the examples under the LONG section’s
Reading/Writing Longs of Main Memory (Syntax 3), p. 130.
Note 5, regarding WAITVID, added to the notes for the Propeller Assembly Instruction
Master Table, p. 256. This information was also added to the instruction section,
p. 371.
1: Introducing the Propeller Chip
Chapter 1: Introducing the Propeller Chip
This chapter describes the Propeller chip hardware. To fully understand and use the Propeller
effectively, it’s important to first understand its hardware architecture. This chapter presents
the details of the hardware such as package types, package sizes, pin descriptions, and
functions.
Concept
The Propeller chip is designed to provide high-speed processing for embedded systems while
maintaining low current consumption and a small physical footprint. In addition to being
fast, the Propeller provides flexibility and power through its eight processors, called cogs,
that can perform simultaneous independent or cooperative tasks, all while maintaining a
relatively simple architecture that is easy to learn and utilize.
The resulting design of the Propeller frees application developers from common complexities
of embedded systems programming. For example:
The memory map is flat. There is no need for paging schemes with blocks of code,
data or variables. This is a big time-saver during application development.
Asynchronous events are easier to handle than they are with devices that use
interrupts. The Propeller has no need for interrupts; just assign some cogs to
individual, high-bandwidth tasks and keep other cogs free and unencumbered. The
result is a more responsive application that is easier to maintain.
The Propeller Assembly language features conditional execution and optional result
writing for each individual instruction. This makes critical, multi-decision blocks of
code more consistently timed; event handlers are less prone to jitter and developers
spend less time padding, or squeezing, cycles here and there.
Propeller Manual v1.2 · Page 13
Introducing the Propeller Chip
Package Types
The Propeller chip is available in the package types shown here.
P8X32A-Q44
4
4
-
p
in LQFP
P8X32A-D40 40-pin DIP
P8X32A-M44
4
4
-
p
in QFN
Page 14 · Propeller Manual v1.2
1: Introducing the Propeller Chip
Pin Descriptions
Table 1-1: Pin Descriptions
Pin Name Direction Description
P0 – P31 I/O
General purpose I/O Port A. Can source/sink 40 mA each at 3.3 VDC.
Logic threshold is ½ VDD; 1.65 VDC @ 3.3 VDC.
The pins shown below have a special purpose upon power-up/reset but are
general purpose I/O afterwards.
P28 - I2C SCL connection to optional, external EEPROM.
P29 - I2C SDA connection to optional, external EEPROM.
P30 - Serial Tx to host.
P31 - Serial Rx from host.
VDD --- 3.3 volt power (2.7 – 3.3 VDC).
VSS --- Ground.
BOEn I
Brown Out Enable (active low). Must be connected to either VDD or VSS.
If low, RESn becomes a weak output (delivering VDD through 5 K) for
monitoring purposes but can still be driven low to cause reset. If high,
RESn is CMOS input with Schmitt Trigger.
RESn I/O
Reset (active low). When low, resets the Propeller chip: all cogs disabled
and I/O pins floating. Propeller restarts 50 ms after RESn transitions from
low to high.
XI I
Crystal Input. Can be connected to output of crystal/oscillator pack (with
XO left disconnected), or to one leg of crystal (with XO connected to other
leg of crystal or resonator) depending on CLK Register settings. No
external resistors or capacitors are required.
XO O
Crystal Output. Provides feedback for an external crystal, or may be left
disconnected depending on CLK Register settings. No external resistors
or capacitors are required.
The Propeller (P8X32A) has 32 I/O pins (Port A, pins P0 through P31). Four of these I/O
pins, P28-P31 have a special purpose upon power-up/reset. At power-up/reset, pins P30 and
P31 communicate with a host for programming and P28 and P29 interface to an external
32 KB EEPROM (24LC256).
Propeller Manual v1.2 · Page 15
Introducing the Propeller Chip
Page 16 · Propeller Manual v1.2
Specifications
Table 1-2: Specifications
Model P8X32A
Power Requirements 3.3 volts DC. (Max current draw must be limited to 300 mA).
External Clock Speed DC to 80 MHz (4 MHz to 8 MHz with Clock PLL running)
System Clock Speed DC to 80 MHz
Internal RC Oscillator 12 MHz or 20 kHz (approximate; may range from 8 MHz – 20 MHz,
or 13 kHz – 33 kHz, respectively)
Main RAM/ROM 64 K bytes; 32 KB RAM + 32 KB ROM
Cog RAM 512 x 32 bits each
RAM/ROM Organization Main RAM: Long (32-bit), Word (16-bit), or Byte (8-bit) addressable
Cog RAM: Long (32-bit) addressable only
I/O pins 32 CMOS signals with VDD/2 input threshold.
Current Source/Sink per I/O 40 mA
Current Draw @ 3.3 vdc, 70 °F 500 µA per MIPS (MIPS = Freq in MHz / 4 * Number of Active Cogs)
1: Introducing the Propeller Chip
Hardware Connections
Figure 1-1 shows an example wiring diagram that provides host and EEPROM access to the
Propeller chip. In this example the host access is achieved through the Propeller Plug device
(a USB to TTL serial converter).
Figure 1-1: Example wiring diagram that allows for programming the Propeller chip
nd an external 32 Kbyte EEPROM, and running the Propeller with an external crystal. a
Propeller Manual v1.2 · Page 17
Introducing the Propeller Chip
Boot Up Procedure
Upon power-up (+ 100 ms), RESn low-to-high, or software reset:
1. The Propeller chip starts its internal clock in slow mode ( 20 kHz), delays for 50 ms
(reset delay), switches the internal clock to fast mode ( 12 MHz), and then loads and
runs the built-in Boot Loader program in the first processor (Cog 0).
2. The Boot Loader performs one or more of the following tasks, in order:
a. Detects communication from a host, such as a PC, on pins P30 and P31. If
communication from a host is detected, the Boot Loader converses with the
host to identify the Propeller chip and possibly download a program into
Main RAM and optionally into an external 32 KB EEPROM.
b. If no host communication was detected, the Boot Loader looks for an
external 32 KB EEPROM (24LC256) on pins P28 and P29. If an EEPROM
is detected, the entire 32 KB data image is loaded into the Propeller chip’s
Main RAM.
c. If no EEPROM was detected, the boot loader stops, Cog 0 is terminated, the
Propeller chip goes into shutdown mode, and all I/O pins are set to inputs.
3. If either step 2a or 2b was successful in loading a program into the Main RAM, and a
suspend command was not given by the host, then Cog 0 is reloaded with the built-in
Spin Interpreter and the user code is run from Main RAM.
Run-Time Procedure
A Propeller Application is a user program compiled into its binary form and downloaded to
the Propeller chip’s RAM and, possibly, external EEPROM. The application consists of code
written in the Propeller chip’s Spin language (high-level code) with optional Propeller
Assembly language components (low-level code). Code written in the Spin language is
interpreted during run time by a cog running the Spin Interpreter while code written in
Propeller Assembly is run in its pure form directly by a cog. Every Propeller Application
consists of at least a little Spin code and may actually be written entirely in Spin or with
various amounts of Spin and assembly. The Propeller chip’s Spin Interpreter is started in
Step 3 of the Boot Up Procedure, above, to get the application running.
Once the boot-up procedure is complete and an application is running in Cog 0, all further
activity is defined by the application itself. The application has complete control over things
like the internal clock speed, I/O pin usage, configuration registers, and when, what and how
Page 18 · Propeller Manual v1.2
1: Introducing the Propeller Chip
Propeller Manual v1.2 · Page 19
many cogs are running at any given time. All of this is variable at run time, as controlled by
the application, including the internal clock speed.
Shutdown Procedure
When the Propeller goes into shutdown mode, the internal clock is stopped causing all cogs
to halt and all I/O pins are set to input direction (high impedance). Shutdown mode is
triggered by one of the three following events:
1) VDD falling below the brown-out threshold (2.7 VDC), when the brown-out circuit
is enabled,
2) the RESn pin going low, or
3) the application requesting a reboot (see the REBOOT command, page 187).
Shutdown mode is discontinued when the voltage level rises above the brown-out threshold
and the RESn pin is high.
Introducing the Propeller Chip
Block Diagram
Figure 1-2: Propeller Chip Block Diagram
Page 20 · Propeller Manual v1.2
/