122-32000 Parallax Inc, 122-32000 Datasheet - Page 125
![MANUAL PROPELLER](/photos/8/99/89977/mfg_122-32000_sml.jpg)
122-32000
Manufacturer Part Number
122-32000
Description
MANUAL PROPELLER
Manufacturer
Parallax Inc
Specifications of 122-32000
Accessory Type
Manual
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
For Use With/related Products
Propeller Education (PE) Kit
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
- Current page: 125 of 438
- Download datasheet (5Mb)
3: Propeller Programming Tutorial
Compile and download Blinker2. You should see six LEDs start blinking with different,
independent, rates and periods. Look carefully, after about 8 seconds P20 will stop blinking
and P22 will start. A few seconds later, P18 will stop and P23 will start, then P16 will stop
and P20 will start again, but at a different rate. Eventually, all but P17 and P20 will cease.
Can you figure out why it behaves this way? We’ll explain it below.
The OBJ Block
In the object block we defined an array of Output objects, called
, with six elements. This
LED
is so we can have six simultaneous processes running, each operating independently.
The Main Method
The first line of
,
, sets I/O pins 16 through 23 to outputs. The I/O
Main
dira[16..23]~~
registers,
,
, and
, can use this form to affect multiple contiguous pins. We are
DIRA
OUTA
INA
setting this group of I/O pins to outputs only to prevent confusing results due to the Propeller
Demo Board’s resistors between the I/O pairs in 18 to 23. If a cog is the only one making a
particular pin an output, upon shutting down that pin becomes an input again which allows
the resistor between it and its neighbor to affect the LED on it. We’ll keep this application’s
cog active so results are clear.
The next nine lines,
…, call the Output object’s
method to activate a new cog and
LED[
Start
toggle different I/O pins at different rates. The lines in the form
…,
LED[NextObject].Start
call the
method to get an index value for the array. We’ll explain the
NextObject
NextObject
method in more detail soon, but simply put, it returns the index of the next available Output
object in the
array (i.e. the index of the first idle object) and pauses until one is available.
LED
We only have six Output objects defined for the
array, so the first six calls to
are
LED
Start
going to execute quickly, each one accessing
indexes 0 through 5 and activating a total of
LED
6 additional cogs. The first two have a
parameter of 0, so they will toggle infinitely;
Count
the last four will terminate after the given number of toggles is performed.
The seventh line,
will first call
to get
LED[NextObject].Start(22, 750_000, 200)
NextObject
the index of the next available object, but since all six objects are busy toggling pins,
will wait and won’t return to
until it finds that an object has finished. As it
NextObject
Main
turns out, the object at index 4 (I/O pin 20) finishes its task first and shuts down. The
method then returns the number 4, allowing that object’s
method to
NextObject
Start
execute, which will re-launch another cog to toggle pin 22. A similar process happens with
the eighth line,
; all objects are busy so
LED[NextObject].Start(23, 400_000, 160)
postpones further operation until one becomes available, index 2 in this case.
NextObject
Immediately after the eighth line is executed, the ninth line executes,
LED[0].Start(20,
. This statement is unlike the previous in that it doesn’t call
, but
12_000_000, 0)
NextObject
Propeller Manual v1.0 · Page 125
Related parts for 122-32000
Image
Part Number
Description
Manufacturer
Datasheet
Request
R
![122-27400](/photos/8/99/89964/mfg_122-27400_tmb.jpg)
Part Number:
Description:
MANUAL FOR SUMOBOT
Manufacturer:
Parallax Inc
Datasheet:
![122-28176](/photos/8/99/89965/mfg_122-28176_tmb.jpg)
Part Number:
Description:
GUIDE STUDENT PROCESS CONTROL
Manufacturer:
Parallax Inc
Datasheet:
![122-28029](/photos/8/99/89971/mfg_122-28029_tmb.jpg)
Part Number:
Description:
GUIDE STUDENT SMART SENSORS
Manufacturer:
Parallax Inc
Datasheet:
![HW-FLYLEADS](/photos/8/95/89575/hw-flyleads_tmb.jpg)
Part Number:
Description:
LEAD WIRES FLYING CABLE III/IV
Manufacturer:
Xilinx Inc
Datasheet:
![HW-USB-FLYLEADS-G](/photos/8/95/89577/hw-usb-flyleads-g_tmb.jpg)
Part Number:
Description:
BOARD ADAPTER AND FLY LEADS
Manufacturer:
Xilinx Inc
Datasheet:
![HW-USB-II-G](/photos/8/95/89581/hw-usb-ii-g_tmb.jpg)
Part Number:
Description:
PLATFORM CABLE USB II
Manufacturer:
Xilinx Inc
Datasheet:
![HW-CRII-PM-ACC-G](/photos/8/98/89837/hw-crii-pm-acc-g_tmb.jpg)
Part Number:
Description:
KIT STARTER COOLRUNNER-II BUNDLE
Manufacturer:
Xilinx Inc
Datasheet:
![30008](/images/manufacturer_photos/0/5/515/parallax_inc_tmb.jpg)
Part Number:
Description:
Microcontroller Modules & Accessories DISCONTINUED BY PARALLAX
Manufacturer:
Parallax Inc
![30008](/images/manufacturer_photos/0/5/515/parallax_inc_tmb.jpg)
Part Number:
Description:
Microcontroller Modules & Accessories DISCONTINUED BY PARALLAX
Manufacturer:
Parallax Inc
![70009](/photos/26/92/269208/70009-l_tmb.jpg)
Part Number:
Description:
BOOK UNDERSTANDING SIGNALS
Manufacturer:
Parallax Inc
Datasheet:
![28135](/images/manufacturer_photos/0/5/515/parallax_inc_tmb.jpg)
Part Number:
Description:
BOARD EXPERIMENT+LCD NX-1000
Manufacturer:
Parallax Inc
Datasheet:
![SX18AC/SO](/images/manufacturer_photos/0/5/515/parallax_inc_tmb.jpg)
Part Number:
Description:
IC MCU 2K FLASH 50MHZ SO-18
Manufacturer:
Parallax Inc
Datasheet: