Pulse Counter

PCNT – Pulse Counter

Quick Facts

What?

The Pulse Counter is available in Energy Mode 0 to Energy Mode 3 and decodes incoming pulses. The module has a quadrature mode which may be used to decode the speed and direction of a rotating mechanical shaft.

Why?

The PCNT generates an interrupt after a specific number of pulses (or rotations) are detected, eliminating the need for timing- or I/O interrupts and CPU processing.

How?

PCNT uses the 32kHz clock or may be externally clocked from a pin. The module incorporates a 16-bit up/down-counter to keep track of incoming pulses or rotations. The Pulse Counter can be used for counting pulses on a single input or to decode quadrature encoded inputs. It runs off either the internal LFACLK or the PCNTn_S0IN pin as external clock source. The module may operate in energy mode EM0 – EM3.