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

mTouch_hardwareProfile_16F81x.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_16F81x.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 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_16F81X_H)
00060 #define __MTOUCH_HARDWARE_16F81X_H
00061 
00062 #if !defined(_16F818)
00063 #if !defined(_16F819)
00064     #error The current mTouch hardware include file does not support this PIC microcontroller.
00065 #endif
00066 #endif
00067 
00068 #if MTOUCH_NUMBER_SENSORS > 5
00069     #error The current mTouch microcontroller is not able to support more than 5 sensors on the mTouch Framework due to pinout limitations.
00070 #endif
00071 #if MTOUCH_NUMBER_OF_SLEEP_SENSORS > 5
00072     #error The current mTouch microcontroller is not able to support more than 5 sleep-mode sensors due to pinout limitations.
00073 #endif
00074 
00075 //===========================================================
00076 //  Device Configuration
00077 //===========================================================
00078 #define MTOUCH_USE_PORT
00079 
00080 
00081 //===========================================================
00082 //  Communications Configuration
00083 //===========================================================
00084 // NO UART AVAILABLE
00085 
00086 #define PIC_TIMER0_AVAILABLE
00087 #define PIC_TIMER1_AVAILABLE
00088 #define PIC_TIMER2_AVAILABLE
00089 
00090 //===========================================================
00091 //  ADC Configuration
00092 //===========================================================
00093 #define PIC_ADC_BITS                10
00094 #define PIC_ADC_UNIMP_AVAILABLE
00095 
00096 #define PIC_ADC_ADCS                ADCON0bits.ADCS
00097 #define PIC_ADC_ADCS2               ADCON1bits.ADCS2
00098 #define PIC_ADC_ADFM                ADCON1bits.ADFM
00099 #define PIC_ADC_ADON                ADCON0bits.ADON
00100 
00101 #define PIC_ADC_ADCS_FOSC2          0b00
00102 #define PIC_ADC_ADCS_FOSC4          0b00
00103 #define PIC_ADC_ADCS_FOSC8          0b01
00104 #define PIC_ADC_ADCS_FOSC16         0b01
00105 #define PIC_ADC_ADCS_FOSC32         0b10
00106 #define PIC_ADC_ADCS_FOSC64         0b10
00107 #define PIC_ADC_ADCS_FRC            0b11
00108 
00109 #if     _XTAL_FREQ == 8000000 
00110     #define PIC_ADC_SETCLK()    PIC_ADC_ADCS2 = 1; PIC_ADC_ADCS = PIC_ADC_ADCS_FOSC16
00111     #define PIC_ADC_TAD         2 
00112     #define PIC_ADC_CLK_MASK    0x40
00113 #elif   _XTAL_FREQ == 4000000 
00114     #define PIC_ADC_SETCLK()    PIC_ADC_ADCS2 = 0; PIC_ADC_ADCS = PIC_ADC_ADCS_FOSC8
00115     #define PIC_ADC_TAD         2 
00116     #define PIC_ADC_CLK_MASK    0x40
00117 #elif   _XTAL_FREQ == 1000000 
00118     #define PIC_ADC_SETCLK()    PIC_ADC_ADCS2 = 0; PIC_ADC_ADCS = PIC_ADC_ADCS_FOSC2
00119     #define PIC_ADC_TAD         2 
00120     #define PIC_ADC_CLK_MASK    0x00
00121 #else
00122     #error No predefined ADC clock values for the chosen _XTAL_FREQ.
00123 #endif
00124 
00125 
00126 //===========================================================
00127 //  DAC Configuration
00128 //===========================================================
00129 // NOT AVAILABLE
00130 
00131 //===========================================================
00132 //  Software-enabled Watchdog Timer Configuration
00133 //===========================================================
00134 // NOT AVAILABLE
00135 
00136 
00137 
00138 //===========================================================
00139 //  Analog Port Mapping
00140 //  - Right Justification
00141 //  - VDD/VSS Reference
00142 //  - GO/DONE cleared
00143 //  - ADON enabled
00144 //===========================================================
00145 #define MTOUCH_AD_AN0           0x01 | PIC_ADC_CLK_MASK
00146 #define MTOUCH_AD_AN1           0x09 | PIC_ADC_CLK_MASK
00147 #define MTOUCH_AD_AN2           0x11 | PIC_ADC_CLK_MASK
00148 #define MTOUCH_AD_AN3           0x19 | PIC_ADC_CLK_MASK
00149 #define MTOUCH_AD_AN4           0x21 | PIC_ADC_CLK_MASK
00150 #define MTOUCH_AD_ISO_NOGO      0x29 | PIC_ADC_CLK_MASK
00151 #define MTOUCH_AD_ISO_AND_GO    0x2D | PIC_ADC_CLK_MASK
00152 
00153 #define MTOUCH_PIN_AN0          0
00154 #define MTOUCH_PIN_AN1          1
00155 #define MTOUCH_PIN_AN2          2
00156 #define MTOUCH_PIN_AN3          3
00157 #define MTOUCH_PIN_AN4          4
00158 
00159 #define MTOUCH_LETTER_AN0       A
00160 #define MTOUCH_LETTER_AN1       A
00161 #define MTOUCH_LETTER_AN2       A
00162 #define MTOUCH_LETTER_AN3       A
00163 #define MTOUCH_LETTER_AN4       A
00164 
00165 
00166 #endif
00167 

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