Propeller P8X32A Datasheet: 8-Cog Multiprocessor Microcontroller
Propeller P8X32A Datasheet: 8-Cog Multiprocessor Microcontroller
Parallax, Propeller, Spin, and the Parallax and Propeller logos are trademarks of Parallax, Inc. All other trademarks are the property of their respective holders.
Copyright © Parallax Inc. Page 1 of 37 Rev 1.1 9/12/2008
Propeller™ P8X32A Datasheet www.parallax.com
Table of Contents
5.2. Cog RAM................................................................................. 16
1.0 Product Overview......................................................... 1
1.1. Introduction ................................................................................1 6.0 Programming Languages ..........................................17
1.2. Stock Codes...............................................................................1 6.1. Reserved Word List ................................................................. 17
1.3. Key Features..............................................................................3 6.1.1. Words Reserved for Future Use ......................................................... 17
1.4. Programming Advantages..........................................................3 6.2. Math and Logic Operators ....................................................... 18
1.5. Applications................................................................................3 6.3. Spin Language Summary Table .............................................. 19
1.6. Programming Platform Support..................................................3 6.3.1. Constants ........................................................................................... 21
1.7. Corporate and Community Support............................................3 6.4. Propeller Assembly Instruction Table....................................... 22
6.4.1. Assembly Conditions .......................................................................... 24
2.0 Connection Diagrams .................................................. 4 6.4.2. Assembly Directives ........................................................................... 24
2.1. Pin Assignments ........................................................................4 6.4.3. Assembly Effects ................................................................................ 24
6.4.4. Assembly Operators ........................................................................... 24
2.2. Pin Descriptions .........................................................................4
2.3. Typical Connection Diagrams ....................................................5 7.0 Propeller Demo Board Schematic.............................25
2.3.1. Propeller Clip or Propeller Plug Connection - Recommended...............5
2.3.2. Alternative Serial Port Connection.........................................................5
8.0 Electrical Characteristics...........................................26
3.0 Operating Procedures ................................................. 6 8.1. Absolute Maximum Ratings ..................................................... 26
3.1. Boot-Up Procedure ....................................................................6 8.2. DC Characteristics................................................................... 26
3.2. Run-Time Procedure..................................................................6 8.3. AC Characteristics ................................................................... 26
3.3. Shutdown Procedure..................................................................6
9.0 Current Consumption Characteristics .....................27
4.0 System Organization ................................................... 6 9.1. Typical Current Consumption of 8 Cogs .................................. 27
4.1. Shared Resources .....................................................................6 9.2. Typical Current of a Cog vs. Operating Frequency .................. 28
4.2. System Clock .............................................................................6 9.3. Typical PLL Current vs. VCO Frequency ................................. 28
4.3. Cogs (processors)......................................................................7 9.4. Typical Crystal Drive Current ................................................... 29
4.4. Hub ............................................................................................7 9.5. Cog and I/O Pin Relationship................................................... 29
4.5. I/O Pins ......................................................................................8 9.6. Current Profile at Various Startup Conditions .......................... 30
4.6. System Counter .........................................................................8
4.7. Locks .........................................................................................8
10.0 Temperature Characteristics.....................................31
10.1. Internal Oscillator Frequency as a Function of Temperature.... 31
4.8. Assembly Instruction Execution Stages .....................................9
10.2. Fastest Operating Frequency as a Function of Temperature ... 32
4.9. Cog Counters...........................................................................10
4.9.1. CTRA / CTRB – Control register .........................................................10 10.3. Current Consumption as a Function of Temperature ............... 33
4.9.2. FRQA / FRQB – Frequency register....................................................10
4.9.3. PHSA / PHSB – Phase register...........................................................10 11.0 Package Dimensions..................................................34
4.10. Video Generator.......................................................................11 11.1. P8X32A-D40 (40-pin DIP)........................................................ 34
4.10.1. VCFG – Video Configuration Register.................................................11 11.2. P8X32A-Q44 (44-pin LQFP) .................................................... 35
4.10.2. VSCL – Video Scale Register..............................................................12 11.3. P8X32A-M44 (44-pin QFN)...................................................... 35
4.10.3. WAITVID Command/Instruction ..........................................................12
4.11. CLK Register............................................................................14 12.0 Manufacturing Info .....................................................37
12.1. Reflow Peak Temperature ....................................................... 37
5.0 Memory Organization ................................................ 15 12.2. Green/RoHS Compliance ........................................................ 37
5.1. Main Memory ...........................................................................15
5.1.1. Main RAM............................................................................................15 13.0 Revision History .........................................................37
5.1.2. Main ROM ...........................................................................................15 13.1.1. Changes for Version 1.1: .................................................................... 37
5.1.3. Character Definitions...........................................................................15
5.1.4. Math Function Tables..........................................................................16
The pins shown below have a special purpose upon power-up/reset but are general purpose I/O
P0 – P31 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.
Figure 2: Cog-Hub
Interaction – Best Case
Scenario
Figure 3: Cog-Hub
Interaction – Worst Case
Scenario
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; a 0 sets it to an input direction.
(Execute N- 1) (Execute N)
Fetch Write Fetch Fetch Fetch Write
Instruction Result Source Destination Instruction Result
N N-1 N N N+1 N
The Propeller executes assembly instructions in five accessed by instruction N. To speed up the throughput of
stages. While an entire instruction takes six cycles to program execution, the next instruction to be executed is
execute, two of those clock cycles are dedicated to the fetched from cog memory while the current instruction is
two adjacent instructions. This results in an overall executed in the ALU.
throughput of four clock cycles per instruction. Finally at clock cycle M+5 the result of the current
instruction N is written back to cog memory, completing
Stage 5.
The partial interleaving of instructions has a couple
implications to program flow. First, when code
Instruction N-1
Figure 5 Program
modification occurs through MOVI, MOVS, MOVD or any
Instruction N operations which modifies an assembly instruction, there
Cog Memory counter
Instruction N+1 must be at least one instruction executed before the
modified instruction is executed. If the modification is
done on the immediately following instruction (N+1), the
unmodified version of instruction N+1 will be loaded a
clock cycle before the modified version of instruction
In Stage 1, instruction N, pointed to by the Program N+1 is written to cog memory.
Counter, is fetched from cog memory during clock cycle Second, conditional jumps do not know for certain if they
M. During cycle M+1 the result from the previous will jump until the end of clock cycle M+4. Since the next
instruction is written to memory. The reason the previous instruction has already been fetched, only one of the two
instruction result is written after the current instruction is possible branches can be predicted. In the Propeller,
fetched will be explained shortly. conditional branches are always predicted to take the
During Stage 2, if the immediate flag of Instruction N is jump. For loops using DJNZ where the jump is taken every
set, the 9 bit source field is saved as the source value. If time except the final loop, a tighter execution time of the
the value is not immediate, the location specified by the loop is achieved.
source field is fetched from cog memory during clock In the event the jump is not taken, the cog takes no action
cycle M+2. During clock cycle M+3 the location until the next instruction is fetched. This is equivalent to a
specified in the destination field is fetched from cog NOP being inserted before the next instruction is executed.
memory (Stage 3). Unconditional jumps always take four clock cycles to
At this point in time (Stage 4) the Arithmetic Logic Unit execute since the Propeller can always accurately predict
(ALU) has all the information needed to execute the what address needs to be loaded into the Program Counter
instruction. Executing the instruction takes some amount for the next instruction to execute. Examples of
of time before the result is available. The amount of time unconditional jumps include JMP, JMPRET, CALL and RET.
required for execution is dictated by the slowest operation If an instruction needs to access any Hub resource, Stage
the ALU performs. To provide enough time for the ALU 4 is extended until the Hub becomes available, increasing
to execute the instruction, a full clock cycle (M+4) is execution time to at least 7 and potentially up to 22 clock
provided to the ALU for the result to settle into its final cycles. See Section 4.4: Hub on page 7.
state. During this execution, the cog memory is not
The 2-bit VMode (video mode) field selects the type and The VPins (video output pins) field is a mask applied to
orientation of video output, if any, according to Table 8. the pins of VGroup that indicates which pins to output
video signals on.
Table 8: The Video Mode Field
Table 11: The VPins Field
VMode Video Mode
VPins Effect
00 Disabled, no video generated. Drive Video on lower 4 pins only; composite
00001111
01 VGA mode; 8-bit parallel output on VPins 7:0 11110000 Drive Video on upper 4 pins only; composite
Composite Mode 1; broadcast on VPins 7:4, baseband 11111111 Drive video on all 8 pins; VGA
10
on VPins 3:0 Any value is valid for this field; the above
XXXXXXXX
Composite Mode 2; baseband on VPins 7:4, broadcast values are the most common.
11
on VPins 3:0
The CMode (color mode) field selects two or four color 4.10.2. VSCL – Video Scale Register
mode. 0 = two-color mode; pixel data is 32 bits by 1 bit The Video Scale Register sets the rate at which video data
and only colors 0 or 1 are used. 1 = four-color mode; is generated, and is shown in Table 12.
pixel data is 16 bits by 2 bits, and colors 0 through 3 are
used.
Table 12: VSCL Register
The Chroma1 (broadcast chroma) bit enables or disables
VSCL Bits
chroma (color) on the broadcast signal. 0 = disabled, 1 =
enabled. 31..20 19..12 11..0
VGA mode, each 8-bit color value is written to the pins When the FrameClocks value is greater than 16 times the
specified by the VGroup and VPins field. For VGA PixelClocks value and 4-color mode is specified, the two
typically the 8 bits are grouped into 2 bits per primary most significant bits are repeated until FrameClocks
color and Horizontal and Vertical Sync control lines, but PLLA cycles have occurred. When FrameClocks value is
this is up to the software and application of how these bits greater than 32 times PixelClocks value and 2-color mode
are used. For composite video each 8-bit color value is is specified, the most significant bit is repeated until
composed of 3 fields. Bits 0-2 are the luminance value of FrameClocks PLLA cycles have occurred. When
the generated signal. Bit 3 is the modulation bit which FrameClocks cycles occur and the cog is not in a WAITVID
dictates whether the chroma information will be generated instruction, whatever data is on the source and destination
and bits 4-7 indicate the phase angle of the chroma value. busses at the time will be fetched and used. So it is
When the modulation bit is set to 0, the chroma important to be in a WAITVID instruction before this
information is ignored and only the luminance value is occurs.
output to pins. When the modulation bit is set to 1 the While the Video Generator was created to display video
luminance value is modulated ± 1 with a phase angle set signals, its potential applications are much more diverse.
by bits 4-7. In order to achieve the full resolution of the The Composite Video mode can be used to generate
chroma value, PLLA should be set to 16 times the phase-shift keying communications of a granularity of 16
modulation frequency (in composite video this is called or less and the VGA mode can be used to generate any bit
the color-burst frequency). The PLLB of the cog is used pattern with a fully settable and predictable rate.
to generate the broadcast frequency; whether this is
Figure 6 is a block diagram of how the VGA mode is
generated depends on if PLLB is running and the values
organized. The two inverted triangles are the load
of VMode and VPins.
mechanism for Pixels and Colors; n is 1 or 2 bits
The Pixels parameter describes the pixel pattern to depending on the value of CMode. The inverted trapezoid
display, either 16 pixels or 32 pixels depending on the is a 4-way 8-bit multiplexer that chooses which byte of
color depth configuration of the Video Generator. When Colors to output. When in composite video mode the
four-color mode is specified, Pixels is a 16x2 bit pattern Modulator transforms the byte into the luminance and
where each 2-bit pixel is an index into Colors on which chroma signal and outputs the broadcast signal. VGroup
data pattern should be presented to the pins. When two- steers the 8 bits to a block of output pins and outputs to
color mode is specified, Pixels is a 32x1 bit pattern where those pins which are set to 1 in VPins; this combined
each bit specifies which of the two color patterns in the functionality is represented by the hexagon.
lower 16 bits of Colors should be output to the pins. The
Pixel data is shifted out least significant bits (LSB) first.
Source Destination
PLLA/FrameClocks
n
Colors
Pixels 3 2 1 0
n
Shift by n
PLLA/PixelClocks
8 Modulator
VGroup VPins
Figure 8
Propeller Character
Interleaving
Returns
Spin Command Value Description
((IF ┆ IFNOT)) Condition(s)
IfStatement(s)
〈ELSEIF Condition(s) Test condition(s) and execute block of code if valid.
ElseIfStatement(s)〉…
〈ELSEIFNOT Condition(s) IF and ELSEIF each test for TRUE. IFNOT and ELSEIFNOT each test for
ElseIfStatement(s)〉… FALSE.
〈ELSE
ElseStatement(s)〉
INA 〈[Pin(s)]〉 9 Input register for 32-bit ports A.
LOCKCLR (ID) 9 Clear semaphore to false and get its previous state; TRUE or FALSE.
LOCKNEW 9 Check out new semaphore and get its ID; 0-7, or -1 if none were available.
Return semaphore back to semaphore pool, releasing it for future
LOCKRET (ID)
LOCKNEW requests.
LOCKSET (ID) 9 Set semaphore to true and get its previous state; TRUE or FALSE.
LONG Symbol 〈[Count]〉 Declare long-sized symbol in VAR block.
〈Symbol〉 LONG Data 〈[Count]〉 Declare long-aligned and/or long-sized data in DAT block.
LONG [BaseAddress] 〈[Offset]〉 9 Read/write long of main memory.
LONGFILL (StartAddress, Value, Count) Fill longs of main memory with a value.
LONGMOVE (DestAddress, SrcAddress, Count) Copy longs from one region to another in main memory.
LOOKDOWN (Value:ExpressionList) 9 Get the one-based index of a value in a list.
LOOKDOWNZ (Value:ExpressionList) 9 Get the zero-based index of a value in a list.
LOOKUP (Index:ExpressionList) 9 Get value from a one-based index position of a list.
LOOKUPZ (Index:ExpressionList) 9 Get value from a zero-based index position of a list.
Skip remaining statements of REPEAT loop and continue with the next
NEXT
loop iteration.
OBJ
Declare symbol object references.
Symbol 〈[Count]〉:"Object" 〈 Symbol 〈[Count]〉: "Object"〉…
OUTA 〈[Pin(s)]〉 9 Output register for 32-bit port A. Default is 0 (ground) upon cog startup.
PAR 9 Cog Boot Parameter register.
PHSA 9 Counter A Phase Lock Loop (PLL) register.
PHSB 9 Counter B Phase Lock Loop (PLL) register.
PRI Name 〈(Par 〈,Par〉…)〉 〈:RVal〉 〈| LVar 〈[Cnt]〉〉 〈,LVar 〈[Cnt]〉〉… Declare private method with optional parameters, return value and local
SourceCodeStatements variables.
PUB Name 〈(Par 〈,Par〉…)〉 〈:RVal〉 〈| LVar 〈[Cnt]〉〉 〈,LVar 〈[Cnt]〉〉… Declare public method with optional parameters, return value and local
SourceCodeStatements variables.
QUIT Exit from REPEAT loop immediately.
REBOOT Reset the Propeller chip.
REPEAT 〈Count〉 Execute code block repetitively, either infinitely, or for a finite number of
Statement(s) iterations.
REPEAT Variable FROM Start TO Finish 〈STEP Delta〉
Execute code block repetitively, for finite, counted iterations.
Statement(s)
REPEAT ((UNTIL┆ WHILE)) Condition(s)
Execute code block repetitively, zero-to-many conditional iterations.
Statement(s)
REPEAT
Statement(s) Execute code block repetitively, one-to-many conditional iterations.
((UNTIL┆ WHILE)) Condition(s)
RESULT 9 Return value variable for PUB/PRI methods.
RETURN 〈Value〉 9 Exit from PUB/PRI method with optional return Value.
Round floating-point constant to the nearest integer at compile-time, in any
ROUND (FloatConstant) 9
block.
SPR [Index] 9 Special Purpose Register array.
STRCOMP (StringAddress1, StringAddress2) 9 Compare two strings for equality.
STRING (StringExpression) 9 Declare in-line string constant and get its address.
Returns
Spin Command Value Description
STRSIZE (StringAddress) 9 Get size, in bytes, of zero-terminate string.
Remove fractional portion from floating-point constant at compile-time, in
TRUNC (FloatConstant) 9
any block.
VAR
Declare symbolic global variables.
Size Symbol 〈[Count]〉 〈((,┆ Size )) Symbol 〈[Count]〉〉…
VCFG 9 Video Configuration register.
VSCL 9 Video Scale register.
WAITCNT (Value) Pause cog’s execution temporarily.
WAITPEQ (State, Mask, Port) Pause cog’s execution until I/O pin(s) match designated state(s).
WAITPNE (State, Mask, Port) Pause cog’s execution until I/O pin(s) do not match designated state(s).
WAITVID (Colors, Pixels) Pause cog’s execution until its Video Generator is available for pixel data.
WORD Symbol 〈[Count]〉 Declare word-sized symbol in VAR block.
〈Symbol〉 WORD Data 〈[Count]〉 Declare word-aligned and/or word-sized data in DAT block.
WORD [BaseAddress] 〈[Offset]〉 9 Read/write word of main memory.
Symbol.WORD 〈[Offset]〉 9 Read/write word-sized component of long-sized variable.
WORDFILL (StartAddress, Value, Count) Fill words of main memory with a value.
WORDMOVE (DestAddress, SrcAddress, Count) Copy words from one region to another in main memory.
6.3.1. Constants
Constants (pre-defined)
1
Constant Description
_CLKFREQ Settable in Top Object File to specify System Clock frequency.
_CLKMODE Settable in Top Object File to specify application’s clock mode.
_XINFREQ Settable in Top Object File to specify external crystal frequency.
_FREE Settable in Top Object File to specify application’s free space.
_STACK Settable in Top Object File to specify application’s stack space.
TRUE Logical true: -1 ($FFFFFFFF)
FALSE Logical false: 0 ($00000000)
POSX Max. positive integer: 2,147,483,647 ($7FFFFFFF)
NEGX Max. negative integer: -2,147,483,648 ($80000000)
PI Floating-point PI: ≈ 3.141593 ($40490FDB)
RCFAST Internal fast oscillator: $00000001 (%00000000001)
RCSLOW Internal slow oscillator: $00000002 (%00000000010)
XINPUT External clock/oscillator: $00000004 (%00000000100)
XTAL1 External low-speed crystal: $00000008 (%00000001000)
XTAL2 External medium-speed crystal: $00000010 (%00000010000)
XTAL3 External high-speed crystal: $00000020 (%00000100000)
PLL1X External frequency times 1: $00000040 (%00001000000)
PLL2X External frequency times 2: $00000080 (%00010000000)
PLL4X External frequency times 4: $00000100 (%00100000000)
PLL8X External frequency times 8: $00000200 (%01000000000)
PLL16X External frequency times 16: $00000400 (%10000000000)
1 “Settable” constants are defined in Top Object File’s CON block. See Valid Clock Modes for _CLKMODE. Other settable constants use whole numbers.
iiiiii zcri cccc ddddddddd sssssssss Instruction Description Z Result C Result R Clocks
000000 000i 1111 ddddddddd sssssssss WRBYTE D,S Write D[7..0] to main memory byte S[15..0] - - 0 7..22 *
Read main memory byte S[15..0] into D (0-
000000 001i 1111 ddddddddd sssssssss RDBYTE D,S Result = 0 - 1 7..22 *
extended)
000001 000i 1111 ddddddddd sssssssss WRWORD D,S Write D[15..0] to main memory word S[15..1] - - 0 7..22 *
Read main memory word S[15..1] into D (0-
000001 001i 1111 ddddddddd sssssssss RDWORD D,S Result = 0 - 1 7..22 *
extended)
000010 000i 1111 ddddddddd sssssssss WRLONG D,S Write D to main memory long S[15..2] - - 0 7..22 *
000010 001i 1111 ddddddddd sssssssss RDLONG D,S Read main memory long S[15..2] into D Result = 0 - 1 7..22 *
000011 000i 1111 ddddddddd sssssssss HUBOP D,S Perform hub operation according to S Result = 0 - 0 7..22 *
000011 0001 1111 ddddddddd ------000 CLKSET D Set the global CLK register to D[7..0] - - 0 7..22 *
000011 0011 1111 ddddddddd ------001 COGID D Get this cog number (0..7) into D Result = 0 - 1 7..22 *
000011 0001 1111 ddddddddd ------010 COGINIT D Initialize a cog according to D Result = 0 No cog free 0 7..22 *
000011 0001 1111 ddddddddd ------011 COGSTOP D Stop cog number D[2..0] - - 0 7..22 *
000011 0011 1111 ddddddddd ------100 LOCKNEW D Checkout a new LOCK number (0..7) into D Result = 0 No lock free 1 7..22 *
000011 0001 1111 ddddddddd ------101 LOCKRET D Return lock number D[2..0] - - 0 7..22 *
000011 0001 1111 ddddddddd ------110 LOCKSET D Set lock number D[2..0] - Prior lock state 0 7..22 *
000011 0001 1111 ddddddddd ------111 LOCKCLR D Clear lock number D[2..0] - Prior lock state 0 7..22 *
000100 001i 1111 ddddddddd sssssssss MUL D,S Multiply unsigned D[15..0] by S[15..0] Result = 0 - 1 future
000101 001i 1111 ddddddddd sssssssss MULS D,S Multiply signed D[15..0] by S[15..0] Result = 0 - 1 future
000110 001i 1111 ddddddddd sssssssss ENC D,S Encode magnitude of S into D, result = 0..31 Result = 0 - 1 future
000111 001i 1111 ddddddddd sssssssss ONES D,S Get number of 1's in S into D, result = 0..31 Result = 0 - 1 future
001000 001i 1111 ddddddddd sssssssss ROR D,S Rotate D right by S[4..0] bits Result = 0 D[0] 1 4
001001 001i 1111 ddddddddd sssssssss ROL D,S Rotate D left by S[4..0] bits Result = 0 D[31] 1 4
001010 001i 1111 ddddddddd sssssssss SHR D,S Shift D right by S[4..0] bits, set new MSB to 0 Result = 0 D[0] 1 4
001011 001i 1111 ddddddddd sssssssss SHL D,S Shift D left by S[4..0] bits, set new LSB to 0 Result = 0 D[31] 1 4
001100 001i 1111 ddddddddd sssssssss RCR D,S Rotate carry right into D by S[4..0] bits Result = 0 D[0] 1 4
001101 001i 1111 ddddddddd sssssssss RCL D,S Rotate carry left into D by S[4..0] bits Result = 0 D[31] 1 4
001110 001i 1111 ddddddddd sssssssss SAR D,S Shift D arithmetically right by S[4..0] bits Result = 0 D[0] 1 4
Reverse 32–S[4..0] bottom bits in D and 0-
001111 001i 1111 ddddddddd sssssssss REV D,S Result = 0 D[0] 1 4
extend
010000 001i 1111 ddddddddd sssssssss MINS D,S Set D to S if signed (D < S) D=S Signed (D < S) 1 4
010001 001i 1111 ddddddddd sssssssss MAXS D,S Set D to S if signed (D => S) D=S Signed (D < S) 1 4
010010 001i 1111 ddddddddd sssssssss MIN D,S Set D to S if unsigned (D < S) D=S Unsigned (D < S) 1 4
010011 001i 1111 ddddddddd sssssssss MAX D,S Set D to S if unsigned (D => S) D=S Unsigned (D < S) 1 4
010100 001i 1111 ddddddddd sssssssss MOVS D,S Insert S[8..0] into D[8..0] Result = 0 - 1 4
010101 001i 1111 ddddddddd sssssssss MOVD D,S Insert S[8..0] into D[17..9] Result = 0 - 1 4
010110 001i 1111 ddddddddd sssssssss MOVI D,S Insert S[8..0] into D[31..23] Result = 0 - 1 4
010111 001i 1111 ddddddddd sssssssss JMPRET D,S Insert PC+1 into D[8..0] and set PC to S[8..0] Result = 0 - 1 4
010111 000i 1111 --------- sssssssss JMP S Set PC to S[8..0] Result = 0 - 0 4
iiiiii zcri cccc ddddddddd sssssssss Instruction Description Z Result C Result R Clocks
010111 0011 1111 ????????? sssssssss CALL #S Like JMPRET, but assembler handles details Result = 0 - 1 4
010111 0001 1111 --------- --------- RET Like JMP, but assembler handles details Result = 0 - 0 4
011000 000i 1111 ddddddddd sssssssss TEST D,S AND S with D to affect flags only Result = 0 Parity of Result 0 4
011001 000i 1111 ddddddddd sssssssss TESTN D,S AND !S into D to affect flags only Result = 0 Parity of Result 0 4
011000 001i 1111 ddddddddd sssssssss AND D,S AND S into D Result = 0 Parity of Result 1 4
011001 001i 1111 ddddddddd sssssssss ANDN D,S AND !S into D Result = 0 Parity of Result 1 4
011010 001i 1111 ddddddddd sssssssss OR D,S OR S into D Result = 0 Parity of Result 1 4
011011 001i 1111 ddddddddd sssssssss XOR D,S XOR S into D Result = 0 Parity of Result 1 4
011100 001i 1111 ddddddddd sssssssss MUXC D,S Copy C to bits in D using S as mask Result = 0 Parity of Result 1 4
011101 001i 1111 ddddddddd sssssssss MUXNC D,S Copy !C to bits in D using S as mask Result = 0 Parity of Result 1 4
011110 001i 1111 ddddddddd sssssssss MUXZ D,S Copy Z to bits in D using S as mask Result = 0 Parity of Result 1 4
011111 001i 1111 ddddddddd sssssssss MUXNZ D,S Copy !Z to bits in D using S as mask Result = 0 Parity of Result 1 4
100000 001i 1111 ddddddddd sssssssss ADD D,S Add S into D Result = 0 Unsigned Carry 1 4
100001 001i 1111 ddddddddd sssssssss SUB D,S Subtract S from D Result = 0 Unsigned Borrow 1 4
100001 000i 1111 ddddddddd sssssssss CMP D,S Compare D to S D=S Unsigned Borrow 0 4
100010 001i 1111 ddddddddd sssssssss ADDABS D,S Add absolute S into D Result = 0 Unsigned Carry 1 1 4
100011 001i 1111 ddddddddd sssssssss SUBABS D,S Subtract absolute S from D Result = 0 Unsigned Borrow 2 1 4
100100 001i 1111 ddddddddd sssssssss SUMC D,S Sum either –S if C or S if !C into D Result = 0 Signed Overflow 1 4
100101 001i 1111 ddddddddd sssssssss SUMNC D,S Sum either S if C or –S if !C into D Result = 0 Signed Overflow 1 4
100110 001i 1111 ddddddddd sssssssss SUMZ D,S Sum either –S if Z or S if !Z into D Result = 0 Signed Overflow 1 4
100111 001i 1111 ddddddddd sssssssss SUMNZ D,S Sum either S if Z or –S if !Z into D Result = 0 Signed Overflow 1 4
101000 001i 1111 ddddddddd sssssssss MOV D,S Set D to S Result = 0 S[31] 1 4
101001 001i 1111 ddddddddd sssssssss NEG D,S Set D to –S Result = 0 S[31] 1 4
101010 001i 1111 ddddddddd sssssssss ABS D,S Set D to absolute S Result = 0 S[31] 1 4
101011 001i 1111 ddddddddd sssssssss ABSNEG D,S Set D to –absolute S Result = 0 S[31] 1 4
101100 001i 1111 ddddddddd sssssssss NEGC D,S Set D to either –S if C or S if !C Result = 0 S[31] 1 4
101101 001i 1111 ddddddddd sssssssss NEGNC D,S Set D to either S if C or –S if !C Result = 0 S[31] 1 4
101110 001i 1111 ddddddddd sssssssss NEGZ D,S Set D to either –S if Z or S if !Z Result = 0 S[31] 1 4
101111 001i 1111 ddddddddd sssssssss NEGNZ D,S Set D to either S if Z or –S if !Z Result = 0 S[31] 1 4
110000 000i 1111 ddddddddd sssssssss CMPS D,S Compare-signed D to S D=S Signed Borrow 0 4
110001 000i 1111 ddddddddd sssssssss CMPSX D,S Compare-signed-extended D to S+C Z & (D = S+C) Signed Borrow 0 4
110010 001i 1111 ddddddddd sssssssss ADDX D,S Add-extended S+C into D Z & (Result = 0) Unsigned Carry 1 4
110011 001i 1111 ddddddddd sssssssss SUBX D,S Subtract-extended S+C from D Z & (Result = 0) Unsigned Borrow 1 4
110011 000i 1111 ddddddddd sssssssss CMPX D,S Compare-extended D to S+C Z & (D = S+C) Unsigned Borrow 0 4
110100 001i 1111 ddddddddd sssssssss ADDS D,S Add-signed S into D Result = 0 Signed Overflow 1 4
110101 001i 1111 ddddddddd sssssssss SUBS D,S Subtract-signed S from D Result = 0 Signed Overflow 1 4
110110 001i 1111 ddddddddd sssssssss ADDSX D,S Add-signed-extended S+C into D Z & (Result = 0) Signed Overflow 1 4
110111 001i 1111 ddddddddd sssssssss SUBSX D,S Subtract-signed-extended S+C from D Z & (Result = 0) Signed Overflow 1 4
111000 001i 1111 ddddddddd sssssssss CMPSUB D,S Subtract S from D if D => S D=S Unsigned (D => S) 1 4
Dec D, jump if not zero to S (no jump = 8
111001 001i 1111 ddddddddd sssssssss DJNZ D,S Result = 0 Unsigned Borrow 1 4 or 8
clocks)
Test D, jump if not zero to S (no jump = 8
111010 000i 1111 ddddddddd sssssssss TJNZ D,S Result = 0 0 0 4 or 8
clocks)
111011 000i 1111 ddddddddd sssssssss TJZ D,S Test D, jump if zero to S (no jump = 8 clocks) Result = 0 0 0 4 or 8
111100 000i 1111 ddddddddd sssssssss WAITPEQ D,S Wait for pins equal - (INA & S) = D - - 0 5+
111101 000i 1111 ddddddddd sssssssss WAITPNE D,S Wait for pins not equal - (INA & S) != D - - 0 5+
111110 001i 1111 ddddddddd sssssssss WAITCNT D,S Wait for CNT = D, then add S into D - Unsigned Carry 1 5+
111111 000i 1111 ddddddddd sssssssss WAITVID D,S Wait for video peripheral to grab D and S - - 0 5+
------ ---- 0000 --------- --------- NOP No operation, just elapses 4 clocks - - - 4
* See Hub, section 4.4 on page 7.
1. ADDABS C out: If S is negative, C = the inverse of unsigned borrow (for D-S).
2. SUBABS C out: If S is negative, C = the inverse of unsigned carry (for D+S).
Validate previous instr/data fit below an < Boolean: Is less than (signed)
FIT 〈Address〉
address. > Boolean: Is greater than (signed)
Adjust compile-time cog address =< Boolean: Is equal or less (signed)
ORG 〈Address〉
pointer.
=> Boolean: Is equal or greater (signed)
〈Symbol〉 RES 〈Count〉 Reserve next long(s) for symbol.
@ Symbol address; unary
8.2. DC Characteristics
(Operating temperature range: -55° C < Ta < +125° C unless otherwise noted)
8.3. AC Characteristics
(Operating temperature range: -55°C < Ta < +125°C unless otherwise noted)
Current (A)
10
10
10
10
10
10
10
-6
-5
-4
-3
-2
-1
0
10
2
Hub Only
WAIT(CNT/PEQ/PNE)
Assembly Loops (JMP)
Spin Loops (REPEAT)
10
5
10
6
10
7
10
8
14
Spin Loop (REPEAT)
Assembly Loop (JMP)
12
WAIT(CNT/PEQ/PNE)
10
Current (mA)
0
0 10 20 30 40 50 60 70 80 90 100
Frequency (MHz)
1.3
1.2
1.1
Current (mA)
1.0
0.9
0.8
0.7
0.6
0.5
0.4
20 40 60 80 100 120 140 160
Frequency (MHz)
1.0
Current (mA)
0.8
0.6
0.4
0.2
0 5 10 15 20 25 30 35 40 45 50
Frequency (MHz)
P0
P31
P5
P6 P26
P24
P8
P9 P23
P10 P22
P21
P15
P16
Figure 9
Boot Sequence Current Profile for
no PC and no EEPROM (P31
held low and P29 not connected
(same as held low)).
Figure 10
Boot Sequence Current Profile for
PC (connected but idle) and no
EEPROM. (P31 held high and
P29 not connected).
Figure 11
Boot Sequence Current Profile for
no PC and no EEPROM (P31
held low and P29 held high).
Figure 12
Boot Sequence Current Profile for
no PC and EEPROM (P31 held
low and P29 connected to
EEPROM SDA).
Figure 13
Boot Sequence Current Profile for
PC (connected but idle) and
EEPROM (P31 held high and P29
connected to EEPROM SDA).
80
Spin
Waitloop
Assembly
70 waitloop
Spin
60
Current (mA)
50
40
30
20
10
0
-40 -20 0 20 40 60 80 100 120
Temperature (C)