English
Language : 

EFM32WG Datasheet, PDF (622/834 Pages) List of Unclassifed Manufacturers – The EFM32WG Wonder Gecko is the ideal choice for demanding 8-, 16-, and 32-bit energy sensitive applications.
...the world's most energy friendly microcontrollers
Figure 25.5. Scan result and interrupt generation
ACMP
sam ple
CHx _EVAL_SCANRESINV
ACMP
SCANRES[ x]
NEGEDGE
COUNTER > = COMPTHRES
GE
LESENSE
counter
COUNTER < COMPTHRES
LESS
COUNTER
CHx _INTERACT_SAMPLE
SENSORSTATE
POSEDGE
LEVEL
Set
interrupt
flag
0
NONE
CHx _EVAL_COMP
CHx _INTERACT_SETIF
LESENSE includes the possibility to sample both analog comparators simultaneously, effectively cutting
the time spent on sensor interaction in some applications in half. Setting DUALSAMPLE in CTRL enables
this mode. In dual sample mode, the channels of ACMP0 are paired together with the corresponding
channel on ACMP1, i.e. channel x on ACMP0 and channel x on ACMP1 are sampled simultaneously.
The results from sensor measurements can be fed into the decoder register and/or stored in the result
buffer. In this mode, the samples from the AMCPs are placed in the two LSBs of the result stored in the
result buffer. Results from both ACMPs will be evaluated for interrupt generation.
25.3.6 Decoder
Many applications require some sort of processing of the sensor readings, for instance in the case of
quadrature decoding. In quadrature decoding, the sensors repeatedly pass through a set of states which
corresponds to the position of the sensors. This sequence, and many other decoding schemes, can be
described as a finite state machine. To support this type of decoding without CPU intervention, LESENSE
includes a highly configurable decoder, capable of decoding input from up to four sensors. The decoder
is implemented as a programmable state machine with up to 16 states. When doing a sensor scan,
the results from the sensors are placed in the decoder input register, SENSORSTATE, if DECODE in
CHx_INTERACT is set. The resulting position after a scan is illustrated in Figure 25.6 (p. 622) , where
the bottom blocks show how the SENSORSTATE register is filled. When the scan sequence is complete,
the decoder evaluates the state of the sensors chosen for decoding, as depicted in Figure 25.6 (p. 622)
.
Figure 25.6. Sensor scan and decode sequence
START
Scan period
CH0 CH1 CH2 CH3 Decode
SENSORSTATE[ 0]
SENSORSTATE[ 3]
CH0
result
-
-
-
CH0
result
CH1
result
-
-
CH0
result
CH1
result
CH2
result
-
CH0
result
CH1
result
CH2
result
CH3
result
START
CH0 CH1 CH2 CH3 Decode
CH0
result
CH1
result
CH2
result
CH3
result
CH0
result
CH1
result
CH2
result
CH3
result
CH0
result
CH1
result
CH2
result
CH3
result
CH0
result
CH1
result
CH2
result
CH3
result
The decoder is a programmable state machine with support for up to 16 states. The behavior of each
state is individually configured in the STx_TCONFA and STx_TCONFB registers. The registers define
possible transitions from the present state. If the sensor state matches COMP in either STx_TCONFA
or STx_TCONFB, a transition to the state defined in NEXTSTATE will be made. It is also possible to
mask out one or more sensors using the MASK bit field. The state of a masked sensor is interpreted
as don't care.
2013-05-08 - Wonder Gecko Family - d0233_Rev0.50
622
www.energymicro.com