Propeller Manual

Table Of Contents
SPR – Spin Language Reference
SPR
Register: Special Purpose Register array; provides indirect access to cog’s special registers.
((PUB PRI))
SPR [Index]
Returns: Value in special purpose register at Index.
Index is an expression that specifies the index (0-15) of the special purpose register to
access (
PAR through VSCL).
Explanation
SPR is an array of the 16 special purpose registers in the cog. Element 0 is the PAR register
and element 15 is the
VSCL register. See Table 2-15 below. SPR provides an indirect method
of accessing the cog’s special purpose registers.
Table 2-15: Cog RAM Special Purpose Registers
Name Index Type Description
PAR 0
Read-Only Boot Parameter
CNT 1
Read-Only System Counter
INA 2
Read-Only Input States for P31 - P0
INB 3
Read-Only Input States for P63- P32
1
OUTA 4
Read/Write Output States for P31 - P0
OUTB 5
Read/Write Output States for P63 – P32
1
DIRA 6
Read/Write Direction States for P31 - P0
DIRB 7
Read/Write Direction States for P63 - P32
1
CTRA 8
Read/Write Counter A Control
CTRB 9
Read/Write Counter B Control
FRQA 10
Read/Write Counter A Frequency
FRQB 11
Read/Write Counter B Frequency
PHSA 12
Read/Write Counter A Phase
PHSB 13
Read/Write Counter B Phase
VCFG 14
Read/Write Video Configuration
VSCL 15
Read/Write Video Scale
Note 1: Reserved for future use
Page 200 · Propeller Manual v1.1