English
Language : 

EFM32WG Datasheet, PDF (627/834 Pages) List of Unclassifed Manufacturers – The EFM32WG Wonder Gecko is the ideal choice for demanding 8-, 16-, and 32-bit energy sensitive applications.
Figure 25.10. Capacitive sense setup
ACMP0 _CH0
EFM3 2
ACMP0 _CH1
ACMP0 _CH2
ACMP0 _CH3
...the world's most energy friendly microcontrollers
The following steps show how to configure LESENSE to scan through the four buttons 100 times per
second, issuing an interrupt if one of them is pressed.
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 channels 0 through 3 in CHEN and set IDLECONF for these channels to DISABLED. In
capacitive sense mode, the GPIO should always be disabled (analog input).
3. Configure the ACMP to operate in CAPSENSE mode, refer to Section 26.3.5 (p. 664) for details.
4. Configure the following bit fields in CHx_CONF, for channels 0 through 3:
a. Set EXTIME to 0. No excitation is needed in this mode.
b. Set SAMPLE to COUNTER and COMP to LESS. This makes LESENSE interpret a sensor as
active if the frequency on a channel drops below the threshold, i.e. the button is pressed.
c. Set SAMPLEDLY to an appropriate value, each sensor will be measured for SAMPLEDLY/
LFACLKLESENSE seconds. MEASUREDLY should be set to 0
5. Set CTRTHRESHOLD to an appropriate value. An interrupt will be issued if the counter value for a
sensor is below this threshold after the measurement phase.
6. Enable interrupts on channels 0 through 3.
7. Start scan sequence by writing a 1 to START in CMD.
In a capacitive sense application, it might be required to calibrate the threshold values on a periodic
basis, this is done in order to compensate for humidity and other physical variations. LESENSE is able
to store up to 16 counter values from a configurable number of channels, making it possible to collect
sample data while in EM2. When calibration is to be performed, the CPU only has to be woken up for a
short period of time as the data to be processed already lies in the result registers. To enable storing of
the count value for a channel, set STRSAMPLE in the CHx_INTERACT register.
25.3.14.2 LC sensor
Figure 25.11 (p. 627) below illustrates how the EFM32WG can be set up to monitor four LC sensors.
Figure 25.11. LC sensor setup
D AC0 _OUT0
EFM3 2
ACMP0 _CH0
ACMP0 _CH1
ACMP0 _CH2
ACMP0 _CH3
X
X
X
X
LESENSE can be used to excite and measure the damping factor in LC sensor oscillations. To measure
the damping factor, the ACMP can be used to generate a high output each time the sensor voltage
exceeds a certain level. These pulses are counted using an asynchronous counter and compared with
2013-05-08 - Wonder Gecko Family - d0233_Rev0.50
627
www.energymicro.com