Propeller Manual

Table Of Contents
CTRA, CTRB – Spin Language Reference
state machine. Since the counter’s update period may be brief (12.5 ns at 80 MHz), very
dynamic signal generation and measurement is possible.
Control Register Fields
The
CTRA and CTRB registers each contain four fields shown in the table below.
Table 2-5: CTRA and CTRB Registers
31 30..26 25..23 22..15 14..9 8..6 5..0
- CTRMODE PLLDIV - BPIN - APIN
APIN
The APIN field of
CTRA selects a primary I/O pin for that counter. May be ignored if not
used. %0xxxxx = Port A, %1xxxxx = Port B (reserved for future use). In Propeller
Assembly, the APIN field can conveniently be written using the
MOVS instruction.
Note that writing a zero to
CTRA will immediately disable the Counter A and stop all related
pin output and
PHSA accumulation.
BPIN
The BPIN field of
CTRx selects a secondary I/O pin for that counter. This field may be
ignored if not used. %0xxxxx = Port A, %1xxxxx = Port B (reserved for future use). In
Propeller Assembly, the BPIN field can conveniently be written using the
MOVD instruction.
PLLDIV
The PLLDIV field of
CTRx selects a PLLx output tap, see table below. This determines which
power-of-two division of the VCO frequency will be used as the final PLLx output (a range
of 500 KHz to 128 MHz). This field may be ignored if not used. In Propeller Assembly, the
PLLDIV field can conveniently be written, along with CTRMODE, using the
MOVI
instruction.
Table 2-6: PLLDIV Field
PLLDIV
%000 %001 %010 %011 %100 %101 %110 %111
Output VCO ÷ 128 VCO ÷ 64 VCO ÷ 32 VCO ÷ 16 VCO ÷ 8 VCO ÷ 4 VCO ÷ 2 VCO ÷ 1
Page 96 · Propeller Manual v1.1