![Silicon Laboratories EFR32xG14 Wireless Gecko Reference Manual Download Page 455](http://html1.mh-extra.com/html/silicon-laboratories/efr32xg14-wireless-gecko/efr32xg14-wireless-gecko_reference-manual_1271728455.webp)
16.3.3 Auxiliary Counter
To be able to keep explicit track of counting in one direction in addition to the regular counter which counts both up and down, the
auxiliary counter can be used. The pulse counter can, for instance, be configured to keep track of the absolute rotation of the wheel,
while at the same time the auxiliary counter can keep track of how much the wheel has reversed.
The auxiliary counter is enabled by configuring AUXCNTEV in PCNTn_CTRL. It will always count up, but it can be configured whether it
should count up on up-events, down-events or both, keeping track of rotation either way or general movement. The value of the auxili-
ary counter can be read from the PCNTn_AUXCNT register.
Overflows on the auxiliary counter happen when the auxiliary counter passes the top value of the pulse counter, configured in
PCNTn_TOP. In that event, the AUXOF interrupt flag is set, and the auxiliary counter wraps to 0.
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 differ-
ence 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.
Reference Manual
PCNT - Pulse Counter
silabs.com
| Building a more connected world.
Rev. 1.1 | 455