English
Language : 

SAM4L Datasheet, PDF (917/1185 Pages) ATMEL Corporation – ATSAM ARM-based Flash MCU
ATSAM4L4/L2
The RAWn and RAWn – 1 values can be observed in the RAWA and RAWB fields respectively in
the RAW register. These values can be logged, and the user can simulate the rest of the filter for
tuning and debugging purposes.
The Idle tracker must be set up using TIMING.TIDLE to function as a slow-moving average to be
subtracted from the measured values to remove the constant bias. This biases the signal around
zero, with fast changes in capacitance shown as deviations from zero.
The averaging filter, which outputs values to LEVEL, must be set up using TIMING.TLEVEL to
have a faster response than the Idle tracker, in order to function as a smoothing filter on the
median-filtered signal. The thresholds are compared to the LEVEL value to decide whether or
not a touch event should be generated.
34.6.7
Multiple Sensors and DMA Operation
The CATB can only hold state and configuration for one sensor at the time. In order to use the
CATB with multiple sensors, sensor data can be stored in RAM using 5 x 32-bit words (20 bytes)
per sensor (refer to Table 34-2). The Peripheral DMA Controller must be used to transfer state
and configuration for the different sensors back and forth between the CATB and system mem-
ory. DMA mode of the CATB is enabled by writing a one to the DMA Enable bit in the Control
Register (CR.DMAEN). When DMA mode of the CATB is enabled, the CATB automatically gen-
erates the required handshakes to the DMA controller for transferring data back and forth with
the correct timing.
Figure 34-5. Transferring of Configuration and State in Multisensor Mode
DMA write pointer
5
System
RAM:
0
DMA read pointer
2
Stored state for
sensor 1
19
20
Stored state for
sensor 2
Peripheral
DMA
Controller
1
3
4
Wor k i n g
state
CATB
39
As shown in Figure 34-5, configuration and state data is transferred between the system mem-
ory and the CATB using DMA in the following sequence:
1. The configuration and state data for sensor 1 is read from memory and written to the
CATB
2. The DMA read pointer is incremented, and the next read from memory will read the
data for sensor 2
3. The CATB performs an acquisition using the parameters for sensor 1
42023C–SAM–02/2013
917