...the world's most energy friendly microcontrollers
2016-04-28 - Giant Gecko Family - d0053_Rev1.20
636
www.silabs.com
exceeds a certain level. These pulses are counted using an asynchronous counter and compared with
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. 636) 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 LFACLK
LESENSE
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
(prescalar value in AUXPRESC in TIMCTRL is 0).
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/
LFACLK
LESENSE
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
Summary of Contents for Giant Gecko EFM32GG
Page 842: ......