Microchip Technology DM183037 Data Sheet

Page of 696
 2012 Microchip Technology Inc.
DS30575A-page 507
PIC18F97J94 FAMILY
26.0 CHARGE TIME 
MEASUREMENT UNIT (CTMU)
The Charge Time Measurement Unit (CTMU) is a
flexible analog module that provides accurate differen-
tial time measurement between pulse sources, as well
as asynchronous pulse generation. By working with
other on-chip analog modules, the CTMU can precisely
measure time, capacitance and 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 these key features:
• Up to 24 channels available for capacitive or time 
measurement input
• Low-cost temperature measurement using on-chip 
diode channel
• On-chip precision current source
• Sixteen-edge input trigger sources
• Polarity control for each edge source
• Provides a trigger for the A/D Converter
• Control of edge sequence
• Control of response to edges
• Time measurement resolution of 1 nanosecond
• 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 24 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 one of
the analog comparators. The level-sensitive input edge
sources can be selected from four sources: two
external inputs or the CCP1/CCP2 Special Event
Triggers.
The CTMU special event can trigger the Analog-to-Digital
Converter module.
 provides a block diagram of the CTMU.
FIGURE 26-1:
CTMU BLOCK DIAGRAM
CTED1
CTED2
Current Source
Edge
Control
Logic
CTMUCONH:CTMUCONL
Pulse
Generator
A/D Converter
Comparator 2
Input
CCP2
CCP1
Current
Control
ITRIM<5:0>
IRNG<1:0>
CTMUCON1
CTMU
Control
Logic
EDGEN
EDGSEQEN
EDG1SEL<1:0>
EDG1POL
EDG2SEL<1:0>
EDG2POL
EDG1STAT
EDG2STAT
TGEN
IDISSEN
CTTRIG
A/D Trigger
CTPLS
Comparator 2 Output