Control Register Fields

The CTRA and CTRB registers each contain four fields shown in the table below.

CTRA and CTRB Register Table

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


CTRMODE
The CTRMODE field of CTRA and CTRB selects one of 32 operating modes, shown in Table 2 7, for the corresponding Counter A or Counter B. In Propeller Assembly, the CTRMODE field can conveniently be written, along with PLLDIV, using the MOVI instruction.
The modes %00001 through %00011 cause FRQxtoPHSx, accumulation to occur every clock cycle. This creates a numerically controlled oscillator (NCO) in PHSx[31], which feeds the PLLx's reference input. The PLLx will multiply this frequency by 16 using its voltage-controlled oscillator (VCO). 
For stable operation, it is recommended that the VCO frequency be kept within 64 MHz to 128 MHz. This translates to an NCO frequency of 4 MHz to 8 MHz.

Unless otherwise noted, content on this site is licensed under the
Creative Commons Attribution-ShareAlike 4.0 International License.