AP08113
Capacitive-Touch Color Wheel Implementation
Implementation of Color Wheel Software
Application Note
8
V1.0, 2010-08
The pad detection period depends on many parameters, such as the number of pad turns and LED columns
enabled and the accumulation of SFR LTS_TSVAL for example. The ‘All Enabled Pads Accumulated Count
Period’ (AEPACP) is 8.96ms, as defined in
Equation (1)
. The ShortCount determines the minimum ‘valid pad
detection period’ (VPDP). The minimum valid pad detection period is 71.68ms, calculated as shown in
Equation (2)
.
(1)
where:
•
TFD is Time Frame Duration = (((PREscaler x 256)/fCLK) x (Number of Time Slice(s))) = ((42 x 256) / 48MHz)
x 2 Time Slices = 448
µ
s
•
Number of Touch-sense inputs is 4
•
AccumulatorCounter is defined as 4 in the software code.
(2)
where:
•
ShortCount is defined as 0xF8 in the software code
A long touch on the centre button is detected when both PadDownCounter (PDC) is 0x40 and PADFLAG.4 is 1.
This long touch period is 1.71s, defined in
Equation (3)
. If a longer detection period is required, modify PDC to a
smaller value.
(3)
The maximum valid pad detection period is 2.28s, as defined in
Equation (4)
. For this period, the code can be
modified such that PADERROR.3 = 1, indicates a long touch on the centre button.
(4)
Note: PDC is used to keep track of how long the pad is touched. PDC is initialized to be 0xFF at the start of a
detected pad touch, and is decremented once at each All Enabled Pads Accumulated Count Period
(AEPACP). When pad touch is removed, PDC is compared with the user input value, ShortCount, and/or
0x00 to decide if pad touch is valid, invalid or a long touch. PDC is one of the parameters stored in XRAM,
at address 0xF0FF, by the FINDTOUCHEDPAD function.
Note: Please refer to LEDTS ROM Library in the User’s Manual for more details of the FINDTOUCHEDPAD
function, its inputs and its formulas.
3.1.2
Touch Detection Methodology for the Touch-Wheel
The Touch-Wheel Library (Library_TouchWheel.lib linked into the application code and programmed in the flash
memory) is used to detect a touch on the touch-wheel. It is provided as a .lib file and is described in
Section 3.2
.
The Touch-Wheel Library makes use of the AverageL/H values calculated by the LEDTS ROM Library to
determine the absolute location of the current finger touch on the touch-wheel. In order to keep the averaging
active, the PADFLAG bits are cleared for touch-sense inputs TSIN0, TSIN1 and TSIN2.
AEPACP
TFD
Number of Touch-sense inputs TSIN[x]
(
)
×
AccumulatorCounter 1
+
(
)
×
=
Minimum Valid Pad Detection Period (VPDP)
0xFF ShortCount
–
1
+
(
)
AEPACP
×
=
Long Touch Period
0xFF PDC
–
(
)
AEPACP
×
=
Maximum Valid Pad Detection Period (VPDP)
0xFF AEPACP
×
=
All manuals and user guides at all-guides.com