English
Language : 

EFM32WG Datasheet, PDF (603/834 Pages) List of Unclassifed Manufacturers – The EFM32WG Wonder Gecko is the ideal choice for demanding 8-, 16-, and 32-bit energy sensitive applications.
...the world's most energy friendly microcontrollers
The digital pulse width filter is not available in this mode. The analog de-glitch filter in the GPIO pads
is capable of removing some unwanted noise. However, this mode may be susceptible to spikes and
unintended pulses from devices such as mechanical switches, and is therefore most suited to take input
from electronic sensors etc. that generate single wire pulses.
24.3.1.3 Externally Clocked Quadrature Decoder Mode
This mode is enabled by writing EXTCLKQUAD to the MODE field in PCNTn_CTRL and disabled by
writing DISABLE to the same field. The external pin clock source must be configured from the registers
in the CMU, (Chapter 11 (p. 124) ).
Both edges on PCNTn_S0IN pin are used to sample PCNTn_S1IN pin to decode the quadrature code.
Consequently, this mode does not depend on the internal LFACLK and may be operated in EM3. A
quadrature coded signal contains information about the relative speed and direction of a rotating shaft
as illustrated by Figure 24.2 (p. 603) , hence the direction of the counter register PCNTn_CNT is
controlled automatically.
Figure 24.2. PCNT Quadrature Coding
Clockwise direct ion
Reset
1 cycle/sector, 4 states
00 10 11 01
PCNTn _S0 IN
PCNTn _S1 IN
PCNTn _CNT
0
0
1
2
Count er clockwise
direction
1 cycle/sector, 4 states
00 01 11 10
PCNTn _S0 IN
PCNTn _S1 IN
PCNTn _CNT
0
0
PCNTn _TOP
PCNTn _TOP-1
X = sensor position
If PCNTn_S0IN leads PCNTn_S1IN in phase, the direction is clockwise, and if it lags in phase the
direction is counter-clockwise. Although the direction is automatically detected, the detected direction
may be inverted by writing 1 to the EDGE bit in the PCNTn_CTRL register. Default behavior is illustrated
by Figure 24.2 (p. 603) .
The counter direction may be read from the DIR bit in the PCNTn_STATUS register. Additionally, the
DIRCNG interrupt in the PCNTn_IF register is generated when a direction change is detected. When a
change is detected, the DIR bit in the PCNTn_STATUS register must be read to determine the current
new direction.
Note
The sector disc illustrated in the figure may be finer grained in some systems. Typically,
they may generate 2-4 PCNTn_S0IN wave periods per 360° rotation.
2013-05-08 - Wonder Gecko Family - d0233_Rev0.50
603
www.energymicro.com