English
Language : 

EFM32WG Datasheet, PDF (628/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
the threshold in COMPTHRES in the CHx_EVAL register. If the number of pulses exceeds the threshold
level, the sensor is said to be active, otherwise it is inactive. Figure 25.12 (p. 628) illustrates how
the output pulses from the ACMP correspond to damping of the oscillations. The results from sensor
evaluation can automatically be fed into the decoder in order to keep track of rotations.
Figure 25.12. LC sensor oscillations
The following steps show how to configure LESENSE to scan through the four LC sensors 100 times
per second.
1. Assuming LFACLKLESENSE is 32kHz, set PCPRESC to 3 and PCTOP to 39 in CTRL. This will make
the LESENSE scan frequency 100Hz.
2. Enable the DAC and configure it to produce a voltage of Vdd/2.
3. Enable channels 0 through 3 in CHEN. Set IDLECONF for the active channels to DACOUT. The
channel pins should be set to Vdd/2 in the idle phase to damp the oscillations.
4. Configure the ACMP to use scaled Vdd as negative input, refer to ACMP chapter for details.
5. Enable and configure PCNT and asynchronous PRS.
6. Configure the GPIOs used as PUSHPULL.
7. Configure the following bit fields in CHx_CONF, for channels 0 through 3:
a. Set EXCLK to AUXHFRCO. AUXHFRCO is needed to achieve short excitation time.
b. Set EXTIME to an appropriate value. Excitation will last for EXTIME/AUXHFRCO seconds.
c. Set EXMODE to LOW. The LC sensors are excited by pulling the excitation pin low.
d. Set SAMPLE to COUNTER and COMP to LESS. Status of each sensor is evaluated based on the
number of pulses generated by the ACMP. If they are less than the threshold value, the sensor
is said to be active.
e. Set SAMPLEDLY to an appropriate value, each sensor will be measured for SAMPLEDLY/
LFACLKLESENSE seconds.
8. Set CTRTHRESHOLD to an appropriate value. If the sensor is active, the counter value after the
measurement phase should be less than the threshold. If it inactive, the counter value should be
greater than the threshold.
9. Start scan sequence by writing a 1 to START in CMD.
25.3.14.3 LESENSE decoder 1
The example below illustrates how the LESENSE module can be used for decoding using three sensors
Figure 25.13. FSM example 1
xx x
001
011
010
0
1
2
3
000
001
011
000 100
010 110
101
111
110
7
6
5
4
100
101
111
Sensor value
St at e Index
To set up the decoder to decode rotation using the encoding scheme seen in Figure 25.13 (p. 628)
, configure the following LESENSE registers:
2013-05-08 - Wonder Gecko Family - d0233_Rev0.50
628
www.energymicro.com