English
Language : 

C8051F960-B-GM Datasheet, PDF (320/492 Pages) Silicon Laboratories – Ultra Low Power 128K, LCD MCU Family
C8051F96x
25.10.2. Flutter Detection
The flutter detection can be used with either quadrature counter mode or dual counter mode when the two
inputs are expected to be in step. Flutter refers to the case where one input continues toggling while the
other input stops toggling. This may indicate a broken reed switch or a pressure oscillation when the wheel
magnet stops at just the right distance from the reed switch. If a pressure oscillation causes a slight rota-
tional oscillation in the wheel, it could cause a number of pulses on one of the inputs, but not on the other.
All four edges are checked by the flutter detection feature (PC1 positive, PC1 negative, PC0 positive, and
PC0 negative).When enabled, Flutter detection may be used as an interrupt or wake-up source.
0 +1
+2
+3
+4
PC1
PC0
Next expected pulse
Next expected pulse with direction change
Figure 25.5. Flutter Example
Flutter detected
For example, flutter detected on the PC0 positive edge means that 4 edges (positive or negative) were
detected on PC1 since the last PC0 positive edge. Each PC0 positive edge resets the flutter detection
counter while either PC1 edge increments the counter. There are similar counters for all four edges.
The flutter detection circuit provides interrupts or wake-up sources, but firmware must also read the Pulse
Counter registers to determine what corrective action, if any, must be taken.
On the start of flutter event, the firmware should save both counter values and the PC0HIST register. Once
the end of flutter event occurs the firmware should also save both counter values and the PC0HIST regis-
ter. The stop count on flutter, STPCNTFLTR (PCMD[2]), be used to stop the counters when flutter is occur-
ring (quadrature mode only). For quadrature mode, the opposite counter should be decremented by one.
In other words, if the direction was clock-wise, the counter clock-wise counter (counter 1) should be decre-
mented by one to correct for one increment before flutter was detected. For dual mode, two reed switches
can be used to get a redundant count. If flutter starts during dual mode, both counters should be saved by
firmware. After flutter stops, both counters should be read again. The counter that incremented the most
was the one that picked up the flutter. There is also a mode to switch from quadrature to dual (PC0MD[1])
when flutter occurs. This changes the counter style from quadrature (count on any edge of PC1 or PC0) to
dual to allow all counts to be recorded. Once flutter ends, this mode switches the counters back to quadra-
ture mode. STPCNTFLTR does not function when PC0MD[1] is set.
320
Rev. 1.0