CO1 Counter Add-On
ADwin
28
ADwin-Gold
USB / ENET, manual version 3.8, October 2005
8.3.2 Four Edge Evaluation
This mode determines clock and direction of two signals, which are phase-
shifted by 90 degrees to the inputs A and B. The count direction is determined
by the temporal sequence of the rising and falling edges of the two input sig-
nals.
Fig. 22 – Block diagram of the
CO1
add-on in the mode
"four edge evaluation"
Please note:
– The counter counts 4 edges in one cycle of the A/B signal.
– The maximum count frequency is 20 MHz. Together with the 4 edges
per cycle it will result in a maximum input frequency of 5 MHz.
– The time between an edge at A and an edge at B must not be shorter
than 50 ns. Impulse widths or pause durations shorter than 100 ns are
not incremented.
– Changing the phase-shift will have an effect on the maximum input fre-
quency. If it differs from 90 degrees, the maximum input frequency of
5 MHz decreases for instance to 45 degrees at 2.5 MHz.
Programming example
Control Registers
32 bit Counter
32 bit Latch A
CLK
EN
CLR
A
ADwin-GOLD
bus
Data
Data
B
CLR
DIR
4-edge
evaluation
DIR
CNT
_CLE
A
R
CNT
_E
NA
B
L
E
CNT
_LA
T
C
H
4k7
4k7
4k7
initialization ...
disable counters
clear counter(s)
external clock input (CLK)
activate mode "four edge evaluation"
input CLR/LATCH as CLR input
select single-ended inputs
CNT_ENABLE(1)
INIT:
CNT_ENABLE(0)
CNT_CLEAR(1)
CNT_MODE(0)
CNT_INPUTMODE(0)
CNT_SE_DIFF(0)
CNT_SET(0)
. . .
enable counter(s)
EVENT:
CNT_READLATCH(1)
. . .
CNT_LATCH(1)
current counter value to latch A
read out latch A
evaluate counter value in process
event loop ...