English
Language : 

SAM4L Datasheet, PDF (914/1185 Pages) ATMEL Corporation – ATSAM ARM-based Flash MCU
ATSAM4L4/L2
Capacitive changes can correspond to touch, proximity, out-of-touch, or events such as change
of power supply (ripple or ground shift). Fast changing environmental parameters can also affect
the touch measurements.
While the CATB can only measure and hold configuration and state for one sensor at the time,
the Peripheral DMA Controller can be used with a buffer in RAM to rotate sensor configuration
for the CATB. 20 bytes of RAM are then needed per sensor.
Figure 34-3. CATB Sensor Connections.
SENSE k
SENSE k
SENSE m
SENSE m
DIS
a)
b)
The CATB can operate in single-ended or differential mode. In single-ended mode, one pin and
one conductive area per sensor is required (Figure 34-3 a and b), selected in the PINSEL regis-
ter. When using external resistors in single-ended mode, a common discharge pin must be used
(Figure 34-3 a).
34.6.2
Basic Operation
Before configuring the CATB, the CATB interface must be enabled by writing a one to the
Access Enable bit in the Control Register (CR.EN). This enables writes to the CATB registers.
During the CATB operation, the CATB interface can be disabled by writing a zero to CR.EN to
save power and avoid accidental writes to the configuration registers.
The CATB is by default set up in single-ended mode with external resistors. The default source
for the acquisition clock is the dedicated RC oscillator. Refer to the Module Configuration Sec-
toin for configuration of oscillators.
The sample rate is selected by writing to the Counter Top Value field in the Count Control Regis-
ter (CNTCR.TOP) where
sample rate = ------------------1------------------- = -------------f--C----L--K---_---A---C---Q---------------
sample period α ⋅ TOP ⋅ REPEAT
For single-ended mode, α is 2, and for differential mode, 4. Note that CNTCR.TOP must be writ-
ten to a value such that the sample period is larger than the discharge time of the sensor,
determined by the product of the sensor capacitance and the discharge resistance.
Before touch can be captured, the Idle Smoothing Factor and Relative Level Smoothing Factor
time durations in the Filter Timing Register (TIMING.TIDLE and TIMING.TLEVEL) must be cho-
sen to match the CNTCR sample rate settings. TIMING.TIDLE and TIMING.TLEVEL are
fractional positive values less than one and determine how many seconds the filters should
42023C–SAM–02/2013
914