English
Language : 

PXS20RM Datasheet, PDF (467/1368 Pages) Freescale Semiconductor, Inc – PXS20 Microcontroller
Enhanced Motor Control Timer (eTimer)
20.5.2.4 GATED-COUNT Mode
If the CNTMODE field is set to ‘011’, the counter will count while the selected secondary input signal is
high. This mode is used to time the duration of external events. If the selected input is inverted by setting
the PIPS bit, then the counter will count while the selected secondary input is low.
NOTE
In the following counting modes an incorrect counting of 1 tick is possible:
- GATED-COUNT mode, the CNTMODE field is '011' (count rising edges
of primary source while secondary input is high);
-SIGNED-COUNT mode, the CNTMODE field is '101' (count primary
source rising edges, secondary source specifies direction (up/down)).
Delays in the edge detection circuitry lead to behavior where the rising edge
on the primary source is compared to the secondary source value one clock
later in time. This means that if there is a rising edge on the primary source
followed immediately by the secondary source going high, the eTimer logic
could see this as a rising primary edge while the secondary is high even
though the secondary input was low at the time of the rising primary edge.
This behavior can occur when the transition on the secondary edge occurs
within 1 IPBus clock cycle of the transition on the primary input. The
counter will also increment if the primary source is already high when the
secondary source goes high.
To prevent this problem the source selected as the secondary input to the
eTimer channel needs to have an additional clock cycle of delay added to it.
This can be done by using the input filters. For the primary source set
FILT_PER==1 and FILT_CNT==0. For the secondary source set
FILT_PER==1 and FILT_CNT==1. This will introduce a 5 clock cycle
latency on the primary source and a 6 cycle latency on the secondary source
which will properly align the two signals for count modes '011' and '101'.
To prevent this problem ensure that the primary source is low before the
secondary source goes high to avoid a false count.
20.5.2.5 QUADRATURE-COUNT Mode
If the CNTMODE field is set to ‘100’, the counter will decode the primary and secondary external inputs
as quadrature encoded signals. Quadrature signals are usually generated by rotary or linear sensors used
to monitor movement of motor shafts or mechanical equipment. The quadrature signals are square waves
that are 90 degrees out of phase. The decoding of quadrature signal provides both count and direction
information.
Figure 20-24 shows a timing diagram illustrating the basic operation of a quadrature incremental position
encoder.
Freescale Semiconductor
PXS20 Microcontroller Reference Manual, Rev. 1
20-25