28.3.6 Sensor Evaluation
When a measurement phase is completed, the sensor data is evaluated by the evaluation block. If the sensor data is taken from ACMP
sample in a single point in time (CHx_INTERACT_SAMPLE = ACMP), the evaluation is limited to determining if the sensor data is 0 or
1. For the other sample modes, there are three ways to do sensor evaluation; threshold comparison, sliding window, or step detection.
Evaluation mode is configured in CHx_EVAL_MODE.
If the evaluation of sensor data evaluates to true, the corresponding bit in the result register (SCANRES) is set. By configuring SETIF in
CHx_INTERACT, interrupt flags can also be set on SCANRES events.
Figure 28.7 Scan Result and Interrupt Generation on page 939
illustrates how the sensor data or ACMP sample is used for evaluation and interrupt generation.
Note:
For initialization purposes, SCANRES can be written by software. SCANRES should not be written while LESENSE is running (i.e., the
RUNNING bit in LESENSE_STATUS is high).
ACMP
sample
LESENSE
counter
ACMP
COUNTER,
ADC,
ADCDIFF
CHx_EVAL_SCANRESINV
>= COMPTHRES
< COMPTHRES
GE
LESS
CHx_EVAL_COMP
CHx_INTERACT_SAMPLE
NONE
LEVEL
POSEDGE
NEGEDGE
CHx_INTERACT_SETIF
0
Set
interrupt
flag
SCANRES[x]
SENSORSTATE*
THRES
SLIDINGWIN
CHx_EVAL_MODE
STEPDET
ADC data
COUNTER
ADC,
ADCDIFF
CHx_INTERACT_SAMPLE
Window state
STEP_UP/
STEP_DOWN
*In STEPDET mode, both step
direction and step/no step is stored
in SENSORSTATE
Figure 28.7. Scan Result and Interrupt Generation
The results from sensor data evaluation can be fed into the decoder through the SENSORSTATE register. In DUALSAMPLE mode,
results from both the sampled ACMPs will be stored in both SCANRES and SENSORSTATE.
28.3.6.1 Threshold Comparison
In threshold comparison mode, the sensor data is compared to a threshold configured in CHx_EVAL_COMPTHRES. There are two
modes of threshold comparison: 'less than' and 'greater than or equal'. Threshold comparison mode is configured in CHx_EVAL_COMP.
Reference Manual
LESENSE - Low Energy Sensor Interface
silabs.com
| Building a more connected world.
Rev. 1.1 | 939