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

mTouch_hardwareProfile_16F152x.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_16F152x.h
00006  *  Dependencies:    mTouch.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_16F152X_H)
00060 #define __MTOUCH_HARDWARE_16F152X_H
00061 
00062 #if !defined(_16F1526) && !defined(_16LF1526)
00063 #if !defined(_16F1527) && !defined(_16LF1527)
00064     #error The current mTouch hardware include file does not support this PIC microcontroller.
00065 #endif
00066 #endif
00067 
00068 //===========================================================
00069 //  Device Configuration
00070 //===========================================================
00071 
00072 
00073 //===========================================================
00074 //  Communications Configuration
00075 //===========================================================
00076 #define PIC_UART_AVAILABLE
00077 #define PIC_UART_BAUD_BITS          16
00078 
00079 
00080 #define PIC_TIMER0_AVAILABLE
00081 #define PIC_TIMER1_AVAILABLE
00082 #define PIC_TIMER3_AVAILABLE
00083 #define PIC_TIMER5_AVAILABLE
00084 #define PIC_TIMER2_AVAILABLE
00085 #define PIC_TIMER4_AVAILABLE
00086 #define PIC_TIMER6_AVAILABLE
00087 #define PIC_TIMER8_AVAILABLE
00088 #define PIC_TIMER10_AVAILABLE
00089 
00090 //===========================================================
00091 //  ADC Configuration
00092 //===========================================================
00093 #define PIC_ADC_BITS                10
00094 
00095 #define PIC_ADC_ADCS                ADCON1bits.ADCS
00096 #define PIC_ADC_ADFM                ADCON1bits.ADFM
00097 #define PIC_ADC_ADON                ADCON0bits.ADON
00098 
00099 #define PIC_ADC_ADCS_FOSC2          0b000
00100 #define PIC_ADC_ADCS_FOSC4          0b100
00101 #define PIC_ADC_ADCS_FOSC8          0b001
00102 #define PIC_ADC_ADCS_FOSC16         0b101
00103 #define PIC_ADC_ADCS_FOSC32         0b010
00104 #define PIC_ADC_ADCS_FOSC64         0b110
00105 #define PIC_ADC_ADCS_FRC            0b111
00106 
00107 #define PIC_ADC_ADFM_RIGHT          1
00108 #define PIC_ADC_ADFM_LEFT           0
00109 
00110 #if     _XTAL_FREQ == 16000000 
00111     #define PIC_ADC_SETCLK()    PIC_ADC_ADCS = PIC_ADC_ADCS_FOSC16
00112     #define PIC_ADC_TAD         1 
00113 #elif   _XTAL_FREQ ==  8000000 
00114     #define PIC_ADC_SETCLK()    PIC_ADC_ADCS = PIC_ADC_ADCS_FOSC8
00115     #define PIC_ADC_TAD         1  
00116 #elif   _XTAL_FREQ ==  4000000 
00117     #define PIC_ADC_SETCLK()    PIC_ADC_ADCS = PIC_ADC_ADCS_FOSC4
00118     #define PIC_ADC_TAD         1 
00119 #elif   _XTAL_FREQ ==  2000000 
00120     #define PIC_ADC_SETCLK()    PIC_ADC_ADCS = PIC_ADC_ADCS_FOSC2
00121     #define PIC_ADC_TAD         1
00122 #elif   _XTAL_FREQ ==  1000000 
00123     #define PIC_ADC_SETCLK()    PIC_ADC_ADCS = PIC_ADC_ADCS_FOSC2
00124     #define PIC_ADC_TAD         2
00125 #else
00126     #error No predefined ADC clock values for the chosen _XTAL_FREQ.
00127 #endif
00128 
00129 //===========================================================
00130 //  DAC Configuration
00131 //===========================================================
00132 // NOT AVAILABLE
00133 #if MTOUCH_NUMBER_SENSORS == 1
00134     #error Single-sensor scanning code not currently compatible with the PIC16F152x family due to the lack of a DAC module.
00135 #endif
00136 
00137 //===========================================================
00138 //  Software-enabled Watchdog Timer Configuration
00139 //===========================================================
00140 #define PIC_SWDTEN_AVAILABLE
00141 #define PIC_SWDTEN_OFF()                WDTCONbits.SWDTEN = 0
00142 #define PIC_SWDTEN_ON()                 WDTCONbits.SWDTEN = 1
00143 
00144 
00145 //===========================================================
00146 //  Analog Port Mapping
00147 //  - Right Justification
00148 //  - VDD/VSS Reference
00149 //  - GO/DONE cleared
00150 //  - ADON enabled
00151 //===========================================================
00152 #define MTOUCH_AD_AN0           0x01
00153 #define MTOUCH_AD_AN1           0x05
00154 #define MTOUCH_AD_AN2           0x09
00155 #define MTOUCH_AD_AN3           0x0D
00156 #define MTOUCH_AD_AN4           0x11
00157 #define MTOUCH_AD_AN5           0x15
00158 #define MTOUCH_AD_AN6           0x19
00159 #define MTOUCH_AD_AN7           0x1D
00160 #define MTOUCH_AD_AN8           0x21
00161 #define MTOUCH_AD_AN9           0x25
00162 #define MTOUCH_AD_AN10          0x29
00163 #define MTOUCH_AD_AN11          0x2D
00164 #define MTOUCH_AD_AN12          0x31
00165 #define MTOUCH_AD_AN13          0x35
00166 #define MTOUCH_AD_AN14          0x39
00167 #define MTOUCH_AD_AN15          0x3D
00168 #define MTOUCH_AD_AN16          0x41
00169 #define MTOUCH_AD_AN17          0x45
00170 #define MTOUCH_AD_AN18          0x49
00171 #define MTOUCH_AD_AN19          0x4D
00172 #define MTOUCH_AD_AN20          0x51
00173 #define MTOUCH_AD_AN21          0x55
00174 #define MTOUCH_AD_AN22          0x59
00175 #define MTOUCH_AD_AN23          0x5D
00176 #define MTOUCH_AD_AN24          0x61
00177 #define MTOUCH_AD_AN25          0x65
00178 #define MTOUCH_AD_AN26          0x69
00179 #define MTOUCH_AD_AN27          0x6D
00180 #define MTOUCH_AD_AN28          0x71
00181 #define MTOUCH_AD_AN29          0x75
00182 #define MTOUCH_AD_FVR_AND_GO    0x7F 
00183 
00184 #define MTOUCH_PIN_AN0          0
00185 #define MTOUCH_PIN_AN1          1
00186 #define MTOUCH_PIN_AN2          2
00187 #define MTOUCH_PIN_AN3          3
00188 #define MTOUCH_PIN_AN4          5
00189 #define MTOUCH_PIN_AN5          7
00190 #define MTOUCH_PIN_AN6          1   
00191 #define MTOUCH_PIN_AN7          2
00192 #define MTOUCH_PIN_AN8          3
00193 #define MTOUCH_PIN_AN9          4
00194 #define MTOUCH_PIN_AN10         5
00195 #define MTOUCH_PIN_AN11         6
00196 #define MTOUCH_PIN_AN12         4
00197 #define MTOUCH_PIN_AN13         3
00198 #define MTOUCH_PIN_AN14         2
00199 #define MTOUCH_PIN_AN15         1
00200 #define MTOUCH_PIN_AN16         0
00201 #define MTOUCH_PIN_AN17         0
00202 #define MTOUCH_PIN_AN18         1
00203 #define MTOUCH_PIN_AN19         2
00204 #define MTOUCH_PIN_AN20         3
00205 #define MTOUCH_PIN_AN21         4
00206 #define MTOUCH_PIN_AN22         5
00207 #define MTOUCH_PIN_AN23         0
00208 #define MTOUCH_PIN_AN24         1
00209 #define MTOUCH_PIN_AN25         2
00210 #define MTOUCH_PIN_AN26         3
00211 #define MTOUCH_PIN_AN27         0
00212 #define MTOUCH_PIN_AN28         1
00213 #define MTOUCH_PIN_AN29         2
00214 
00215 #define MTOUCH_LETTER_AN0       A
00216 #define MTOUCH_LETTER_AN1       A
00217 #define MTOUCH_LETTER_AN2       A
00218 #define MTOUCH_LETTER_AN3       A
00219 #define MTOUCH_LETTER_AN4       A
00220 #define MTOUCH_LETTER_AN5       F
00221 #define MTOUCH_LETTER_AN6       F
00222 #define MTOUCH_LETTER_AN7       F
00223 #define MTOUCH_LETTER_AN8       F
00224 #define MTOUCH_LETTER_AN9       F
00225 #define MTOUCH_LETTER_AN10      F
00226 #define MTOUCH_LETTER_AN11      F
00227 #define MTOUCH_LETTER_AN12      G
00228 #define MTOUCH_LETTER_AN13      G
00229 #define MTOUCH_LETTER_AN14      G
00230 #define MTOUCH_LETTER_AN15      G 
00231 #define MTOUCH_LETTER_AN16      F  
00232 #define MTOUCH_LETTER_AN17      B
00233 #define MTOUCH_LETTER_AN18      B
00234 #define MTOUCH_LETTER_AN19      B
00235 #define MTOUCH_LETTER_AN20      B
00236 #define MTOUCH_LETTER_AN21      B
00237 #define MTOUCH_LETTER_AN22      B
00238 #define MTOUCH_LETTER_AN23      D
00239 #define MTOUCH_LETTER_AN24      D
00240 #define MTOUCH_LETTER_AN25      D
00241 #define MTOUCH_LETTER_AN26      D
00242 #define MTOUCH_LETTER_AN27      E
00243 #define MTOUCH_LETTER_AN28      E
00244 #define MTOUCH_LETTER_AN29      E
00245 
00246 
00247 #endif
00248 
00249 

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