User manual

...the world's most energy friendly microcontrollers
2012-04-24 - Giant Gecko Family - d0053_Rev0.96 621
www.energymicro.com
Figure 25.4 (p. 621) illustrates the sequencing of the pin associated with the active channel and its
alternative excite pin.
Figure 25.4. Pin sequencing
EXCITE
LFACLK
LESENSE
Idle phase Excit e phase Idle phaseMeasure phase
IDLECONF EXMODE Z IDLECONF
Channel pin
IDLECONF
Alternate excite pin
IDLECONF EXMODE IDLECONF
Alternate excite pin
IDLECONF Z IDLECONF
Channel pin
ALTEX= 1
ALTEX= 0
The alternative excite pins, LES_ALTEXn, have the possibility to excite regardless of what channel is
active. Setting AEXn in ALTEXCONF will make LES_ALTEXn excite for all channels using alternative
excitation, i.e. ALTEX in CHx_INTERACT is set.
Note
When exciting on the pin associated with the active channel, the pin will go through a
tristated phase before returning to the idle configuration. This will not happen on pins used
as alternative excitation pins.
The pin configuration for the idle phase can be configured individually for each LESENSE channel and
alternative excite pin in the IDLECONF and ALTEXCONF registers. The modes available are the same
as the modes available in the excitation phase. In the measure phase, the pin mode on the active channel
is always disabled (analog input).
To enable LESENSE to control GPIO, the pin has to be enabled in the ROUTE register. In addition,
the given pin must be configured as push-pull. IDLECONF configuration should not be altered when pin
enable for the given pin is set in ROUTE.
25.3.5 Sensor evaluation
Sensor evaluation can be based on either analog comparator outputs, or the counter output. This is
configured in the SAMPLE bitfield in CHx_INTERACT. The LESENSE counter is used to count pulses
on the ACMP output in the measurement phase. When a measurement phase is completed, the counter
value is compared to the value configured in COMPTHRES in CHx_EVAL. By configuring COMP, it is
possible to choose comparison mode: Less than, or greater than or equal. If a comparison for a channel
triggers, the corresponding bit in the result register, SCANRES, is set. To set an interrupt flag on a sensor
event, configure SETIF in CHx_INTERACT. Figure 25.5 (p. 622) illustrates how the counter value or
ACMP sample is used for evaluation and interrupt generation.