Sensoray 526 User Manual

Page 8

Advertising
background image

8

quadrature x2 (both edges of CLKA);

quadrature x4 (both edges of both CLKA and CLKB);


In normal mode the clock sources are:

CLKA

;

CLKA

;

Internal clock (27 MHz);

Internal clock divided by 2 (13.5 MHz).

Count direction (up or down) is set through the software (normal mode) or determined from
CLKA-CLKB phase relationship (quadrature mode).

Count is enabled either through the software, or with the external signal. Possible sources of
Count Enable signal are:

CEN;

INDEX;

INDEX

to INDEX

(count does not start until the rising edge of INDEX signal);

NOT RCAP (see the description of RCAP signal below).

The polarity of Count Enable signal can be inverted through the software.


Captured Events

The counter detects or generates the following “short” events:

RO – rollover, counter overflow (when counting up) or underflow (when counting down);

INDEX

- rising edge of INDEX signal;

INDEX

- falling edge of INDEX signal;

ERROR – illegal quadrature state transition.

“Short” events can generate interrupts, if enabled.

To facilitate reliable detection by the software, the “short” events are captured (see Fig.2), thus
generating corresponding captured events:

RCAP – captured RO signal;

ICAP+ - captured rising edge of INDEX signal;

ICAP- - captured falling edge of INDEX signal;

ECAP – captured ERROR signal.

Captured events status can be read and reset through the Control/Status Register.

Additionally, RO generates RTGL – a signal which toggles each time rollover is generated.


Output Signals

The following signals can be routed to the counter output signal (COUT):

RCAP;

RTGL.

The polarity of COUT signal can be inverted through the software.


Counter Preload

Each counter has 2 preload registers accessible individually through the software, PR0 and PR1.
The counter is loaded from a preload register under software control (from PR0), or
automatically. The preload register from which the counter is loaded in automatic mode is

Advertising