English
Language : 

EFM32WG Datasheet, PDF (605/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
As the auxiliary counter, the main counter can be configured to count only on certain events. This is
done through CNTEV in PCNTn_CTRL, and it is possible like for the auxiliary counter, to make the
main counter count on only up and down events. The difference between the counters is that where the
auxiliary counter will only count up, the main counter will count up or down depending on the direction
of the count event.
24.3.4 Register Access
The counter-clock domain may be clocked externally. To update the counter-clock domain registers
from software in this mode, 2-3 clock pulses on the external clock are needed to synchronize accesses
to the externally clocked domain. Clock source switching is controlled from the registers in the CMU
(Chapter 11 (p. 124) ).
When the RSTEN bit in the PCNTn_CTRL register is set to 1, the PCNT clock domain is asynchronously
held in reset. The reset is synchronously released two PCNT clock edges after the RSTEN bit in the
PCNTn_CTRL register is cleared by software. This asynchronous reset restores the reset values in
PCNTn_TOP, PCNTn_CNT and other control registers in the PCNT clock domain.
Since this module is a Low Energy Peripheral, and runs off a clock which is asynchronous to
the HFCORECLK, special considerations must be taken when accessing registers. Please refer to
Section 5.3 (p. 21) for a description on how to perform register accesses to Low Energy Peripherals.
Note
PCNTn_TOP and PCNTn_CNT are read-only registers. When writing to PCNTn_TOPB,
make sure that the counter value, PCNTn_CNT, can not exceed the value written to
PCNTn_TOPB within two clock cycles.
24.3.5 Clock Sources
The 32 kHz LFACLK is one of two possible clock sources. The clock select register is described in
Chapter 11 (p. 124) . The default clock source is the LFACLK.
This PCNT module may also use PCNTn_S0IN as an external clock to clock the counter
(EXTCLKSINGLE mode) and to sample PCNTn_S1IN (EXTCLKQUAD mode). Setup, hold and max
frequency constraints for PCNTn_S0IN and PCNTn_S1IN for these modes are specified in the device
datasheet.
To use this module, the LE interface clock must be enabled in CMU_HFCORECLKEN0, in addition to
the module clock.
Note
PCNT Clock Domain Reset, RSTEN, should be set when changing clock source for PCNT.
If changing to an external clock source, the clock pin has to be enabled as input prior to de-
asserting RSTEN. Changing clock source without asserting RSTEN results in undefined
behaviour.
24.3.6 Input Filter
An optional pulse width filter is available in OVSSINGLE mode. The filter is enabled by writing 1 to the
FILT bit in the PCNTn_CTRL register. When enabled, the high and low periods of PCNTn_S0IN must
be stable for 5 consecutive clock cycles before the edge is passed to the edge detector.
In EXTCLKSINGLE and EXTCLKQUAD mode, there is no digital pulse width filter available.
24.3.7 Edge Polarity
The edge polarity can be set by configuring the EDGE bit in the PCNTn_CTRL register. When this bit
is cleared, the pulse counter counts positive edges in OVSSINGLE mode and negative edges if the bit
is set.
2013-05-08 - Wonder Gecko Family - d0233_Rev0.50
605
www.energymicro.com