English
Language : 

PIC16F707 Datasheet, PDF (122/284 Pages) Microchip Technology – 40/44-Pin, Flash Microcontrollers with nanoWatt XLP and mTouch™ Technology
PIC16F707/PIC16LF707
16.6.1 TIMERA/B
To select TimerA/B as the timer resource for the
capacitive sensing module:
• Set the TAXCS/TBXCS bit of the CPSACON0/
CPSBCON0 register.
• Clear the TMRACS/TMRBCS bit of the TACON/
TBCON register.
When TimerA/B is chosen as the timer resource, the
capacitive sensing oscillator will be the clock source for
TimerA/B. Refer to Section 14.0 “TimerA/B Mod-
ules” for additional information.
16.6.2 TIMER1/3
To select Timer1/3 as the timer resource for the
capacitive sensing module, set the TMRxCS<1:0> of
the TxCON register to ‘11’. When Timer1/3 is chosen
as the timer resource, the capacitive sensing oscilla-
tor will be the clock source for Timer1/3. Because the
Timer1/3 module has a gate control, developing a
time base for the frequency measurement can be
simplified by using the TimerA/B overflow flag.
It is recommend that the TimerA/B overflow flag, in
conjunction with the Toggle mode of the Timer1/3 gate,
be used to develop the fixed time base required by the
software portion of the capacitive sensing module.
Refer to Section 13.11 “Timer1/3 Control Register ”
for additional information.
TABLE 16-3: TIMER1/3 ENABLE FUNCTION
TMRxON TMRxGE
Timerx Operation
0
0
Off
0
1
Off
1
0
On
1
1
Count Enabled by Input
16.7 Software Control
The software portion of the capacitive sensing module
is required to determine the change in frequency of the
capacitive sensing oscillator. This is accomplished by
the following:
• Setting a fixed time base to acquire counts on
TimerA/B or Timer1/3.
• Establishing the nominal frequency for the
capacitive sensing oscillator.
• Establishing the reduced frequency for the
capacitive sensing oscillator due to an additional
capacitive load.
• Set the frequency threshold.
16.7.1 NOMINAL FREQUENCY (NO
CAPACITIVE LOAD)
To determine the nominal frequency of the capacitive
sensing oscillator:
• Remove any extra capacitive load on the selected
CPSx pin.
• At the start of the fixed time base, clear the timer
resource.
• At the end of the fixed time base, save the value
in the timer resource.
The value of the timer resource is the number of
oscillations of the capacitive sensing oscillator for the
given time base. The frequency of the capacitive
sensing oscillator is equal to the number of counts on
the timer divided by the period of the fixed time base.
16.7.2 REDUCED FREQUENCY
(ADDITIONAL CAPACITIVE LOAD)
The extra capacitive load will cause the frequency of
the capacitive sensing oscillator to decrease. To
determine the reduced frequency of the capacitive
sensing oscillator:
• Add a typical capacitive load on the selected
CPSx pin.
• Use the same fixed time base as the nominal
frequency measurement.
• At the start of the fixed time base, clear the timer
resource.
• At the end of the fixed time base, save the value
in the timer resource.
The value of the timer resource is the number of
oscillations of the capacitive sensing oscillator with an
additional capacitive load. The frequency of the
capacitive sensing oscillator is equal to the number of
counts on the timer divided by the period of the fixed
time base. This frequency should be less than the
value obtained during the nominal frequency
measurement.
DS41418A-page 122
Preliminary
 2010 Microchip Technology Inc.