• Main Page
  • Modules
  • Data Structures
  • Files
  • File List
  • Globals

mTouch_config_cvdAdvanced.h

Go to the documentation of this file.
00001 /*************************************************************************
00002  *  © 2012 Microchip Technology Inc.                                       
00003  *  
00004  *  Project Name:    mTouch Framework v2.1
00005  *  FileName:        mTouch_config_cvdAdvanced.h
00006  *  Dependencies:    
00007  *  Processor:       See documentation for supported PIC® microcontrollers 
00008  *  Compiler:        HI-TECH Ver. 9.81 or later
00009  *  IDE:             MPLAB® IDE v8.50 (or later) or MPLAB® X                        
00010  *  Hardware:         
00011  *  Company:         
00012  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00013  *  Description:     Advanced mTouch CVD Configuration File
00014  *                   - See documentation for better explanations of all
00015  *                     configuration options.
00016  *************************************************************************/
00017 /***********************************************************************
00018  * MICROCHIP SOFTWARE NOTICE AND DISCLAIMER: You may use this software, and 
00019  * any derivatives created by any person or entity by or on your behalf, 
00020  * exclusively with Microchip's products in accordance with applicable
00021  * software license terms and conditions, a copy of which is provided for
00022  * your referencein accompanying documentation. Microchip and its licensors 
00023  * retain all ownership and intellectual property rights in the 
00024  * accompanying software and in all derivatives hereto. 
00025  * 
00026  * This software and any accompanying information is for suggestion only. 
00027  * It does not modify Microchip's standard warranty for its products. You 
00028  * agree that you are solely responsible for testing the software and 
00029  * determining its suitability. Microchip has no obligation to modify, 
00030  * test, certify, or support the software. 
00031  * 
00032  * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER 
00033  * EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED 
00034  * WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A 
00035  * PARTICULAR PURPOSE APPLY TO THIS SOFTWARE, ITS INTERACTION WITH 
00036  * MICROCHIP'S PRODUCTS, COMBINATION WITH ANY OTHER PRODUCTS, OR USE IN ANY 
00037  * APPLICATION. 
00038  * 
00039  * IN NO EVENT, WILL MICROCHIP BE LIABLE, WHETHER IN CONTRACT, WARRANTY, 
00040  * TORT (INCLUDING NEGLIGENCE OR BREACH OF STATUTORY DUTY), STRICT 
00041  * LIABILITY, INDEMNITY, CONTRIBUTION, OR OTHERWISE, FOR ANY INDIRECT, 
00042  * SPECIAL, PUNITIVE, EXEMPLARY, INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, 
00043  * FOR COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE SOFTWARE, 
00044  * HOWSOEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY 
00045  * OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT ALLOWABLE BY LAW, 
00046  * MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY RELATED TO THIS 
00047  * SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, THAT YOU HAVE PAID 
00048  * DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. 
00049  * 
00050  * MICROCHIP PROVIDES THIS SOFTWARE CONDITIONALLY UPON YOUR ACCEPTANCE OF 
00051  * THESE TERMS. 
00052  *************************************************************************/
00053 
00059 //****************************************************************************************************
00060 // __        __               __                        _____ _           _             
00061 // \ \      / /_ ___   _____ / _| ___  _ __ _ __ ___   |_   _(_)_ __ ___ (_)_ __   __ _ 
00062 //  \ \ /\ / / _` \ \ / / _ \ |_ / _ \| '__| '_ ` _ \    | | | | '_ ` _ \| | '_ \ / _` |
00063 //   \ V  V / (_| |\ V /  __/  _| (_) | |  | | | | | |   | | | | | | | | | | | | | (_| |
00064 //    \_/\_/ \__,_| \_/ \___|_|  \___/|_|  |_| |_| |_|   |_| |_|_| |_| |_|_|_| |_|\__, |
00065 //                                                                                |___/ 
00066 //****************************************************************************************************
00067                                             
00068     #define CVD_SETTLING_DELAY          5       // <-- Adjusts the number of additional instruction cycles
00069                                                 //     to add to the Chold&Csensor settling time.
00070                                                 //     The larger this value is, the more susceptible to
00071                                                 //     noise the application will be. However, there is a
00072                                                 //     minimum amount of time required to get full 
00073                                                 //     sensitivity. 
00074                                                 //     For information on how to tune this parameter,
00075                                                 //     please refer to the mTouch Framework documentation.
00076 
00077     #define CVD_CHOLD_CHARGE_DELAY      5       // <-- Adjusts the number of additional instruction cycles
00078                                                 //     to add to the Chold-charge stage of the CVD scan.
00079                                                 //     For information on how to tune this parameter,
00080                                                 //     please refer to the mTouch Framework documentation.
00081 
00082     #define CVD_SWITCH_DELAY            0       // <-- Ideal value for noise immunity is 0.
00083                                                 //     Determines how many NOPs will be added between
00084                                                 //     when the sensor is set to an input and the ADC
00085                                                 //     mux is pointed to the sensor. This value should 
00086                                                 //     ONLY be increased if the output driver is not 
00087                                                 //     disabling itself quickly enough. This will be 
00088                                                 //     noticeable on the second-sample of the waveform: 
00089                                                 //     the settling point will be slightly unstable and 
00090                                                 //     will be visibly coupling to VDD.
00091                                                 //     The behavior is most-noticeable on the second scan
00092                                                 //     due to P-type transistors being less ideal than
00093                                                 //     N-type transistors.
00094                                                 //     The behavior is most-common when Fosc is a high
00095                                                 //     value (16MHz or greater).
00096                                                 //     If you are seeing the behavior, the correct value 
00097                                                 //     for this option will vary based on Fosc and the  
00098                                                 //     microcontroller in question; but, in general,  
00099                                                 //     1-3 NOPs for 16MHz, 3-5 for 32MHz.
00100                                                 
00101                                                 
00102     //#define CVD_FORCE_REF_DAC                 // <-- If defined, the framework will use the DAC as the
00103                                                 //     reference source option.
00104 
00105     
00106     //#define CVD_JITTER_2ND_SAMPLE             // <-- If defined, the second CVD sample of the differential
00107                                                 //     CVD waveform will be randomly delayed. This can help
00108                                                 //     to reduce radiated emissions and may increase noise
00109                                                 //     immunity.
00110                                                 //     NOTE: Do not define if normal jittering is not implemented.
00111                                                 
00112         #define CVD_JITTER_2ND_MASK     0x3F    // <-- Determines the mask used on the 8-bit random variable
00113                                                 //     when loading the decrementing delay counter. The
00114                                                 //     more bits are kept, the larger the randomness.
00115 
00116     
00117     
00118 //****************************************************************************************************
00119 //   ____                     _   ____  _           
00120 //  / ___|_   _  __ _ _ __ __| | |  _ \(_)_ __  ___ 
00121 // | |  _| | | |/ _` | '__/ _` | | |_) | | '_ \/ __|
00122 // | |_| | |_| | (_| | | | (_| | |  __/| | | | \__ \
00123 //  \____|\__,_|\__,_|_|  \__,_| |_|   |_|_| |_|___/
00124 //
00125 //****************************************************************************************************
00126 
00127     //#define CVD_GUARD_IO_ENABLED                                  // <-- If defined, the framework will implement a 
00128                                                                     //     guard sensor using an IO port.
00129                                                                     //     For information about guard sensors, please refer 
00130                                                                     //     to the mTouch Framework documentation.
00131                                                                 
00132         #define CVD_GUARD_PORT              LATA                    // <-- The guard IO's LAT register, prefixed with an underscore.
00133         #define CVD_GUARD_PIN               2                       // <-- The guard IO's pin number
00134 
00135         
00136         
00137     //#define CVD_GUARD_DACOUT_ENABLED                              // <-- If defined, the framework will implement a
00138                                                                     //     guard sensor using the DAC's DACOUT pin.
00139                                                                     //     If available, this can produce better results 
00140                                                                     //     than the regular IO guard.
00141                                                                     
00142         #define CVD_GUARD_DACCON0_A     PIC_DACOUT_DACCON0_HALF_VDD // <-- This is the value that will be loaded into the DACCON0
00143                                                                     //     register prior to ScanA of the differential CVD scan.                                                                    
00144         #define CVD_GUARD_DACCON1_A     PIC_DACOUT_DACCON1_HALF_VDD // <-- This is the value that will be loaded into the DACCON1
00145                                                                     //     register prior to ScanA of the differential CVD scan.   
00146         #define CVD_GUARD_DACCON0_B     PIC_DACOUT_DACCON0_HALF_VDD // <-- This is the value that will be loaded into the DACCON0  
00147                                                                     //     register prior to ScanB of the differential CVD scan.                  
00148         #define CVD_GUARD_DACCON1_B     PIC_DACOUT_DACCON1_HALF_VDD // <-- This is the value that will be loaded into the DACCON1  
00149                                                                     //     register prior to ScanB of the differential CVD scan.  
00150                                                                     //     Valid Values:
00151                                                                     //          - Custom hex value for DACCON register (ex: 0xA0)
00152                                                                     //          - One of the following predefined values:
00153                                                                     //              - PIC_DACOUT_DACCON0_VSS        /   PIC_DACOUT_DACCON1_VSS
00154                                                                     //              - PIC_DACOUT_DACCON0_1_3RD_VDD  /   PIC_DACOUT_DACCON1_1_3RD_VDD
00155                                                                     //              - PIC_DACOUT_DACCON0_HALF_VDD   /   PIC_DACOUT_DACCON1_HALF_VDD
00156                                                                     //              - PIC_DACOUT_DACCON0_2_3RD_VDD  /   PIC_DACOUT_DACCON1_2_3RD_VDD
00157                                                                     //              - PIC_DACOUT_DACCON0_VDD        /   PIC_DACOUT_DACCON1_VDD
00158     
00159    
00160 
00161 
00162 //****************************************************************************************************
00163 //  __  __       _               _   ____                                
00164 // |  \/  |_   _| |_ _   _  __ _| | / ___|  ___ _ __  ___  ___  _ __ ___ 
00165 // | |\/| | | | | __| | | |/ _` | | \___ \ / _ \ '_ \/ __|/ _ \| '__/ __|
00166 // | |  | | |_| | |_| |_| | (_| | |  ___) |  __/ | | \__ \ (_) | |  \__ \
00167 // |_|  |_|\__,_|\__|\__,_|\__,_|_| |____/ \___|_| |_|___/\___/|_|  |___/
00168 //  
00169 //****************************************************************************************************
00170 
00171 
00172     //#define CVD_MUTUAL_ENABLED                      // <-- If defined, the framework will integrate a mutual
00173                                                     //     sensor into the differential CVD scan.
00174     //#define CVD_MUTUAL_EXCLUSIVE_ENABLED          // <-- If defined, the framework will perform an
00175                                                     //     exclusively-mutual scan. There will be no charge
00176                                                     //     averaging between the external and internal caps.
00177                                                 
00178         #define CVD_MUTUAL_LAT              LATA3   // <-- The mutual sensor's LAT pin label
00179         #define CVD_MUTUAL_TRIS             TRISA3  // <-- The mutual sensor's TRIS pin label
00180 
00181 
00182         
00183         
00184         
00185         
00186 
00187 #define MTOUCH_UNIQUE_OVERSAMPLE_ENABLE
00188     #define MTOUCH_OVERSAMPLE0          10
00189     #define MTOUCH_OVERSAMPLE1          10
00190     #define MTOUCH_OVERSAMPLE2          10
00191     #define MTOUCH_OVERSAMPLE3          10
00192     #define MTOUCH_OVERSAMPLE4          10
00193     #define MTOUCH_OVERSAMPLE5          10
00194     #define MTOUCH_OVERSAMPLE6          10
00195     #define MTOUCH_OVERSAMPLE7          10
00196     #define MTOUCH_OVERSAMPLE8          10
00197     #define MTOUCH_OVERSAMPLE9          10
00198     #define MTOUCH_OVERSAMPLE10         10
00199     #define MTOUCH_OVERSAMPLE11         10
00200     #define MTOUCH_OVERSAMPLE12         10
00201     #define MTOUCH_OVERSAMPLE13         10
00202     #define MTOUCH_OVERSAMPLE14         10
00203     #define MTOUCH_OVERSAMPLE15         10
00204     #define MTOUCH_OVERSAMPLE16         10
00205     #define MTOUCH_OVERSAMPLE17         10
00206     #define MTOUCH_OVERSAMPLE18         10
00207     #define MTOUCH_OVERSAMPLE19         10
00208     #define MTOUCH_OVERSAMPLE20         10
00209     #define MTOUCH_OVERSAMPLE21         10
00210     #define MTOUCH_OVERSAMPLE22         10
00211     #define MTOUCH_OVERSAMPLE23         10
00212     #define MTOUCH_OVERSAMPLE24         10
00213     #define MTOUCH_OVERSAMPLE25         10
00214     #define MTOUCH_OVERSAMPLE26         10
00215     #define MTOUCH_OVERSAMPLE27         10
00216     #define MTOUCH_OVERSAMPLE28         10
00217     #define MTOUCH_OVERSAMPLE29         10
00218         
00219         
00220         
00221 //#define MTOUCH_UNIQUE_REFERENCE_OPTIONS     // NOTE: CVD_FORCE_REF_DAC overrides this setting at all times.
00222 
00223     #define CVD_REFERENCE_SENSOR0           MTOUCH_SENSOR1    
00224     #define CVD_REFERENCE_SENSOR1           MTOUCH_SENSOR0   
00225     #define CVD_REFERENCE_SENSOR2           MTOUCH_SENSOR0   
00226     #define CVD_REFERENCE_SENSOR3           MTOUCH_SENSOR0   
00227     #define CVD_REFERENCE_SENSOR4           MTOUCH_SENSOR0   
00228     #define CVD_REFERENCE_SENSOR5           MTOUCH_SENSOR0   
00229     #define CVD_REFERENCE_SENSOR6           MTOUCH_SENSOR0   
00230     #define CVD_REFERENCE_SENSOR7           MTOUCH_SENSOR0   
00231     #define CVD_REFERENCE_SENSOR8           MTOUCH_SENSOR0   
00232     #define CVD_REFERENCE_SENSOR9           MTOUCH_SENSOR0   
00233     #define CVD_REFERENCE_SENSOR10          MTOUCH_SENSOR0   
00234     #define CVD_REFERENCE_SENSOR11          MTOUCH_SENSOR0   
00235     #define CVD_REFERENCE_SENSOR12          MTOUCH_SENSOR0   
00236     #define CVD_REFERENCE_SENSOR13          MTOUCH_SENSOR0   
00237     #define CVD_REFERENCE_SENSOR14          MTOUCH_SENSOR0   
00238     #define CVD_REFERENCE_SENSOR15          MTOUCH_SENSOR0   
00239     #define CVD_REFERENCE_SENSOR16          MTOUCH_SENSOR0   
00240     #define CVD_REFERENCE_SENSOR17          MTOUCH_SENSOR0   
00241     #define CVD_REFERENCE_SENSOR18          MTOUCH_SENSOR0   
00242     #define CVD_REFERENCE_SENSOR19          MTOUCH_SENSOR0   
00243     #define CVD_REFERENCE_SENSOR20          MTOUCH_SENSOR0   
00244     #define CVD_REFERENCE_SENSOR21          MTOUCH_SENSOR0   
00245     #define CVD_REFERENCE_SENSOR22          MTOUCH_SENSOR0 
00246     #define CVD_REFERENCE_SENSOR23          MTOUCH_SENSOR0  
00247     #define CVD_REFERENCE_SENSOR24          MTOUCH_SENSOR0  
00248     #define CVD_REFERENCE_SENSOR25          MTOUCH_SENSOR0  
00249     #define CVD_REFERENCE_SENSOR26          MTOUCH_SENSOR0  
00250     #define CVD_REFERENCE_SENSOR27          MTOUCH_SENSOR0  
00251     #define CVD_REFERENCE_SENSOR28          MTOUCH_SENSOR0  
00252     #define CVD_REFERENCE_SENSOR29          MTOUCH_SENSOR0    
00253 

mTouch Framework v2.1 documentation by  Click here to visit our website at www.microchip.com