English
Language : 

SAM4L Datasheet, PDF (915/1185 Pages) ATMEL Corporation – ATSAM ARM-based Flash MCU
ATSAM4L4/L2
average over. They should equal
------------------------2-------------------------
T ⋅ sample rate + 1
with typical T values being 5s for TIMING.TIDLE, and 0.1s for TIMING.TLEVEL.
Because the Idle Tracker is used to bias the measured values around zero, IDLE needs to be
initialized with an appropriate value in order to avoid saturation of the filter. This value can either
be obtained experimentally and stored in the application, or by writing a one to the Initialize Idle
bit (CR.IIDLE) when the sensor is not touched, which causes IDLE to be loaded with the next
measured value. CR.IIDLE is automatically cleared by hardware when this is done.
The CATB can perform acquisition on an array of selectable SENSE pins. The user selects pins
in the Pin Select Register (PINSEL). SENSE[m] is selected by writing the value m to PINSEL.
To enable CATB touch acquisition, the configuration registers should be loaded with application
and sensor specific settings. Writing a one to the Start Operation bit (CR.RUN) starts conversion
and touch data is available when bits in the Interrupt Status Register are set, optionally generat-
ing interrupts. Do not change settings during CATB operation (CR.RUN is one).
When an acquisition is done and a new sample is ready, the Sample Ready bit in the Interrupt
Status register (ISR.SAMPLE) is set. Note that an overflow can occur if the CATB sample rate is
higher than the CPU’s capability to read the data. The CATB will not report such overflows, and
the user should check and verify the expected data rate with a timer.
34.6.3
Differential Mode
The CATB can be configured to work in differential mode, where sensing is done on two conduc-
tive sensors. In this mode, both the mutual capacitance between the two sensors and the
common capacitance is measured. In single-ended mode, only the common capacitance is
measured.
The differential mode is enabled by writing a one to the Differential Mode bit in the Control Reg-
ister (CR.DIFF). In differential mode, two pins and two conductive areas per sensor are required
(Figure 34-3 a and b). Two pins will be used, SENSE[m] and SENSE[m+1], selected by writing
m to PINSEL.
Figure 34-4. CATB Sensor Connection, Differential Mode
SENSE m
SENSE m
SENSE m+1
SENSE m + 1
a)
b)
34.6.4
Thresholding
In order for the CATB to autonomously report touch, a threshold value must be written to the
Threshold Register (THRESH). The threshold value consists of an integer part
42023C–SAM–02/2013
915