C161U
General Purpose Timer Unit
Preliminary Data Sheet
227
02.2000
PRELIMINARY
PRE
LI
M
INAR
Y
- E
XCE
RP
T
-
to convert the encoder’s differential outputs (e.g. A, A) to digital signals (e.g. A). This
greatly increases noise immunity.
Note: The third encoder output T0, which indicates the mechanical zero position, may
be connected to an external interrupt input and trigger a reset of timer T3.
Figure 65
Interfacing the Encoder to the Microcontroller
For incremental interface operation the following conditions must be met:
l
Bitfield T3M must be ’110
B’ or ‘111B’.
l
Pins associated to lines T3IN and T3EUD must be configured as input.
l
Bit T3UDE must be ’1’ to enable automatic direction control.
The maximum input frequency which is allowed in incremental interface mode is fTimer/8
(FM = 1). To ensure that a transition of any input signal is correctly recognized, its level
should be held high or low for at least 4 fTimer cycles (FM = 1) before it changes.
In Incremental Interface Mode the count direction is automatically derived from the
sequence in which the input signals change, which corresponds to the rotation direction
of the connected sensor. The table below summarizes the possible combinations.
The figures below give examples of T3’s operation, visualizing count signal generation
and direction control. It also shows how input jitter is compensated which might occur if
the sensor rests near to one of its switching points.
Table 37
Core Timer T3 (Incremental Interface Mode) Input Edge Selection
T3I
Triggering Edge for Counter Increment / Decrement
0 0 0
None. Counter T3 stops.
0 0 1
Any transition (rising or falling edge) on T3IN.
0 1 0
Any transition (rising or falling edge) on T3EUD.
0 1 1
Any transition (rising or falling edge) on any T3 input (T3IN or T3EUD).
1 X X
Reserved. Do not use this combination
A
B
T0
A
B
T0
External
T3input
Interrupt
Encoder
Signal Conditioning
+
-
+
-
+
-
Micro-
controller