English
Language : 

EFM32WG Datasheet, PDF (601/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
24 PCNT - Pulse Counter
0123 4
Reload value
0
In t er r u p t
Quadrat ure code
What?
Quick Facts
The Pulse Counter (PCNT) decodes
incoming pulses. The module has a
quadrature mode which may be used
to decode the speed and direction of a
mechanical shaft. PCNT can operate in EM0-
EM3.
Why?
The PCNT generates an interrupt after a
specific number of pulses (or rotations),
eliminating the need for timing- or I/O
interrupts and CPU processing to measure
pulse widths, etc.
How?
PCNT uses the LFACLK or may be externally
clocked from a pin. The module incorporates
an 8/16-bit up/down-counter to keep track of
incoming pulses or rotations.
24.1 Introduction
The Pulse Counter (PCNT) can be used for counting incoming pulses on a single input or to decode
quadrature encoded inputs. It can run from the internal LFACLK (EM0-EM2) while counting pulses on
the PCNTn_S0IN pin or using this pin as an external clock source (EM0-EM3) that runs both the PCNT
counter and register access.
24.2 Features
• 16/8-bit counter with reload register
• Auxiliary counter for counting a single direction
• Single input oversampling up/down counter mode (EM0-EM2)
• Externally clocked single input pulse up/down counter mode (EM0-EM3)
• Externally clocked quadrature decoder mode (EM0-EM3)
• Interrupt on counter underflow and overflow
• Interrupt when a direction change is detected (quadrature decoder mode only)
• Optional pulse width filter
• Optional input inversion/edge detect select
• PRS S0IN and S1IN input
24.3 Functional Description
An overview of the PCNT module is shown in Figure 24.1 (p. 602) .
2013-05-08 - Wonder Gecko Family - d0233_Rev0.50
601
www.energymicro.com