14.3.1.5 Oversampling Quadrature Decoder Mode
There are three Oversampling Quadrature Decoder Modes supported: 1X , 2X and 4X. These modes are enabled by writing OVS-
QUAD1X, OVSQUAD2X and OVSQUAD4X, respectively, to the MODE field in PCNTn_CTRL and disabled by writing DISABLE to the
same field. The LFACLK clock source to the pulse counter must be configured by clearing PCNT0CLKSEL in the CMU_PCNTCTRL in
the Clock Management Unit (CMU),
10. CMU - Clock Management Unit
The optional pulse width filter is enabled by setting the FILT bit in the PCNTn_CTRL register. The filter applies to both inputs
PCNTn_S0IN and PCNTn_S1IN. The filter length is configured by FILTLEN in PCNTn_OVSCFG register.
Based on the modes selected, the decoder updates the counter on different events. In the OVSQUAD1X mode, the counter is updated
on the rising edge of the PCNTn_S0IN input when counting up, and on the negedge of the PCNTn_S0IN input when counting down. In
the OVSQUAD2X mode, the counter is updated on both edges of PCNTn_S0IN input. In the OVSQUAD4X mode the counter is upda-
ted on both edges of both inputs PCNTn_S0IN and PCNTn_S1IN.
Table 14.2 PCNT OVSQUAD 1X, 2X and 4X Mode Counter Control
outlines the increment or decrement of the counter based on the Quadrature Mode selected.
Note:
The decoding behavior of OVSQUAD1X mode is slightly different compared to EXTCLKQUAD mode(also 1X mode). In the EX-
TCLKQUAD mode, the counter is updated only on the posedge of S0IN input. However, in the OVSQUAD1X mode, the counter is up-
dated on the posedge of S0IN when counting up and on the negedge of S0IN when counting down.
Table 14.2. PCNT OVSQUAD 1X, 2X and 4X Mode Counter Control Function
Direction
Previous State
Next State
OVSQUAD MODE
S1IN
S0IN
S1IN
S0IN
1X
2X
4X
Clockwise
0
0
0
1
+1
+1
+1
0
1
1
1
+1
1
1
1
0
+1
+1
1
0
0
0
+1
Counter Clock-
wise
1
0
1
1
-1
-1
1
1
0
1
-1
0
1
0
0
-1
-1
-1
0
0
1
0
-1
Figure 14.3 PCNT State transitions for different Oversampling Quadrature Decoder Modes on page 367
illustrates the different states
of the quadrature input and the state transitions that updates the counter for the different modes. Each cycle of the input states results
in 1 update, 2 updates and 4 updates of the counter for OVSQUAD1X, OVSQUAD2X and OVSQUAD4X modes respectively.
EFM32JG1 Reference Manual
PCNT - Pulse Counter
silabs.com
| Smart. Connected. Energy-friendly.
Preliminary Rev. 0.6 | 366