Datasheet
CY8C21x34/B CapSense
®
Design Guide Document No. 001-66271 Rev. *B 19
Figure 3-4. Raw Count, Baseline, Difference Count, and Sensor State
Difference Count
(Signal)
Raw Count
3.3.1 Raw Count
The hardware circuit in the CapSense controller measures the sensor capacitance. It stores the result in a digital form
called raw count upon calling the user module API UMname_ScanSensor(), where UMname can be CSD, CSDADC,
or SmartSense.
The raw count of a sensor is proportional to its sensor capacitance. Raw count increases as the sensor capacitance
value increases.
The raw count values of sensors are stored in the UMname_waSnsResult[] integer array. This array is defined in the
header file UMname.h.
3.3.2 Baseline
Gradual environmental changes such as temperature and humidity affect the sensor raw count, which results in
variations in the counts.
The user module uses a complex baselining algorithm is to compensate for these variations. The algorithm uses
baseline variables to accomplish this. The baseline variables keep track of any gradual variations in raw count values.
Essentially, the baseline variables hold the output of a digital low pass filter to which input raw count values are fed.
The baselining algorithm is executed by the user module API UMname_UpdateSensorBaseline, where UMname can
be CSD, CSDADC, or SmartSense.
The baseline values of sensors are stored in UMname_waSnsBaseline[] integer array. This array is defined in the
header file UMname.h.
3.3.3 Difference Count (Signal)
The Difference Count, which is also known as the signal of a sensor, is defined as the difference in counts between a
sensor’s raw count and baseline values. When the sensor is inactive, the Difference Count is zero. Activating sensors
(by touching) results in a positive Difference Count value.
The Difference Count values of sensors are stored in the UMname_waSnsDiff[] integer array, where UMname can be
CSD, SmartSense, or CSA_EMC. This array is defined in the header file UMname.h.
Difference count variables are updated by the user module API UMname_UpdateSensorBaseline()..
3.3.4 Sensor State
Sensor state represents the active/inactive status of the physical sensors. The state of the sensor changes from 0 to
1 upon finger touch and returns to 0 upon finger release.
Sensor states are stored in a byte array named UMname_baSnsOnMask[]array, where UMname can be CSD,
CSDADC, or SmartSense. Each array element stores the sensor state of eight consecutive sensors.