Note the following details of the code protection feature on Microchip devices:
•Microchip products meet the specification contained in their particular Microchip Data Sheet.
•Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the
intended manner and under normal conditions.
•There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our
knowledge, require using the Microchip products in a manner outside the operating specifications contained in Microchip’s Data
Sheets. Most likely, the person doing so is engaged in theft of intellectual property.
•Microchip is willing to work with the customer who is concerned about the integrity of their code.
•Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not
mean that we are guaranteeing the product as “unbreakable.”
Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of our
products. Attempts to break Microchip’s code protection feature may be a violation of the Digital Millennium Copyright Act. If such acts
allow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that Act.
Information contained in this publication regarding device
applications and the like is provided only for your convenience
and may be superseded by updates. It is your responsibility to
ensure that your application meets with your specifications.
MICROCHIP MAKES NO REPRESENTATIONS OR
WARRANTIES OF ANY KIND WHETHER EXPRESS OR
IMPLIED, WRITTEN OR ORAL, STATUTORY OR
OTHERWISE, RELATED TO THE INFORMATION,
INCLUDING BUT NOT LIMITED TO ITS CONDITION,
QUALITY, PERFORMANCE, MERCHANTABILITY OR
FITNESS FOR PURPOSE. Microchip disclaims all liability
arising from this information and its use. Use of Microchip
devices in life support and/or safety applications is entirely at
the buyer’s risk, and the buyer agrees to defend, indemnify and
hold harmless Microchip from any and all damages, claims,
suits, or expenses resulting from such use. No licenses are
conveyed, implicitly or otherwise, under any Microchip
intellectual property rights.
Trademarks
The Microchip name and logo, the Microchip logo, dsPIC,
K
logo, rfPIC and UNI/O are registered trademarks of
Microchip Technology Incorporated in the U.S.A. and other
countries.
FilterLab, Hampshire, HI-TECH C, Linear Active Thermistor,
MXDEV, MXLAB, SEEVAL and The Embedded Control
Solutions Company are registered trademarks of Microchip
Technology Incorporated in the U.S.A.
Analog-for-the-Digital Age, Application Maestro, CodeGuard,
dsPICDEM, dsPICDEM.net, dsPICworks, dsSPEAK, ECAN,
ECONOMONITOR, FanSense, HI-TIDE, In-Circuit Serial
Programming, ICSP, Mindi, MiWi, MPASM, MPLAB Certified
logo, MPLIB, MPLINK, mTouch, Octopus, Omniscient Code
Generation, PICC, PICC-18, PICDEM, PICDEM.net, PICkit,
PICtail, REAL ICE, rfLAB, Select Mode, Total Endurance,
TSHARC, UniWinDriver, WiperLock and ZENA are
trademarks of Microchip Technology Incorporated in the
U.S.A. and other countries.
SQTP is a service mark of Microchip Technology Incorporated
in the U.S.A.
All other trademarks mentioned herein are property of their
respective companies.
Microchip received ISO/TS-16949:2002 certification for its worldwide
headquarters, design and wafer fabrication facilities in Chandler and
T empe, Arizona; Gresham, Oregon and design centers in California
and India. The Company’s quality system processes and procedures
are for its PIC
devices, Serial EEPROMs, microperipherals, nonvolatile memo ry and
analog products. In addition, Microchip’s quality system for the desig n
and manufacture of development systems is ISO 9001:2000 certified.
All documentation becomes dated, and this manual is no exception. Microchip tools and
documentation are constantly evolving to meet customer needs, so some actual dialogs
and/or tool descriptions may differ from those in this document. Please refer to our web site
(www.microchip.com) to obtain the latest documentation available.
Documents are identified with a “DS” number. This number is located on the bottom of each
page, in front of the page number. The numbering convention for the DS number is
“DSXXXXXA”, where “XXXXX” is the document number and “A” is the revision level of the
document.
For the most up-to-date information on development tools, see the MPLAB
Select the Help menu, and then Topics to open a list of available online help files.
INTRODUCTION
This chapter contains general information that will be useful to know before you use an
mT ouch™ Advanced Ca pacitive Evaluation Kit. Items discussed in this chapter include:
• Document Layout
• Conventions Used in this Guide
• Warranty Registration
• Recommended Reading
• The Microchip Web Site
• Development Systems Customer Change Notification Service
• Customer Support
• Document Revision History
®
IDE online help.
DOCUMENT LAYOUT
This document describes how to use an mT ouch Advanced Capacitive Evaluation Kit as
a development and demonstrative tool for PIC16F, PIC18F, PIC24F, PIC24H and
PIC32MX MCU device capabilities and features. The document layout is as follows:
• Chapter 1. Introduction to the Evaluation Boards – This chapter introduces the
mTouch Advanced Capacitive Evaluation Kits and provides an overview of their
features.
• Chapter 2. Demonstration Application – This chapter describes the
preprogrammed capacitive touch sense demonstration application.
• Chapter 3. Using the mTouch™ Sensing Solution – This chapter describes the
diagnostic software and how to use it with an mTouch Advanced Capacitive
Evaluation Kit.
• Chapter 4. Evaluation Board Hardware – This chapter provides a functional
overview of the mTouch Advanced Capacitive Evaluation Kits and identifies the
major
hardware components.
• Chapter 5. Troubleshooting – This chapter provides troubleshooting tips for
commonly encountered issues.
• Appendix A. “Evaluation Board Schematics” – This appendix provides
Please complete the enclosed Warran ty Registration Card and mail it promptly.
Sending in the Warranty Registration Card entitles you to receive new product updates.
Interim software releases are available at th e Microchip web site.
RECOMMENDED READING
This user’s guide describes how to use an mTouch Advanced Capacitive Evaluation
Kit. Other useful documents are listed below. The following Microchip documents are
available and recommended as supplemental reference resources. The latest documentation is available from the mTouch web page (www.microchip.com/mtouch).
Readme Files
Preface
For the latest information on using other tools, read the tool-specific Readme files in
the Readme subdirectory of the MPLAB
contain update information and known issues that may not be included in this user’s
guide.
®
IDE installation directory. The Readme files
Family Reference Manual Sections
Family Reference Manual sections are available, which explain the operation of the
PIC microcontroller family architecture and peripheral modules. The specifics of each
device family are discussed in the individual family’s device data sheet.
Users are specifically directed to the “Charge Time Measurement Unit (CTMU)”
Family Reference Manual sections for a detailed discussion of this module, which is at
the heart of the capacitive touch sense demonstration. Please refer to the Microchip
web site for the latest version of these documents.
Device Data Sheets and Flash Programming Specifications
Refer to the appropriate device data sheet for device-specific information and
specifications. Also, refer to the appropriate device Flash Programming Specification
for information on instruction sets and firmware development. These documents may
be obtained from the Microchip web site or your local sales office.
16-bit MCU and DSC Programmer’s Reference Manual (DS70157)
This manual is a software developer’s reference for the 16-bit PIC24F and PIC24H
MCU, and 16-bit dsPIC30F and dsPIC33F DSC families of devices. It describes the
instruction set in detail and also provides general information to assist in developing
software for these device families.
®
Note:Refer to “MIPS32
Instruction Set” at www.mips.com for related information on PIC32 MCUs.
Architecture for Programmers Volume II: The MIPS32®
MPLAB® Assembler Linker and Utilities for PIC24 MCUs and dsPIC®
DSCs User’s Guide (DS51317)
This document details Microchip Technology’s language tools for dsPIC® DSC devices
based on GNU technology. The language tools discussed are:
MPLAB® Assembler Linker and Utilities for PIC32 MCUs User’s Guide
(DS51833)
This document details Microchip Technology’s language tools for PIC32 MCU devices
based on GNU technology. The language tools discussed are:
• MPLAB Assembler PIC32 MCUs
• MPLAB Linker PIC32 MCUs
• MPLAB Archiver/Librarian PIC32 MCUs
• Other Utilities
HI-TECH C® for PIC10/12/16 User’s Guide (DS51865)
This document details the use of Microchip’s HI-TECH C Compiler for PIC10/12/16
MCUs, which is a free-standing, optimizing ANSI C compiler. It supports all PIC10,
PIC12 and PIC16 series devices, as well as the PIC14000 device and the enhanced
Mid-Range PIC
MPLAB® C Compiler for PIC18 MCUs User’s Guide (DS51288)
This document details the use of Microchip’s MPLAB C Compiler for PIC18 MCU
devices to develop an application. The MPLAB C Compiler is a GNU-based language
tool, based on source code from the Free Sof tware Foundation (FSF). For more
information about the FSF, see www.fsf.org.
®
MCU architecture.
MPLAB® C Compiler for PIC24 MCUs and dsPIC® DSCs User’s Guide
(DS51284)
This document details the use of Micr ochip’s MPLAB C Compiler for PIC24 MCUs and
dsPIC DSC devices to develop an application. The MPLAB C Compiler is a
GNU-based language tool, based on source code from the Free Sof tware Foundation
(FSF). For more information about the FSF, see www.fsf.org.
MPLAB® C Compiler for PIC32 MCUs User’s Guide (DS51686)
This document details the use of Microchip’s MPLAB C Compiler for PIC32 MCU
devices to develop an application. The MPLAB C Compiler is a GNU-based language
tool, based on source code from the Free Sof tware Foundation (FSF). For more
information about the FSF, see www.fsf.org.
MPLAB® REAL ICE™ In-Circuit Emulator User’s Guide (DS51616)
This document describes how to use the MPLAB REAL ICE in-circuit em ulato r as a
development tool to emulate and debug firmware on a tar get board, as we ll as how to
program devices.
MPLAB® IDE User’s Guide (DS51519)
This document describes how to use the MPLAB IDE Integrated Development Environment, as well as the MPLAB project manager, MPLAB editor and MPLAB SIM simulator .
Use these development tools to help you develop and debug application code.
Microchip provides online support through our web site at www.microchip.com. This
web site is used as a means to make files and information easily available to
customers. Accessible by using your favorite Internet browser, the web site contains
the following information:
• Product Support – Data sheets and errata, application notes and sample
programs, design resources, user’s guides and hardware support documents,
latest software releases and archived software
• General Technical Support – Frequently Asked Questions (FAQs), technical
support requests, online discussion groups, Microchip consultant program
member listing
• Business of Microchip – Product selector and ordering guides, latest Microchip
press releases, listing of seminars and events, listings of Microchip sales offices,
distributors and factory representatives
DEVELOPMENT SYSTEMS CUSTOMER CHANGE NOTIFICATION SERVICE
Microchip’s customer notification service helps keep customers current on Microchip
products. Subscribers will receive e-mail notification whenever there are changes,
updates, revisions or errata related to a spec ified product family or development tool of
interest.
To register, access the Microchip web site at www.microchip.com, click on Customer
Change Notification and follow the registration instructions.
The Development Systems product group categories are:
• Compilers – The latest information on Microchip C compilers a nd other language
tools. These include the MPLAB C compiler; MPASM™ and MPLAB 16-bit
assemblers; MPLINK™ and MPLAB 16-bit object linkers; and MPLIB™ and
MPLAB 16-bit object librarians.
• Emulators – The latest information on Microchip in-circuit emulators.This
includes the MPLAB ICE 2000, MPLAB ICE 4000, MPLAB REAL ICE.
• In-Circuit Debuggers – The latest information on the Microchip in-circuit
debugger, MPLAB ICD 2, and MPLAB ICD 3.
• MPLAB
Integrated Development Environment for development systems tools. This list is
focused on the MPLAB IDE, MPLAB SIM simulator, MPLAB IDE Project Manager
and general editing and debugging features.
• Programmers – The latest information on Microchip programmers. These include
the MPLAB PM3 and PRO MATE
Plus and PICkit™ 1, 2 and 3 development programmers.
®
IDE – The latest information on Microchip MPLAB IDE, the Windows®
Thank you for purchasing a Microchip Technology mTouch Advanced Capacitive
Evaluation Kit. Depending on the kit purchased, up to four individua l evaluation boards
are provided. These ev aluation boards a re inten ded to intr od uce a nd de mon strate the
possibilities for capacitive touch sense applications on the PIC16F, PIC18F, PIC24F,
(DM183026-2 kit), PIC24H (AC243026 kit) and PIC32MX microcontroller platforms.
Note:This Evaluation Kit is intended as a functional evaluation of Microchip’s
mTouch Capacitive Sensing Solutions. It has not been designed for use in
noisy or production - level testing environment. Please refer Microchip
Application Notes for guidelines when attempting to design a product to be
used or deployed in such environments.
This chapter introduces the evaluation kits and provides an overview of th eir features.
Topics covered include:
•Overview
• Operational Requirements
• Initial Board Setup
1.1OVERVIEW
The mTouch Advanced Capacitive Evaluation Kits provide a simple platform for
developing a variety of capacitive touch sense applications. Depending on the kit
purchased, up to four evaluation boards are included with PIC16F, PIC18F, PIC24F,
PIC24H and PIC32MX microcontrollers, with four sensor daughter boar ds, as shown in
Figure 1-1 and Figure 1-2.
These evaluation kits are intended to be used to develop a capacitive touch sense
application using Microchip’s mTouch technologies. A kit is used by first connecting a
sensor board, and then supplying power to the board via USB, PICkit™ 3 or the PICkit
Serial Analyzer . The connector, J3/J4, with numbers from 0 to 15, is the connector for
sensing channels. The numbers, from 0 to 15 for PIC16F, PIC24F, PIC24H and
PIC32MX, and from 0 to 12 for PIC18F, represents the microcontroller’s sensing
channel. The vertical 2-row header is for debugging, to give easy access to some of
the microcontroller pins. Debugging may also be done by Microchip programmers and
the I
When using an evaluation kit out of the box, the default function of the LEDs is to
illuminate on a key press. All functionalities may be reprogrammed by using a
Microchip programmer and reprogramming the firmware in the device. The firmware
supplied with the evaluation kit is optimized to use with the four sensor boards supplied.
The USB connection supplies power to the board; no additional external power supply
is needed. For independent operation, the ev al ua ti o n board may be discon nected from
the PC and powered at test points. For the PIC18F, PIC24F and PIC32MX evaluation
boards, the USB also provides communications with the MPLAB mTouch Diagnostic
Tool. The PIC16F and PIC24H evaluation boards use the PICkit Serial Analyzer to
communicate via I
monitor the performance of the touch sensors and to optimize the sensor response. A
separate, 6-wire programming interface allows users to replace the preprogrammed
2
C™ or USB is used to communicate with the mTouch diagnostic tool.
2
C to the PC. The MPLAB mTouch application allows users to
demonstration firmware with their own applications using Microchip’s MPLAB
Integrated Development Environment (IDE) and In-Circuit Serial Programming™
(ICSP™). This allows the board to also be used as a test platform for capacitive touch
sense applications.
With its pre-installed demonstration a pplication, the evaluation board is designed to be
used straight out of the box. Except for a single connection to a computer , no additional
hardware or configuration is necessary.
1.3.1Installing the Software
Before connecting the eva lu at ion board to any computer for th e first time, it is important
to install the PC software found on the accompanying CD first. This ensures that the
proper USB drivers for communicating with the e valu ati on board are in stalled and ready
to recognize the board.
To install the software and driver, insert the evaluation kit CD into the CD-ROM drive.
The installation process starts automatically. The process pauses for user responses
to accept the Microchip software licenses, and to confirm the installation directories;
you must accept the license to use the software.
1.3.2Connecting the Hardware
Prior to connection, place the evaluation board on a flat surface near the computer.
Check to make sure that there are no objects underneath the board. Once the
evaluation kit sof tware is installed, connect the provided USB cable (A to mini-B) to
any available USB port on the PC or powered hub, and then to the board at the
mini-B receptacle. The PC USB connection provides power to the board.
The PIC24F and PIC18F CTMU and PIC32MX Capacitive Voltage Divider (CVD)
evaluation boards use the USB connection to power up the boards and also to
communicate with the mTouch diagnostic tool. The PIC16F Cap Sense Module (CSM)
and PIC24H CVD evaluation boards use the PICkit Serial Analyzer to communicate to
the PC. Connect the USB cable to the PICkit Serial Analyzer, and connect it to the J2
connector on the board and the PC’s USB port. The default code uses the 8-button
board.
When connecting the PIC24F and PIC18F CTMU and PIC32MX CVD boards, a
sequence of pop-up messages should appear in the system tray (lower right of the
desktop), stating that (1) new hardware has been fou nd, (2) drivers ar e being inst alled
and (3) the new hardware is ready for use. If you do not see these messages and the
eval u at io n board does not work, try u nplugging and reconnecting th e USB cable. If this
does not work, see Chapter 5. “Troubleshooting”.
This chapter describes the touch sense application that is preprogrammed on the
PIC16F, PIC18F, PIC24F, PIC24H and PIC32MX microcontrollers, and its general
principles of operation. Topics included in this chapter are:
• Introduction to the Touch Interface
• Individual Touch Sense Demonstrations
2.1INTRODUCTION TO THE TOUCH INTERFACE
For PIC24H and PIC32MX MCUs, touch sensing is achieved using a technique known
as the Capacitive Volt age Divider, which makes use of the ADC module. This technique
is based on successive charging/discharging cycles for sample and hold capacitance
and conversely, sensor plus finger capacitance, which basically cr eates a voltage
divider. For details, refer the application note, AN1298 “Capacitive Touch Using Only an ADC (“CVD”)” .
Control of the touch sense features is built on the PIC18F and PIC24F microcontrollers’
on-chip Charge Time Measurement Unit (CTMU) module. The CTMU consists of a
constant current source that charges each touch circuit to a voltage level. When any
additional capacitance is added to the circuit (from the touch of a fingertip, for example),
the fixed current source will now charge the circuit to a lower voltage. This change is
how the microcontroller detects a touch event. For detailed information on the CTMU
module, please refer to the related “Charge Time Measurement Unit (CTMU)” Family
Reference Manual sections, which are available from the Microchip web site.
On the PIC16F CSM Evaluation Board, the on-chip Cap Sense Module (CSM) creates
a relaxation oscillator to perform touch sensing. The period or frequency of the relaxation oscillator can be measured, and when the sensor is touched, the frequency will
drop and the period will increase, indicating a touched condition.
The microcontrollers use the CTMU, CVD or CSM to monitor it s input channels, which
are in turn, connected to capacitive touch pad sensors on the top layer of the circuit
board.
The evaluation board has four different sensor demonstration boards:
• 8-Key Direct Plug-in Daughter Board
• 12-Key Matrix Plug-in Daughter Board
• 2-Channel Slider Plug-in Daughter Board
• 4-Channel Slider Plug-in Daughter Board
A more detailed description of the e valuation boards ’ operation is pr ovided in Chapter
4. “Evaluation Board Hardware”.
2.1.1Touch Sensitivity
The response of the sensor to fingertip touch is influenced by many factors: touch
areas, voltage and current levels, ambient humidity, static buildup, and so on. The
capacitive touch sensing is done by a relative shift in the capacitance due to the addition of the finger capacitance to the touch sensor. The demonstration code supplied
takes most of the typical environmental factors into consideration. The demonstration
application is very flexible in the sense that it can be modified by the user.
The PC-side application accompanying the mTouch Advanced Capacitive Evaluation Kit
can be used to change the sensitivity of the sensors by writing trip point information back
to the board.
2.1.2Sensor Persistence
By design, the demonstration application is designe d to res po nd to a state chan ge
event on any sensor. More simply, they respond to a touch, and not to a touch and
release. This behavior, along with the firmware’s slow averaging algo rithm that
accounts for constant changes in the evaluation board’s environment, causes a
continuous touch on one or more sensors to yield an affirmative response for a few
seconds, followed eventually by no response at all. Removing the touch stimulus from
the sensor resets the algorithm and restores the sensor’s responsiveness.
2.2INDIVIDUAL TOUCH SENSE DEMONSTRATIONS
2.2.1 8-Key Direct Plug-in Daughter Board
The Direct Key Plug-in daughter board is an 8-channel plug-in board with one key
directly mapped to one channel. This can be interfaced with any of the 8 channels of the
16 channels provided in the mT ouch Advanced Capacitive Evaluation Kit. Touching any
one of the keys on the plug-in board will light up the corresponding LED in the evaluation board.
The LEDs, D8 to D15 of the ev a l u at i o n board , correspond to the dir ect keys numbered
from ‘8’ to ‘F’, respectively, in the Direct Key Plug-in daughter board.
The default firmw are loade d in the mTouch Advanced Capacitive Evaluation Kit is
configured for channels 8 to 15 in PIC16F CSM, PIC24F CTMU, PIC24H CVD and
PIC32MX CVD evaluation boards, and channels 0 to 7 in PIC18F CTMU Evaluation
Boards.
When the key numbered ‘8’ is pressed, the LED D8 will be lit. Similarly, when keys, ‘9’
through ‘F’, are pressed, the LEDs, D9 through D15, will be lit. Here, one LED will be
lit for every press key on the plug-in board (see Figure 2-1).
FIGURE 2-1:DEFAULT PLUG-IN CHANNELS FOR 8-KEY PLUG-IN BOARD
The Matrix Key Plug-in daughter board is an array of 12 touch-sensitive keys a rranged
in a 4x3 matrix. Touching any one of the keys will light up one of the LEDs. Here, the
Matrix Key Plug-in daughter board is numbered, 0 to 11, which corresponds to LEDs
D1 to D12, respectively.
The default firmware loaded in the mTouch Advanced Cap acitive Evaluation Kit for the
Matrix Key Plug-in daughter board is configured fo r chann els 8 to 14 in PIC16 F CSM,
PIC24F CTMU, PIC24H CVD and PIC32MX CVD evaluation boards, and channels 6
to 12 in PIC18F CTMU evaluation boards.
When the key numbered ‘0’ is pressed, the LED D1 will be lit. Similarly, when the keys
numbered ‘1’ to ‘11’ are pressed, the LEDs D2 through D12 will be lit, respectively.
Here, one LED will be lit for every press of the key on the plug-in board.
2.2.32-Channel and 4-Channel Slider Plug-in Daughter Board
Touching anywhere along the length of the slider causes all the LEDs to light up as a
bar graph that is representative to the position of the touch. The LED bar graph follows
the finger as it moves up and down along the length of the slider, and remains at the
last position on the slider when the finger is removed.
The default firmware for the 2-Channel Slider Plug-in, loaded in the evaluation kit, is
configured such that, the channels 0 and 1 of connector J4/J3 in the e v a l u a t i o n k i t are
connected to the 2-Channel Slider Plug-in daughter board.
The default firmware for the 4-Channel Slider Plug-in, loaded in the evaluation kit, is
configured such that, channels 0, 1, 2 and 3 of connector J4/J3 in the main evaluatio n
board are connected to the 4 channels in the 4-Channel Slider Plug-in da ughter board
(see Figure 2-2).
FIGURE 2-2:DEFAULT PLUG-IN CHANNELS FOR 4-CHANNEL SLIDER
PLUG-IN BOARD
Note 1:The plug-in boards can be interfaced to any of the channels in the
evaluation kit by changing the configuration settings. The details of the
configuration settings are explained in the Readme.txt file, which is
distributed in each demonstration.
2:Plugging a sensor board in while an evaluation board is running, may
require resetting the touch algorithm, most easily done by cycling power.
This chapter describes the Graphical User Interface (GUI) diagnostic tool, mTouch™
sensing solution, that accompanies the evaluation boards in the mTouch Capacitive
Eval ua ti on Kits, and how it can be used in de veloping and troubleshooting touch sense
applications. Topics include:
• About the mTouch Sensing Solution Diagnostic Tool
• MPLAB IDE integrated mTouch Diagnostic Tool GUI
3.1ABOUT THE mTouch SENSING SOLUTION DIAGNOSTIC TOOL
The touch sensing solution is a multi-purpose application that has been designed for
use with many of Microchip’s touch sense demonstrations. The software provides a
useful tool for viewing, adjusting and debugging various aspects of the demonstration
software preloaded on the evaluation boards. The touch sensing solution can also be
used for developing customized applications.
Initially the diagostic tool was developed as a standalone GUI and lately it is integrated
into the MPLAB IDE. The latest version integrated with MPLAB IDE is backward
compatible with the standalone GUI so that older embedded firmware can be run
successfully. Note that, some of the additional enhancements may constraint the
newer embedded firmware developed in conjunction with the latest GUI integrated with
MPLAB IDE from correct functioning on the older standalone GUI.
The following sections describes the MPLAB IDE integrated mTouch Diagonistic Tool
GUI. These sections also list the embedded firmware that are successfully tested on
this platform.
The operation of the touch sensing solution described here is specific to its use with the
evaluation boards. For use with other Microchip applications, refer to the specific
application’s user’s guide.
3.2MPLAB IDE INTEGRATED mTOUCH DIAGNOSTIC TOOL GUI
This section describes the MPLAB IDE integrated mTouch Diagnostic Tool GUI
features.
The following firmware items from the mTouch Advanced Capacitive Evaluation Kit
(DM183026) were tested using this GUI:
• PIC16F CSM Evaluation Board
• PIC18F CTMU Evaluation Board
• PIC24F CTMU Evaluation Board
• PIC32MX CVD Evaluation Board
The firmware for PIC24H CVD Evaluation Board was also tested using this GUI.
3.2.1USING THE MPLAB IDE INTEGRATED mTOUCH DIAGNOSTIC
TOOL GUI
Before starting the mTouch sensing solution diagnostic tool, ensure that the evaluation
board is connected to a USB port on a p ersonal computer (or a USB hu b connected to
the computer) and that the evaluation board is operating normally.
T o start the mTouch Diagnostic T ool, select the homonymous item from MPLAB>Tools.
The GUI child window launches, as shown in Figure 3-1.
FIGURE 3-1:THE mTOUCH™ SENSING SOLUTION AT START-UP
(MPLAB
®
IDE)
At the bottom left of the mTouch Diagnostic T ool window is the histogram window , which
is used to display the status of the individual sensors or channels selected for the
hardware and subsystem. On the right side of this graph there are multiple sensor
selection checkboxes. Select the appropriate sensor number so that unused ones are
removed from the resulting histogram.
On the bottom right there is the status and settings sections of this GUI - which contains
two tabs - Settings and Touch Status. The Touch Status tab en able visualization of
the pressed button with the specific Board shape as selected in the Settings tab.
Click the Settings button in the Settings tab to display the window, as shown in
Figure 3-2.
The Settings window contains the possible setup for the hardware and subsystem
selected - contained in 3 tabs: Board, Communication and Logging.
The Board tab contains:
• Select Board drop down box: By default mTouch2 board is selected. Other
options in the drop down box includes mTouch 1 and 2 hardware, the mTouch
EVAL KIT hardware and the Custom board.
• Area of the Board: This contains the options for selecting the shape/type of the
sensed buttons.
• Custom board: This selects the number of sensor disposed onboard.
• Trip section: Select the ‘’GUI Value’’, when values for trip level for each sensor
are calibrated online from host, or select ‘’Firmware Value’’ if value for trip is contained in firmware. Trip Firmware Value is provided by the evaluation board's firmware, using an algorithm that calculates the optimum trip values based on the
average value. These values are sent to the mTouch Diagnose Tool through the
USB/I2C/UART connection, and are constantly updated and displayed on the bar
graphs; this is enabled by default. When selecting GUI Values, the trip levels are
calibrated from host and sent to the embedded firmware by USB/I2C/UAR T which
takes them into account for internal calculations.
The Communication tab as shown in Figure 3-3 contains:
• Protocol selection section: This contains settings for USB (VID and PID selec-
tion), I2C (Slave Address) and UART (Port and Baud Rate). Choose one option
only by selecting the appropriate radio button.
• PICkit Serial Setting: This contains the options - Provides Power and Supplied
FIGURE 3-3:THE mTOUCH™ DIAGNOSTIC TOOL - COMMUNICATION
SETTINGS (MPLAB
®
IDE)
The Logging tab, as shown in Figure 3-4, includes the settings typical for logging data
such as data contained by the log, destination file and data delimiter.
Click OK to close the Settings window and to disp lay the setup in th e Settings tab. To
actually use the logging, check the Log checkbox in the Settings tab (the setup made
previously will be used for logging).
The upper part of the mTouch Diagnostic Tool window contains the status display for
each of the sensors in form of a bar graph. Above each bar graph display is an
indicator; this lights up (changes to light green) when the software detects a touch
event. The bar graph shows the sensor's current state in terms of the A/D conversion
value of its channel. Values shown may be in the range of 0 to 65,535 and are
dimensionless.
Each bar graph has the following information:
• A constantly moving orangevertical bar that indicates the instantaneous
conversion value
• A blue horizontal indica tor across the bar that indicates the moving aver age of the
touch sensor
• A green horizontal indicator that shows the trip level that the touch channel must
reach to become pressed or activated
• The average and raw conversion values, displayed numerically at the bottom of
the bar graph
A color key for the indicators is provided at the top of the mTouch Diagnostic Tool
window.
The A/D converter produces values of up to 4096 (12 bits). The evaluation board
contains software algorithms that use scaled values of the raw A/D reading to improve
averaging and overall performan c e of the har dw ar e.
Right click on the bar graph for each sensor to display menu options: Display Data,
Zoom Settings and Sensor Settings.
FIGURE 3-5:THE mTOUCH™ DIAGNOSTIC TOOL - DISPLAY DATA
SETTINGS (MPLAB
Selecting Display Data option will display a Display Data dialog containing the settings
for data visualization, as shown in Figure 3-5. The Data Type can be selecte d between
‘’Raw’’ and ‘’Working’’ where Raw data represents working data values divided by 16.
The Display Data settings can be applied to the sensor selected or to all sensors.
Select Zoom Settings option to display the Zoom Settings dialog, as shown in
Figure 3-6. This enables settings for zooming in the bar graph. There are two available
zoom levels, which once set can be easily accessed from the GUI main window by
pressing the corresponding shortcut buttons situated at the bottom of each bar graph
(Z1, Z2). As for Display Data settings there is a possibility to set the setup zoom levels
for the current sensor or for all sensors at once.
Select the Sensor Setting option to select the trip level from which a button can be
indicated as pressed. The ‘’Trip Value’’ can only be set if Trip GUI value is selected in
the Settings window, if not, the error "Trip Value Can't be Set!, Change Settings to GUI Trip" is displayed.
This chapter provides a functional overview of the evaluation boards and identifies the
major hardware components. Topics covered include:
• Application Functional Overview
• Board Components
4.1APPLICATION FUNCTIONAL OVERVIEW
4.1.1PIC16F CSM/CVD Evaluation Board
For the PIC16F CVD/CSM board, ICSP lines are provided via a PICkit2 header . A mini
USB adaptor is available for power . The PICkit Serial Analyzer may be used to
communicate with the mTouch GUI through I2C. For this board, do not use both USB
and PICkit tools to power the board. The USB connection has a 3.3V regulator
afterwards to regulate the USB power and PI Ckit tools have their own regulator straight
to the device. ICSPCLK and ICSPDAT share pins with active-low LEDs (D6 and D7)
which can cause problems when debugging. T o use in-ci rcuit serial debugging, remove
jumper J4 to disconnect these two LEDs.
The PIC18F CTMU Evaluation Board (see Figure 4-2) is similar to the PIC24F CTMU
Evaluation Board except for the change in the number of ADC channels. The
PIC18F46J50 microcontroller on the PIC18F CTMU Evaluation Board has 13 ADC
channels, which are used by the touch sense application as the sensing channels.
Note:PIC18F CTMU Evaluation Board firmware uses only 13 channels for to uch
sense applications and Channels 13 to 15 are unused in the PIC18F CTMU
board.
The microcontroller uses its on-chip USB engine and transceiver to communicate to the
PC side interface application, using the USB mini-B receptacle. The evaluation board
also uses the USB receptacle for application power as a bus-powered device.
Microcontroller and LED power are provided from the V
voltage regulator. Provisions on the board allow for the users to add components and
create an externally powered application.
Note:Unlike the PIC24F CTMU Evaluation Board, the ICD interface (PGC and
PGD) on the PIC18F Evaluation Board does not share with any of the
CTMU channels.
The operation of the PIC24F CTMU Evaluation Board (see Figu re 4-3) is managed by
the PIC24F microcontroller , which require s very little additional hardware to perform its
tasks. In addition to the touch sense demonstration application code, the preloaded
demonstration uses substantial parts of the Microchip USB Stack Library to provide a
hardware interface to the PC-based mTouch sensing solution diagnostic tool.
The touch sense application uses the PIC24F microcontroller’s CTMU and all 16 of the
microcontroller’s A/D input channels to monitor the touch interfaces. The CTMU
functions by sensing small changes in capacitance on its inputs, such as those
occurring when a person touches the copper pad electrodes. By continuously
monitoring for these changes, the CTMU can determine when a touch event occurs.
The sensors on the evaluation board comprise carefully placed circuit traces and
capacitive touch pads.
The evaluation board comprises 16 A/D channels of the PIC24F microcontroller
connected to connector, J4/J3. This connector is used to interface the plug-in boards
to the evaluation board.
The plug-in boards can be connected to any of the 16 channels of the connector (14)
by changing the configuration settings, which is explained in the Readme.txt file.
A total of 16 LEDs are provided in the evaluation board. These LEDs are driven directly
by the microcontroller through pins on PORTD and PORTE. When an event occurs, the
application firmware also provides feedback by activating one or more LEDs at that
location. The sequence for the activation of the LEDs depends on the type of touch
pads that is interfaced to the evaluation board.
The microcontroller uses its on-chip USB engine and transceiver to communicate to the
PC side interface application, using the USB mini-B receptacle. The evaluation board
also uses the USB receptacle for application power as a bus-powered device.
Microcontroller and LED power are provided from the V
voltage regulator. Provisions on the board allow for users to add components and
For users interested in using the evaluation board as an experimental platform, the
microcontroller can be reprogrammed using the ICSP connector. A 6-pin header is
provided for connecting the evaluati on board to an y MPL AB ICD 2 com patible
programmer. Since the ICD interface (PGD and PGC) shares some input channels of
the connector, J4/J3 (channel 6 and 7), necessary care should be taken when the
debugger is enabled.
The firmware in the evaluation board will have the default plug-in board channel
configurations, which is explained in the Readme.txt file. The user can reconfigure
the channels based on his application by refer ring to the Readme.txt file.
4.1.4PIC24H CVD Evaluation Board
The PIC24H CVD Evaluation Board (see Figure 4-4) is based on the same layout as
the PIC24F CTMU and PIC32MX CVD evaluation boards and has similar functional
characteristics as the PIC16F CSM evaluation board (I
This board do not use USB and a PICkit to power the board. The USB has a 3.3V
regulator to regulate the USB power and the PICkit tools have their own regulator
straight to the device VDD; so, choose one or the other.
The PIC32MX CVD Evaluation Board (see Figure 4-5) is similar to the PIC24F CTMU
Evaluation Board. The user interface look and feel do not differ, while the evaluation
board layout is almost identical due to the fact that the PIC32MX795F512H and
PIC24FJ128GB106 are pin-to-pin compatible. The four dau ghter boards are connected
to the J3/J4 connectors in the same manner. As for functionality, the PIC32MX CVD
evaluation board has 15 LEDs to indicate touch sensing while the USB interface is
used for communicating with the host application for visualization and diagnostic.
A major difference between the PIC24F CTMU and the PIC32MX CVD evaluation
boards is the PIC32MX CVD uses the ADC module for ca pacitive touch sensing , while
the PIC24F CTMU uses the dedicated CTMU module.
Figure 4-6 identifies the key hardware components that are common for the PIC16F
CSM/CVD evaluation board. There is one evaluation board and four plug-in daughter
boards. The four plug-in daughter boards are identified as direct keys, matrix keys,
2-channel slider and 4-channel slider.
The components listed here (in order of thei r referen ce t ags in Fig ure 4-6) are the key
components of the application side of the PIC16F CSM Evaluation Board:
1. PIC16F1937 Microcontroller (U1): This provides the processing power for the
touch sense applications in the PIC16F Evaluation Board.
2. USB mini-B Receptacle (J5): This provides power to the board via USB.
3. ICSP™ Programming Header (J1): This provides a standard Microchip ICD
interface for programming and debugging app lications on an evaluation board. It
is designed to connect directly with Microchip's PICkit 3. Pin 1 is located on the
right side of the interface, as viewed from the front of the board, and is marked
with an arrow
4. PICkit Serial Analyzer connector (J2): This connector is used to exchange
data to the Host PC through I
5. Power Supply (Q1): This converts the +5 V
VDC required by the evaluation board.
6. Plug-in Sensor LEDs (D1-D16): Sixteen LEDs (D1 through D16) are conn ected
to one general purpose I/O ports of the PIC microcontroller. These LEDs are lit
based on the need of the application.
7. Plug-in Interface Connector (J4/J3): This is a 48-pin connector, which is used
to interface the different plug-in boards to the microcontroller. This connector is
interfaced to 16 analog channels of the microcontroller and the remaining pins
are connected to ground of the evaluation board.
2
C using the PICkit Serial Analyzer.
DC from VBUS to the regulated+3.3
4.2.2PIC18F CTMU, PIC24F CTMU, and PIC32MX CVD Evaluation
Boards
Figure 4-7 identifies the key hardware components that are common for the PIC18F
CTMU, PIC24F CTMU, and PIC32MX CVD ev al ua ti on boards. There is one evaluation
board and four plug-in daughter boards. T he four plug-in daughter boards are ide ntified
as direct keys, matrix keys, 2-channel slider and 4-channel slider.
FIGURE 4-7:PIC18F, PIC24F, AND PIC32MX EVALUATION BOARD COMPONENT LAYOUT
(TOP SIDE)
TABLE 4-2:BOARD COMPONENTS
ReferenceComponent
1aPIC24FJ128GB106 Microcontroller (U1) for PIC24F CTMU Board
1bPIC18F46J50 Microcontroller (U1) for PIC18F CTMU Board
1cPIC32MX795F512H Microcontroller (U1) for PIC32MX CVD Board
2USB mini-B Receptacle (J5)
3ICSP™ Programming Header (J1)
4Power Supply (Q1) to provide the V
5Plug-in Sensor LEDs (D1-D16)
6Plug-in Interface Connector (J4/J3)
4.2.2.1COMPONENT DESCRIPTIONS
The components listed here (in order of the ir refer ence t ag s in Figur e 4-7) are the key
components of the application side of an ev aluation board, which are common for both
PIC18F and PIC24F CTMU Evaluation Boards except for the microcontroller used in
the board:
1a. PIC24FJ128GB106 Microcontroller (U1): This pro vides th e processing power
for the touch sense demonstration applications. The microcontroller featur es 64
Kbytes of Flash program memory and 16 Kbytes RAM, allowing sufficient space
DD to the Evaluation Board
for the development of more complex touch sense applications.
The demonstration application uses an 8 MHz signal to create the 48 MHz USB
clock, as well as the application’s 32 MHz clock. Crystal, Y1, and associated
components are used by the microcontroller’s internal oscillator to maintain the
frequency tolerances required by the USB specifications.
1b. PIC18F46J50 Microcontroller (U1): This provide s the processing power for the
touch sense applications in the PIC18F Evaluation Board. The microcontroller
features 64 Kbytes of Flash program memory and 3.8 Kbytes RAM. The demonstration application uses an 8 MHz signal to create the 48 MHz USB clock, as
well as the application’s 32 MHz clock. Crystal, Y1, and associated components
are used by the microcontroller’s internal oscillator to maintain the frequency
tolerances required by the USB specifications.
1c. PIC32MX795F512H Microcontroller (U1): This provides the processing power
for the touch sense applications in the PIC32MX CVD Evaluation Board. The
microcontroller features 512 Kbytes of Flash program memory and 128 Kbytes
RAM. The demonstration application uses an 8 MHz signal to create the 48 MHz
USB clock, as well as the application’s 40 MHz clock. Cryst al, Y1, and associated
components are used by the microcontroller’s internal oscillator to maintain the
frequency tolerances required by the USB specifications.
2. USB mini-B Receptacle (J5): This provides a convenient interface to the PC
side of the demonstration application. As the evaluation board functions as a
bus-powered device, this connection also provides power to the board.
3. ICSP™ Programming Header (J1): This provides a standard Microchip ICD
interface for programming and debugging app lications on an evaluation board. It
is designed to connect directly with Microchip’s PICkit™ Starter Kit. Pin 1 (N/C)
is located on the right side of the interfac e, as viewed from the front of the board ,
and is marked with an arrow.
4. Power Supply (Q1): This converts the +5 V
+3.3 V
DC required by the evaluation board.
5. Plug-in Sensor LEDs (D1-D16): Sixteen LEDs (D1 through D16) are conn ected
to PORTD and PORTE of the PIC
®
microcontroller . These LEDs are lit based on
the need of the application.
6. Plug-in Interface Connector (J4/J3): This is a 48-pin connector, which is used
to interface the different plug-in boards to the microcontroller. This connector is
interfaced to 16 analog channels of the microcontroller and the remaining pins
are connected to ground of the evaluation board.
Figure 4-8 identifies the key hardware components for the PIC24H CVD Evaluation
Board. There is one evaluation board and four plug-in daughter boa rds. The four
plug-in daughter boards are identified as di rect keys, matrix keys, 2-channel slider and
4-channel slider.
The components listed here (in order of thei r referen ce t ags in Fig ure 4-8) are the key
components of the application side of the PIC24H CVD Evaluation Board:
1. PIC24HJ128GP506A Microcontroller (U1): This provides the processing
power for the touch sense applications in the PIC24H Evaluation Board.
2. USB mini-B Receptacle (J5): This provides power to the board via USB.
3. ICSP™ Programming Header (J1): This provides a standard Microchip ICD
interface for programming and debugging app lications on an evaluation board. It
is designed to connect directly with Microchip's PICkit 3, REAL ICE or ICD 3. Pin
1 is located on the right side of the interface, as viewed from the front of the
board, and is marked with an arrow.
4. PICkit Serial Analyzer connector (J2): This connector is used to exchange
data to the Host PC through I
5. Power Supply (Q1): This converts the +5 V
VDC required by the evaluation board.
6. Plug-in Sensor LEDs (D1-D16): Sixteen LEDs (D1 through D16) are conn ected
to one general purpose I/O ports of the PIC microcontroller. These LEDs are lit
based on the need of the application.
7. Plug-in Interface Connector (J4/J3): This is a 48-pin connector, which is used
to interface the different plug-in boards to the microcontroller. This connector is
interfaced to 16 analog channels of the microcontroller and the remaining pins
are connected to ground of the evaluation board.
Note 1:USB connection between an evaluation board and a workstation is used for power purposes
only can cannot be used for USB communication.
4.3INTERFACING TO THE EVALUATION BOARDS
4.3.1PIC16F CSM/CVD and PIC24H CVD Evaluation Boards with I2C
Communication
To interface the plug-in boards to the evaluation boards in the mTouch Advanced
Capacitive Evaluation Kits:
1. Connect the evaluation board to the MPLAB ICD progr ammer inter face throu gh
the ICSP connector, J1.
2. Connect the USB receptacle from the workstation to connector J5 of the
evaluation board. This is also used to power-up the evaluation board.
3. Connect the PICkit serial analyzer to the evaluation board through the J6
connector.
CAUTION
Do not use the PICKIT serial analyzer to power the PIC24H CVD Evaluation Board.
4. Connect any of the 4 plug-in boards to the evaluation board through the J4/J3
connector (48-pin).
5. After the hardware connections are don e, open the working project in the MPLAB
IDE and make the required changes for the corresponding plu g-i n boar d, which
are explained in the Readme.txt files included in the project folder. However,
the default values of the channel settings of the corresponding header files are
mentioned in Section 2.2 “Individual Touch Sense Demonstrations”. The
default settings of the configured chan nels ar e also explained in the
Readme.txt file.
6. Download the Hex file onto the evaluation board using the MPLAB ICD 3, PICkit
3 or REAL ICE programming interface.
7. Check the working of the respective plug-in boards and view their output throug h
the 16 LEDs on the evaluation board.
FIGURE 4-9:EVALUATION BOARD BLOCK DIAGRAM (PIC16F AND PIC24H ONLY)
Note:The number of plug-in boards that can be interfaced with the evaluation
board simultaneously is limited by the number of channels in the evaluation
board. Please refer to the specific evaluation board schematic in Appendix A. “Evaluation Board Schematics” to verify the number of channels
available.
4.3.2PIC18F CTMU, PIC24F CTMU, and PIC32MX CVD Evaluation
Boards with USB Communications
To interface the plug-in boards to the evaluation boards in the mTouch Advanced
Capacitive Evaluation Kits:
1. Connect the eva lu at ion board to the MPLA B
the ICSP connector, J1.
2. Connect the USB receptacle from the workstation to connector J5 of the
evaluation board. This is also used to power-up the evaluation board. For the
CTMU boards, it is also used to interface to the PC.
3. Connect any of the 4 plug-in boards to the evaluation board through the J4/J3
connector (48-pin).
4. After the hardware connections are done, open the working project in the MPLAB
IDE and make the required changes for the correspond ing plu g-in boar d, which
are explained in the Readme.txt file. However, the default values of the
channel settings of the corresponding header files are mentioned in
Section 2.2 “Individual Touch Sense Demonstrations”. The default settings
of the configured channels are also explained in the Readme.txt file.
5. Download the Hex file onto the evaluation board using the MPLAB ICD 3
interface.
6. Check the working of the respective plug-in boards and view th eir output through
the 16 LEDs on the evaluation board.
®
ICD programmer interface through
FIGURE 4-10:EVALUATION BOARD BLOCK DIAGRAM (PIC18F, PIC24F and PIC32MX ONLY)
Note:The number of plug-in boards that can be interfaced with the evaluation
board simultaneously is limited by the number of channels in the e v al uat i on
board. In the case of the PIC24F CTMU eval board, the ICD interface (PGD
and PGC) shares two of the input channels of the connector , J4/J3 (channel
6 and channel 7), the operation might fail if any of the plug-in boards is
connected to these 2 channels when the Debugger mod e is enabled in the
MPLAB
This chapter discusses common operational issues and methods to resolve them.
5.1COMMON ISSUES
1. The evaluation board does not respond to input s (i.e., no light s when a key
plug-in or touch sensor is touched)
Check the evaluation board for power:
• Verify that USB power (V
• If the evaluation board is connected to a computer through a USB hub, verify
the hub is powered and capable of providing power to downstream devices.
• If the evaluation board is directly connected to a computer, verify that the USB
port used is active; try switching to another port.
2. The touch sensors are abnormally sensitive or insensitive (generally
insensitive) to inputs
Check to make sure that the plug-in daughter boards are connected to the
channels that are mentioned in the Readme.txt file.
Check the bar graph settings for the sensors in the mTouch Sensing Solution
software. The evaluation board’s trip point and other settings may have been
changed to values that interfere with the default operation. To correct:
• In the Settings dialog, verify that the Use Firmware Settings option is
selected.
• If the Use Saved Value option is selected instead, change the trip point
values for each affected channel to a value that produces an appropriate
response.
3. The evaluation board and the mTouch Sensing Solution Diagnostic Tool
are installed and operating pro perly, but are not communicating with each
other
The USB host controller may not have enumerated the ev alu ati on board correctly
upon connection. To correct, try the following:
• If the evaluation board is connected through an external USB hub, try
connecting it directly to a USB port on the host computer.
• Disconnect the board, wait for 5 to 10 seconds, then reconnect the board.
It is also possible that the USB host controller has dropped the communication
channel. This happens occasionally when the evaluation board is placed into
Standby mode and then powered up using the power control. In this case, disconnect the evaluation board and reconnect after 5 to 10 seconds.
4. The board’s edge con nector will add some additional parasitic cap acitance
to the system.
5. Touching the solder connections can create a very strong coupling to the
sensor and trigger buttons.