下载

2011 Microchip Technology Inc. DS01375A-page 1
AN1375
INTRODUCTION
Since its introduction in PIC
®
microcontrollers, the
Charge Time Measurement Unit (CTMU) has become
popular for creating simple and low component touch
control solutions. Some applications have made use of
its ability to resolve the time difference between inputs
down to the sub-nanosecond range. But thinking that
the CTMU can only deal with time and charge
measurements would be a serious underestimation of
its abilities.
As proof of its versatility, this application note provides
48 different applications (or, in a few cases, categories
of applications) that can be implemented with the
CTMU. Many of these implement new functionality in
existing control applications, using only a few or no
additional components. Keep in mind that these appli-
cations are basic ideas, presented in an abbreviated
format. Microchip may not offer reference designs or
source code for some applications. The reader is
invited to use these ideas as the starting point for
developing their own solutions.
ABOUT THE CTMU
In a nutshell, the CTMU is an on-chip constant-current
source, surrounded by digital circuitry to precisely
control its operation (Figure 1). The current source
operates over four decade ranges, from 0.55 µA to
550 µA. When combined with the on-chip A/D
Converter and comparators, the CTMU can perform a
variety of basic functions:
• Capacitance measurement (relative and absolute)
• Inductance measurement (relative)
• Resistance measurement (relative and absolute)
• High-resolution time measurement
While the basic functions are useful for a variety of
applications, they can also be used as the basis of
more complex applications, such as:
• Temperature measurement
• Current source (constant and variable)
• Precise time delay generation
• Pulse-Width Modulation (PWM) output
The different types of applications are covered in the
sections that follow.
FIGURE 1: CTMU BLOCK DIAGRAM
Authors: Padmaraja Yedamale and Jim Bartling
Microchip Technology Inc.
CTED1
CTED2
Current Source
Edge
Control
Logic
CTMUCON
Pulse
Generator
A/D Converter Comparator 2
Input
Timer1
OC1
Current
Control
CTMUICON
CTMU
Control
Logic
A/D Trigger
CTPLS
Comparator 2 Output
See What You Can Do with the CTMU