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

mTouch_hardwareProfile_16F91x.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_16F91x.h
00006  *  Dependencies:    mTouch.h
00007  *  Processor:       See documentation for supported PIC® microcontrollers 
00008  *  Compiler:        HI-TECH PRO Ver. 9.80 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. 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  *************************************************************************/
00056 
00057 #if !defined(__MTOUCHCVD_HARDWARE_16F91X_H)
00058 #define __MTOUCHCVD_HARDWARE_16F91X_H
00059 
00060 #if !defined(_16F913)
00061 #if !defined(_16F914)
00062 #if !defined(_16F916)
00063 #if !defined(_16F917)
00064 #if !defined(_16F946)
00065     #error The current mTouch hardware include file does not support this PIC microcontroller.
00066 #endif
00067 #endif
00068 #endif
00069 #endif
00070 #endif
00071 
00072 #if defined(_16F913) || defined(_16F916)
00073     #if MTOUCH_NUMBER_SENSORS > 5
00074         #error The current mTouch microcontroller is not able to support more than 5 sensors due to pinout limitations.
00075     #endif
00076     #if MTOUCH_NUMBER_OF_SLEEP_SENSORS > 5
00077         #error The current mTouch microcontroller is not able to support more than 5 sleep-mode sensors due to pinout limitations.
00078     #endif
00079 #endif
00080 #if defined(_16F914) || defined(_16F917) || defined(_16F946)
00081     #if MTOUCH_NUMBER_SENSORS > 8
00082         #error The current mTouch microcontroller is not able to support more than 8 sensors due to pinout limitations.
00083     #endif
00084 #endif
00085 
00086 //===========================================================
00087 //  Device Configuration
00088 //===========================================================
00089 #define MTOUCH_USE_PORT
00090 
00091 //===========================================================
00092 //  Communications Configuration
00093 //===========================================================
00094 #define PIC_UART_AVAILABLE
00095 #define PIC_UART_BAUD_BITS          8
00096 
00097 #define PIC_TIMER0_AVAILABLE
00098 #define PIC_TIMER1_AVAILABLE
00099 #define PIC_TIMER2_AVAILABLE
00100     
00101 //===========================================================
00102 //  ADC Configuration
00103 //===========================================================
00104 #define PIC_ADC_BITS                10
00105 
00106 #if defined(_16F913) || defined(_16F916)
00107     #define PIC_ADC_UNIMP_AVAILABLE
00108 #endif
00109 
00110 #define PIC_ADC_ADCS                ADCON1bits.ADCS
00111 #define PIC_ADC_ADFM                ADCON0bits.ADFM
00112 #define PIC_ADC_ADON                ADCON0bits.ADON
00113 
00114 #define PIC_ADC_ADCS_FOSC2          0b000
00115 #define PIC_ADC_ADCS_FOSC4          0b100
00116 #define PIC_ADC_ADCS_FOSC8          0b001
00117 #define PIC_ADC_ADCS_FOSC16         0b101
00118 #define PIC_ADC_ADCS_FOSC32         0b010
00119 #define PIC_ADC_ADCS_FOSC64         0b110
00120 #define PIC_ADC_ADCS_FRC            0b111
00121 
00122 #define PIC_ADC_ADFM_RIGHT          1
00123 #define PIC_ADC_ADFM_LEFT           0
00124 
00125 #if     _XTAL_FREQ == 8000000 
00126     #define PIC_ADC_SETCLK()    PIC_ADC_ADCS = PIC_ADC_ADCS_FOSC16
00127     #define PIC_ADC_TAD         2 
00128 #elif   _XTAL_FREQ == 4000000 
00129     #define PIC_ADC_SETCLK()    PIC_ADC_ADCS = PIC_ADC_ADCS_FOSC8
00130     #define PIC_ADC_TAD         2 
00131 #elif   _XTAL_FREQ == 2000000 
00132     #define PIC_ADC_SETCLK()    PIC_ADC_ADCS = PIC_ADC_ADCS_FOSC4
00133     #define PIC_ADC_TAD         2 
00134 #elif   _XTAL_FREQ == 1000000 
00135     #define PIC_ADC_SETCLK()    PIC_ADC_ADCS = PIC_ADC_ADCS_FOSC2
00136     #define PIC_ADC_TAD         2 
00137 #else
00138     #error No predefined ADC clock values for the chosen _XTAL_FREQ.
00139 #endif
00140 
00141 
00142 //===========================================================
00143 //  DAC Configuration
00144 //===========================================================
00145 // NOT AVAILABLE
00146 
00147 
00148 //===========================================================
00149 //  Software-enabled Watchdog Timer Configuration
00150 //===========================================================
00151 // NOT AVAILABLE
00152 
00153 
00154 //===========================================================
00155 //  Analog Port Mapping
00156 //  - Right Justification
00157 //  - VDD/VSS Reference
00158 //  - GO/DONE cleared
00159 //  - ADON enabled
00160 //===========================================================
00161 #define MTOUCH_AD_AN0               0x81
00162 #define MTOUCH_AD_AN1               0x85
00163 #define MTOUCH_AD_AN2               0x89
00164 #define MTOUCH_AD_AN3               0x8D
00165 #define MTOUCH_AD_AN4               0x91
00166 
00167 #if defined(_16F914) || defined(_16F917) || defined(_16F946)
00168     #define MTOUCH_AD_AN5           0x95
00169     #define MTOUCH_AD_AN6           0x99
00170     #define MTOUCH_AD_AN7           0x9D
00171 #endif
00172 #if defined(_16F913) || defined(_16F916)
00173     #define MTOUCH_AD_ISO_AND_GO    0x97
00174     #define MTOUCH_AD_ISO_NOGO      0x95
00175 #endif
00176 
00177 #define MTOUCH_PIN_AN0              0
00178 #define MTOUCH_PIN_AN1              1
00179 #define MTOUCH_PIN_AN2              2
00180 #define MTOUCH_PIN_AN3              3
00181 #define MTOUCH_PIN_AN4              5
00182 #define MTOUCH_PIN_AN5              0
00183 #define MTOUCH_PIN_AN6              1
00184 #define MTOUCH_PIN_AN7              2
00185 
00186 #define MTOUCH_LETTER_AN0           A
00187 #define MTOUCH_LETTER_AN1           A
00188 #define MTOUCH_LETTER_AN2           A
00189 #define MTOUCH_LETTER_AN3           A
00190 #define MTOUCH_LETTER_AN4           A
00191 #define MTOUCH_LETTER_AN5           E
00192 #define MTOUCH_LETTER_AN6           E
00193 #define MTOUCH_LETTER_AN7           E
00194 
00195 #endif
00196 

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