Propeller Manual

Table Of Contents
1: Introducing the Propeller Chip
Table 1-4: I/O Sharing Examples
Bit 12 of Cogs’ I/O
Direction Register
Bit 12 of Cogs’ I/O
Output Register
Cog ID
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
State of I/O Pin
P12
Rule
Followed
Example 1
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Input A
Example 2
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Output Low B
Example 3
1 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0
Output High C
Example 4
1 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0
Output Low B
Example 5
1 1 0 0 0 0 0 0
0 1 0 0 0 0 0 0
Output High C
Example 6
1 1 1 1 1 1 1 1
0 1 0 1 0 0 0 0
Output High C
Example 7
1 1 1 1 1 1 1 1
0 0 0 1 0 0 0 0
Output High C
Example 8
1 1 1 0 1 1 1 1
0 0 0 1 0 0 0 0
Output Low B
Note: For the I/O Direction Register, a 1 in a bit location sets the corresponding I/O pin to the
output direction while a 0 sets it to an input direction.
Any cog that is shut down has its Direction Register and output states cleared to zero,
effectively removing it from influencing the final state of the I/O pins that the remaining
active cogs are controlling.
Each cog also has its own 32-bit Input Register. This input register is really a pseudo-
register; every time it is read, the actual states of the I/O pins are read, regardless of their
input or output direction.
System Counter
The System Counter is a global, read-only, 32-bit counter that increments once every System
Clock cycle. Cogs can read the System Counter (via their
CNT register, page 73) to perform
timing calculations and can use the
WAITCNT command (page 218) to create effective delays
within their processes. The System Counter is a common resource. Every cog can read it
simultaneously. The System Counter is not cleared upon startup since its practical use is for
differential timing. If a cog needs to keep track of time from a specific, fixed moment in
time, it simply needs to read and save the initial counter value at that moment in time, and
compare all of the later counter values against that initial value.
Propeller Manual v1.1 · Page 27