|
|
|
|
Datasheet (ver.
1.1)
(now includes speed ratings vs. temperature).
|
Propeller is a CMOS device running at 3.3 VDC.
| Extra circuitry is sometimes required to interface to 5-V logic. |
| CPU can draw a maximum of 300 mA, dissipating only 1 W |
|
|
|
Block Diagram:
|
|
The Propeller is a microcontroller comprising 8 independent 32-bit
processors, called "cogs"
|
Each cog can run at up to 80 MHz.
| All cogs share the same clock. |
| An internal PLL allows easy operation at 80 MHz using an
external 5-MHz crystal. |
| Other, lower speed, outputs of the PLL are also selectable.
|
| There are also internal RC oscillators at 20 kHz and 12 MHz. |
| The user's program decides what clock source to use, can be
set either upon program load or programmatically while running.
|
| Nearly all cog CPU instructions require 4 clock cycles,
giving 20-MIPS operation (per cog) at 80 MHz |
| Only instructions involving the hub take more clock cycles.
The exact number of cycles is variable, depending on hub
rotational position. |
|
|
Each cog has 2 kB of full speed RAM (arranged as 512 longs)
|
Since all CPU operations work
with 32-bit longs (rather than 8-bit bytes) and addresses are all
words (16 bits), so it is often better to think
in terms of words or longs rather than bytes for the Propeller.
|
| Cogs also have access to the much larger Hub memory (see
below) |
|
|
|
Each cog has a hardware video generator and two special counters (CTRA
and CTRB)
| Both counters have 3 special registers (CTR, FRQ, PHS) |
| The basic function of the counter is to add the quantity in the
FRQ register into the PHS register. When and how this is done
is determined by the setting of the CTR register. |
| Counters can operate independently from cog CPU with clock rates
(controlled by CTR, FRQ registers) from 500 kHz to 128 MHz.
This done via a PLL and VCO controlled by bit PHS[31]. |
| CTRA is used by the video generator, when the video generator is
utilized. |
|
|
|
A "Hub" controls the cogs
|
Hub has 32-kB RAM and 32-kB ROM
|
|
Hub controls and all cogs have access to a system counter that
increments at the clock frequency |
|
Cogs interface hub memory with 16-bit address bus and 32-bit data bus.
|
|
Hub maintains "Locks", a special 8-bit register accessed by special
instructions.
|
Programs that wish to use multiple
cogs that may interfere with each other by attempt to access the same
resources simultaneously, may wish to use these locks to ensure that
only one cog has access at any given time. |
|
|
|
All cogs share the same 32 I/O Pins, P0-P31 and 32 direction bits
|
Each cog has a 32 bit I/O output register and a 32-bit I/O direction
register. All 32 I/O outputs are OR'd together and all 32 I/O
direction registers are OR'd together to determine actual settings.
| This seems to be a unique feature of the Propeller. |
| If any cog's output is set to "1", the corresponding actual output
will be a "1" |
| The actual output of a pin is "0" only if all corresponding cog
outputs are "0" |
| If any cog's pin direction is "1", the corresponding actual pin
direction with be "output" |
| A pin's direction is "input" only if all corresponding cog
directions are "0" |
|
|
I/O pins P0-P27 are general purpose, but pins P28-P31 are special
| Pins P28-P29 are quasi-optional I2C connection (SCL, SDA) to
external EEPROM |
| Pins P30-P31 are optional serial connection (TX, RX) to a
controlling computer |
|
|
|
|
-
Power or reset applied
-
After 50 ms, clock switches from 20 kHz RC to 12 MHz RC
-
Cog 0 loads and runs "Boot Loader" from hub ROM
-
Boot Loader checks for computer listening on serial port of I/O pins P30
and P31.
|
If found, computer can either transfer a program to hub RAM and
optionally to external EEPROM. If successful, jumps to step 7,
otherwise continues to step 5.
|
|
Computer can also instruct Propeller to suspend operation.
|
-
Boot Loader checks for response from EEPROM with I/O pins P28 and P29.
|
If found, 32 kB is transferred from EEPROM to hub RAM. If
successful, jumps to step 7.
|
-
When no computer host found and no EEPROM found, cog 0 is stopped, all
I/O pins set to input mode, and Propeller goes into shutdown mode.
-
After successfully loading a program into hub RAM (and not instructed by
computer to suspend):
-
Cog 0 loads and runs the "Spin Interpreter" code from hub ROM
-
Spin Interpreter executes code in hub RAM
|
| |
|
There are several boards available from Parallax including Quickstart, Demo and Proto:
|
Quickstart is a very low cost board with built in USB, 8 LEDs and 8
buttons:
|
|
Demo board is ready to go with VGA, sound, keyboard, mouse, USB, and
power connectors
| Schematic:
Photo:
|
| Optional kit with keyboard, mouse, and display available |
|
|
Proto board is more basic (but cheaper and more versitile):
| Documentation Schematic:
Photo:
|
| A USB version is now available. |
| Optional kit has the resistors and connectors you need for VGA,
mouse and keyboard. |
|
|
|
The Propeller Platform is a great board for adding more advanced
"shields" to.
|
|
|
|
|
Programming done via serial connection (normal or USB) with
Parallax's "Propeller Tool" Windows program.
| A program can consist of high-level "Spin" language code "objects"
and low-level assembly code. |
| Assembly code is optional, but some Spin code is required in all
apps. |
| The Propeller Tool comes with many examples. |
| One key point is that you must select a "top" Spin object in the
software, which defines the main procedure that runs first. |
| Then, you can either "Run->Compile Top->Load RAM" or "->Load EEPROM".
If you load RAM the program runs, but is erased by power loss or reset.
If you load EEPROM the program is retained even after power loss and
restarts after reset or restoration of power. |
|
|
Parallax maintains an "Object
Exchange" library of copyright free user contributed code objects.
|
|
A great deal of code can be found by digging through the
user forum.
|
|
Debugging can be a bit difficult. One easy way to do debugging
is to use a
terminal window on the PC and the "FullDuplexSerial" object to send messages
to the PC at places of interest in your code. The Prop Tool now comes
with "Parallax Serial Terminal" which can be used for this purpose.
There is also a "pst" object that can be used instead of
fullduplexserial.
|
|
New! PropGCC and Catalina are two ways to program the
Propeller in C. This wasn't so nice in the past because the
although it was faster than Spin, the code size was much larger.
But now, both PropGCC and Catalina have CMM (compact memory model)
working with code about the same size as Spin. There is also
a Spin2Cpp tool that can be used to automatically convert Spin code into
C or C++.
|
|