14.3.8 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 of PCNTn_S0IN input. When this bit is set, the pulse counter counts negative edges in OVSSINGLE mode. Also,
when the EDGE bit is set in the OVSSINGLE and EXTCLKSINGLE modes, the PCNTn_S1IN input is inverted. In OVSQUAD 1X-4X
modes the EDGE bit inverts both inputs.
Note:
The EDGE bit in PCNTn_CTRL has no effect in EXTCLKQUAD mode.
14.3.9 PRS and PCNTn_S0IN,PCNTn_S1IN Inputs
It is possible to receive input from PRS on both PCNTn_S0IN (or PCNTn_S1IN) by setting S0PRSEN (or S1PRSEN) in PCNTn_INPUT.
The PRS channel used can be selected using S0PRSSEL (or S1PRSSEL) in PCNTn_INPUT.
In the Oversampling quadrature decoder modes, the input frequency should be less than 8KHz to ensure correct functionality.
PCNT module generates three PRS outputs the TCC PRS output, the CNT OF/UF PRS output and the CNT DIR PRS output. The TCC
PRS is generated on compare match of TCC event. The CNT OF/UF combined PRS is generated when the counter overflow or under-
flows. The CNT DIR PRS is a level PRS and indicates the current direction of count of counter CNT
Note:
S0PRSEN,S1PRSEN,S0PRSSEL,S1PRSSEL should only be altered when RSTEN in PCNTn_CTRL is set.
14.3.10 Interrupts
The interrupt generated by PCNT uses the PCNTn_INT interrupt vector. Software must read the PCNTn_IF register to determine which
module interrupt that generated the vector invocation.
14.3.10.1 Underflow and Overflow Interrupts
The underflow interrupt flag (UF) is set when the counter counts down from 0. I.e. when the value of the counter is 0 and a new pulse is
received. The PCNTn_CNT register is loaded with the PCNTn_TOP value after this event.
The overflow interrupt flag (OF) is set when the counter counts up from the PCNTn_TOP (reload) value. I.e. if PCNTn_CNT =
PCNTn_TOP and a new pulse is received. The PCNTn_CNT register is loaded with the value 0 after this event.
EFM32JG1 Reference Manual
PCNT - Pulse Counter
silabs.com
| Smart. Connected. Energy-friendly.
Preliminary Rev. 0.6 | 373