...the world's most energy friendly microcontrollers
2014-07-02 - Tiny Gecko Family - d0034_Rev1.20
338
www.silabs.com
Figure 21.5. Scan result and interrupt generation
ACMP
sam ple
LESENSE
count er
ACMP
COUNTER
CHx _EVAL_SCANRESINV
COUNTER > = COMPTHRES
COUNTER < COMPTHRES
GE
LESS
CHx _EVAL_COMP
CHx _INTERACT_SAMPLE
NONE
LEVEL
POSEDGE
NEGEDGE
CHx _INTERACT_SETIF
0
Set
int errupt
flag
SCANRES[x ]
SENSORSTATE
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.
21.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 21.6 (p. 338) , 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 21.6 (p. 338)
.
Figure 21.6. Sensor scan and decode sequence
CH0
CH1
START
START
Scan period
Decode
CH2
CH3
CH0
CH1
Decode
CH2
CH3
CH0
result
-
-
-
CH0
result
CH1
result
-
-
CH0
result
CH1
result
CH2
result
-
CH0
result
CH1
result
CH2
result
CH3
result
SENSORSTATE[0]
SENSORSTATE[3]
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
Summary of Contents for EFM32TG
Page 543: ......