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

mTouch_hardwareProfile_16F151x.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_HardwareProfile_16F151x.h
00006  *  Dependencies:    mTouchCVD.h
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:     mTouch CVD Framework Hardware Profile Header File
00014  *                   - Provides information about correct SFR addresses,
00015  *                     pin assignments, module availability, and any other
00016  *                     part-specific data.
00017  *                   - See the documentation for more information.
00018  *************************************************************************/
00019  /**************************************************************************
00020  * MICROCHIP SOFTWARE NOTICE AND DISCLAIMER: You may use this software, and 
00021  * any derivatives created by any person or entity by or on your behalf, 
00022  * exclusively with Microchip's products in accordance with applicable
00023  * software license terms and conditions, a copy of which is provided for
00024  * your referencein accompanying documentation. Microchip and its licensors 
00025  * retain all ownership and intellectual property rights in the 
00026  * accompanying software and in all derivatives hereto. 
00027  * 
00028  * This software and any accompanying information is for suggestion only. 
00029  * It does not modify Microchip's standard warranty for its products. You 
00030  * agree that you are solely responsible for testing the software and 
00031  * determining its suitability. Microchip has no obligation to modify, 
00032  * test, certify, or support the software. 
00033  * 
00034  * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER 
00035  * EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED 
00036  * WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A 
00037  * PARTICULAR PURPOSE APPLY TO THIS SOFTWARE, ITS INTERACTION WITH 
00038  * MICROCHIP'S PRODUCTS, COMBINATION WITH ANY OTHER PRODUCTS, OR USE IN ANY 
00039  * APPLICATION. 
00040  * 
00041  * IN NO EVENT, WILL MICROCHIP BE LIABLE, WHETHER IN CONTRACT, WARRANTY, 
00042  * TORT (INCLUDING NEGLIGENCE OR BREACH OF STATUTORY DUTY), STRICT 
00043  * LIABILITY, INDEMNITY, CONTRIBUTION, OR OTHERWISE, FOR ANY INDIRECT, 
00044  * SPECIAL, PUNITIVE, EXEMPLARY, INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, 
00045  * FOR COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE SOFTWARE, 
00046  * HOWSOEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY 
00047  * OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT ALLOWABLE BY LAW, 
00048  * MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY RELATED TO THIS 
00049  * SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, THAT YOU HAVE PAID 
00050  * DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. 
00051  * 
00052  * MICROCHIP PROVIDES THIS SOFTWARE CONDITIONALLY UPON YOUR ACCEPTANCE OF 
00053  * THESE TERMS. 
00054  *************************************************************************/
00058 
00059 #if !defined(__MTOUCH_HARDWARE_16F151X_H)
00060 #define __MTOUCH_HARDWARE_16F151X_H
00061 
00062 #if !defined(_16F1516) && !defined(_16LF1516)
00063 #if !defined(_16F1517) && !defined(_16LF1517)
00064 #if !defined(_16F1518) && !defined(_16LF1518)
00065 #if !defined(_16F1519) && !defined(_16LF1519)
00066     #error The current mTouch hardware include file does not support this PIC microcontroller.
00067 #endif
00068 #endif
00069 #endif
00070 #endif
00071 
00072 #if defined(_16F1516) || defined(_16LF1516)
00073     #if MTOUCH_NUMBER_SENSORS > 17
00074         #error The PIC16F/LF1516 is not able to support more than 17 sensors due to pinout limitations.
00075     #endif
00076 #endif
00077 #if defined(_16F1517) || defined(_16LF1517)
00078     #if MTOUCH_NUMBER_SENSORS > 22
00079         #error The PIC16F/LF1517 is not able to support more than 22 sensors due to memory limitations.
00080     #endif
00081 #endif
00082 #if defined(_16F1518) || defined(_16LF1518)
00083     #if MTOUCH_NUMBER_SENSORS > 17
00084         #error The PIC16F/LF1518 is not able to support more than 17 sensors due to pinout limitations.
00085     #endif
00086 #endif
00087 #if defined(_16F1519) || defined(_16LF1519)
00088     #if MTOUCH_NUMBER_SENSORS > 22
00089         #error The PIC16F/LF1519 is not able to support more than 22 sensors due to memory limitations.
00090     #endif
00091 #endif
00092 
00093 //===========================================================
00094 //  Device Configuration
00095 //===========================================================
00096 
00097 
00098 //===========================================================
00099 //  Communications Configuration
00100 //===========================================================
00101 #define PIC_UART_AVAILABLE
00102 #define PIC_UART_BAUD_BITS                  16
00103 
00104 #define PIC_TIMER0_AVAILABLE
00105 #define PIC_TIMER1_AVAILABLE
00106 #define PIC_TIMER2_AVAILABLE
00107 
00108 //===========================================================
00109 //  ADC Configuration
00110 //===========================================================
00111 #define PIC_ADC_BITS                10
00112 
00113 #if defined(_16F1516) || defined(_16F1518)
00114     #define PIC_ADC_UNIMP_AVAILABLE
00115 #endif
00116 
00117 #define PIC_ADC_ADCS                ADCON1bits.ADCS
00118 #define PIC_ADC_ADFM                ADCON1bits.ADFM
00119 #define PIC_ADC_ADON                ADCON0bits.ADON
00120 
00121 #define PIC_ADC_ADCS_FOSC2          0b000
00122 #define PIC_ADC_ADCS_FOSC4          0b100
00123 #define PIC_ADC_ADCS_FOSC8          0b001
00124 #define PIC_ADC_ADCS_FOSC16         0b101
00125 #define PIC_ADC_ADCS_FOSC32         0b010
00126 #define PIC_ADC_ADCS_FOSC64         0b110
00127 #define PIC_ADC_ADCS_FRC            0b111
00128 
00129 #define PIC_ADC_ADFM_RIGHT          1
00130 #define PIC_ADC_ADFM_LEFT           0
00131 
00132 #if     _XTAL_FREQ == 16000000 
00133     #define PIC_ADC_SETCLK()    PIC_ADC_ADCS = PIC_ADC_ADCS_FOSC16
00134     #define PIC_ADC_TAD         1 
00135 #elif   _XTAL_FREQ ==  8000000 
00136     #define PIC_ADC_SETCLK()    PIC_ADC_ADCS = PIC_ADC_ADCS_FOSC8
00137     #define PIC_ADC_TAD         1  
00138 #elif   _XTAL_FREQ ==  4000000 
00139     #define PIC_ADC_SETCLK()    PIC_ADC_ADCS = PIC_ADC_ADCS_FOSC4
00140     #define PIC_ADC_TAD         1 
00141 #elif   _XTAL_FREQ ==  2000000 
00142     #define PIC_ADC_SETCLK()    PIC_ADC_ADCS = PIC_ADC_ADCS_FOSC2
00143     #define PIC_ADC_TAD         1
00144 #elif   _XTAL_FREQ ==  1000000 
00145     #define PIC_ADC_SETCLK()    PIC_ADC_ADCS = PIC_ADC_ADCS_FOSC2
00146     #define PIC_ADC_TAD         2
00147 #else
00148     #error No predefined ADC clock values for the chosen _XTAL_FREQ.
00149 #endif
00150 
00151 //===========================================================
00152 //  DAC Configuration
00153 //===========================================================
00154 // NOT AVAILABLE
00155   
00156 //===========================================================
00157 //  Software-enabled Watchdog Timer Configuration
00158 //===========================================================
00159 #define PIC_SWDTEN_AVAILABLE
00160 #define PIC_SWDTEN_OFF()                WDTCONbits.SWDTEN = 0
00161 #define PIC_SWDTEN_ON()                 WDTCONbits.SWDTEN = 1
00162   
00163   
00164 //===========================================================
00165 //  Analog Port Mapping
00166 //  - Right Justification
00167 //  - VDD/VSS Reference
00168 //  - GO/DONE cleared
00169 //  - ADON enabled
00170 //===========================================================
00171 #define MTOUCH_AD_AN0           0x01
00172 #define MTOUCH_AD_AN1           0x05
00173 #define MTOUCH_AD_AN2           0x09
00174 #define MTOUCH_AD_AN3           0x0D
00175 #define MTOUCH_AD_AN4           0x11
00176 
00177 #define MTOUCH_AD_AN8           0x21
00178 #define MTOUCH_AD_AN9           0x25
00179 #define MTOUCH_AD_AN10          0x29
00180 #define MTOUCH_AD_AN11          0x2D
00181 #define MTOUCH_AD_AN12          0x31
00182 #define MTOUCH_AD_AN13          0x35
00183 #define MTOUCH_AD_AN14          0x39
00184 #define MTOUCH_AD_AN15          0x3D
00185 #define MTOUCH_AD_AN16          0x41
00186 #define MTOUCH_AD_AN17          0x45
00187 #define MTOUCH_AD_AN18          0x49
00188 #define MTOUCH_AD_AN19          0x4D
00189 
00190 #if defined(_16F1517) || defined(_16LF1517) || \
00191     defined(_16F1519) || defined(_16LF1519)
00192     #define MTOUCH_AD_AN20      0x51
00193     #define MTOUCH_AD_AN21      0x55
00194     #define MTOUCH_AD_AN22      0x59
00195     #define MTOUCH_AD_AN23      0x5D
00196     #define MTOUCH_AD_AN24      0x61
00197     #define MTOUCH_AD_AN25      0x65
00198     #define MTOUCH_AD_AN26      0x69
00199     #define MTOUCH_AD_AN27      0x6D
00200     
00201     #define MTOUCH_AD_AN5       0x15
00202     #define MTOUCH_AD_AN6       0x19
00203     #define MTOUCH_AD_AN7       0x1D
00204 #endif
00205 
00206 #define MTOUCH_AD_FVR_AND_GO    0x7F
00207 #define MTOUCH_AD_DAC_NOGO      0x79
00208 #define MTOUCH_AD_ISO_AND_GO    0x73
00209 #define MTOUCH_AD_ISO_NOGO      0x71
00210 
00211 #define MTOUCH_PIN_AN0          0
00212 #define MTOUCH_PIN_AN1          1
00213 #define MTOUCH_PIN_AN2          2
00214 #define MTOUCH_PIN_AN3          3
00215 #define MTOUCH_PIN_AN4          5
00216 #define MTOUCH_PIN_AN5          0
00217 #define MTOUCH_PIN_AN6          1
00218 #define MTOUCH_PIN_AN7          2
00219 #define MTOUCH_PIN_AN8          2
00220 #define MTOUCH_PIN_AN9          3
00221 #define MTOUCH_PIN_AN10         1
00222 #define MTOUCH_PIN_AN11         4
00223 #define MTOUCH_PIN_AN12         0
00224 #define MTOUCH_PIN_AN13         5
00225 #define MTOUCH_PIN_AN14         2
00226 #define MTOUCH_PIN_AN15         3
00227 #define MTOUCH_PIN_AN16         4
00228 #define MTOUCH_PIN_AN17         5
00229 #define MTOUCH_PIN_AN18         6
00230 #define MTOUCH_PIN_AN19         7
00231 #define MTOUCH_PIN_AN20         0
00232 #define MTOUCH_PIN_AN21         1
00233 #define MTOUCH_PIN_AN22         2
00234 #define MTOUCH_PIN_AN23         3
00235 #define MTOUCH_PIN_AN24         4
00236 #define MTOUCH_PIN_AN25         5
00237 #define MTOUCH_PIN_AN26         6
00238 #define MTOUCH_PIN_AN27         7
00239 
00240 #define MTOUCH_LETTER_AN0       A
00241 #define MTOUCH_LETTER_AN1       A
00242 #define MTOUCH_LETTER_AN2       A
00243 #define MTOUCH_LETTER_AN3       A
00244 #define MTOUCH_LETTER_AN4       A
00245 #define MTOUCH_LETTER_AN5       E
00246 #define MTOUCH_LETTER_AN6       E
00247 #define MTOUCH_LETTER_AN7       E
00248 #define MTOUCH_LETTER_AN8       B
00249 #define MTOUCH_LETTER_AN9       B
00250 #define MTOUCH_LETTER_AN10      B
00251 #define MTOUCH_LETTER_AN11      B
00252 #define MTOUCH_LETTER_AN12      B
00253 #define MTOUCH_LETTER_AN13      B
00254 #define MTOUCH_LETTER_AN14      C
00255 #define MTOUCH_LETTER_AN15      C
00256 #define MTOUCH_LETTER_AN16      C
00257 #define MTOUCH_LETTER_AN17      C
00258 #define MTOUCH_LETTER_AN18      C
00259 #define MTOUCH_LETTER_AN19      C
00260 #define MTOUCH_LETTER_AN20      D
00261 #define MTOUCH_LETTER_AN21      D
00262 #define MTOUCH_LETTER_AN22      D
00263 #define MTOUCH_LETTER_AN23      D
00264 #define MTOUCH_LETTER_AN24      D
00265 #define MTOUCH_LETTER_AN25      D
00266 #define MTOUCH_LETTER_AN26      D
00267 #define MTOUCH_LETTER_AN27      D
00268 
00269 
00270 #endif
00271 
00272 

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