Microchip Technology MA160014 Data Sheet

Page of 560
 2010-2012 Microchip Technology Inc.
DS41412F-page 321
PIC18(L)F2X/4XK22
19.0
CHARGE TIME 
MEASUREMENT UNIT (CTMU)
The Charge Time Measurement Unit (CTMU) is a
flexible analog module that provides accurate
differential time measurement between pulse sources,
as well as asynchronous pulse generation. By working
with other on-chip analog modules, the CTMU can be
used to precisely measure time, measure capacitance,
measure relative changes in capacitance or generate
output pulses with a specific time delay. The CTMU is
ideal for interfacing with capacitive-based sensors.
The module includes the following key features:
• Up to 28
(1)
 channels available for capacitive or 
time measurement input
• On-chip precision current source
• Four-edge input trigger sources
• Polarity control for each edge source
• Control of edge sequence
• Control of response to edges
• High precision time measurement
• Time delay of external or internal signal 
asynchronous to system clock
• Accurate current source suitable for capacitive 
measurement
The CTMU works in conjunction with the A/D Converter
to provide up to 28
(1)
 channels for time or charge
measurement, depending on the specific device and
the number of A/D channels available. When config-
ured for time delay, the CTMU is connected to the
C12IN1- input of Comparator 2. The level-sensitive
input edge sources can be selected from four sources:
two external input pins (CTED1/CTED2) or the ECCP1/
(E)CCP2 Special Event Triggers.
 provides a block diagram of the CTMU.
FIGURE 19-1:
CTMU BLOCK DIAGRAM
Note 1: PIC18(L)F2XK22 devices have up to 17
channels available.
CTED1
CTED2
Current Source
Edge
Control
Logic
CTMUCONH/CTMUCONL
Pulse
Generator
ECCP2
ECCP1
Current
Control
ITRIM<5:0>
IRNG<1:0>
CTMUICON
CTMU
Control
Logic
EDGEN
EDGSEQEN
EDG1SELx
EDG1POL
EDG2SELx
EDG2POL
EDG1STAT
EDG2STAT
TGEN
IDISSEN
CTPLS
Comparator 2 Output
CTTRIG
Comparator C1/C2 Input
A/D Converter