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

mTouch_hardwareProfile_16F184x.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_16F184x.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_16F184X_H)
00060 #define __MTOUCH_HARDWARE_16F184X_H
00061 
00062 #if !defined(_16F1847) && !defined(_16LF1847)
00063     #error The current mTouch hardware include file does not support this PIC microcontroller.
00064 #endif
00065 
00066 #if MTOUCH_NUMBER_SENSORS > 12
00067     #error The PIC16F/LF1847 is not able to support more than 12 sensors due to pinout limitations.
00068 #endif
00069 
00070 
00071 #if ((MTOUCH_COMM_TYPE == MTOUCH_COMM_RS232_1WAY_ASCII) && !defined(MTOUCH_COMM_ASCII_SOFT_ENABLED)) || (MTOUCH_COMM_TYPE == MTOUCH_COMM_RS232_2WAY_BINARY)
00072 #if !defined(APFCON_INITIALIZED)
00073     #warning The mTouch comm module does not automatically set the APFCON# register. The TX pin may be selectable. This warning can be removed by defining the precompiler variable 'APFCON_INITIALIZED' in the mTouch_config.h file - verifying that you've initialized this register.
00074 #endif
00075 #endif
00076 
00077 //===========================================================
00078 //  Device Configuration
00079 //===========================================================
00080 
00081 
00082 //===========================================================
00083 //  Communications Configuration
00084 //===========================================================
00085 #define PIC_UART_AVAILABLE
00086 #define PIC_UART_BAUD_BITS          16
00087 
00088 #define PIC_TIMER0_AVAILABLE
00089 #define PIC_TIMER1_AVAILABLE
00090 #define PIC_TIMER2_AVAILABLE
00091 #define PIC_TIMER4_AVAILABLE
00092 #define PIC_TIMER6_AVAILABLE
00093 
00094 //===========================================================
00095 //  ADC Configuration
00096 //===========================================================
00097 #define PIC_ADC_BITS                10
00098 #define PIC_ADC_UNIMP_AVAILABLE
00099 
00100 #define PIC_ADC_ADCS                ADCON1bits.ADCS
00101 #define PIC_ADC_ADFM                ADCON1bits.ADFM
00102 #define PIC_ADC_ADON                ADCON0bits.ADON
00103 
00104 #define PIC_ADC_ADCS_FOSC2          0b000
00105 #define PIC_ADC_ADCS_FOSC4          0b100
00106 #define PIC_ADC_ADCS_FOSC8          0b001
00107 #define PIC_ADC_ADCS_FOSC16         0b101
00108 #define PIC_ADC_ADCS_FOSC32         0b010
00109 #define PIC_ADC_ADCS_FOSC64         0b110
00110 #define PIC_ADC_ADCS_FRC            0b111
00111 
00112 #define PIC_ADC_ADFM_RIGHT          1
00113 #define PIC_ADC_ADFM_LEFT           0
00114 
00115 #if     _XTAL_FREQ == 32000000 
00116     #define PIC_ADC_SETCLK()    PIC_ADC_ADCS = PIC_ADC_ADCS_FOSC32
00117     #define PIC_ADC_TAD         1
00118 #elif   _XTAL_FREQ == 16000000 
00119     #define PIC_ADC_SETCLK()    PIC_ADC_ADCS = PIC_ADC_ADCS_FOSC16
00120     #define PIC_ADC_TAD         1 
00121 #elif   _XTAL_FREQ ==  8000000 
00122     #define PIC_ADC_SETCLK()    PIC_ADC_ADCS = PIC_ADC_ADCS_FOSC8
00123     #define PIC_ADC_TAD         1  
00124 #elif   _XTAL_FREQ ==  4000000 
00125     #define PIC_ADC_SETCLK()    PIC_ADC_ADCS = PIC_ADC_ADCS_FOSC4
00126     #define PIC_ADC_TAD         1 
00127 #elif   _XTAL_FREQ ==  2000000 
00128     #define PIC_ADC_SETCLK()    PIC_ADC_ADCS = PIC_ADC_ADCS_FOSC2
00129     #define PIC_ADC_TAD         1
00130 #elif   _XTAL_FREQ ==  1000000 
00131     #define PIC_ADC_SETCLK()    PIC_ADC_ADCS = PIC_ADC_ADCS_FOSC2
00132     #define PIC_ADC_TAD         2
00133 #else
00134     #error No predefined ADC clock values for the chosen _XTAL_FREQ.
00135 #endif
00136 
00137 
00138 //===========================================================
00139 //  DAC Configuration
00140 //===========================================================
00141 #define PIC_DAC_AVAILABLE
00142 #define PIC_DACOUT_AVAILABLE
00143 
00144 #define PIC_DACOUT_TRIS_C               TRISA2
00145 #define PIC_DACOUT_LAT_C                LATA2
00146 #define PIC_DACOUT_LAT_ASM              _LATA
00147 #define PIC_DACOUT_PIN                  2
00148 
00149 #define PIC_DACCON0_VDD                 0xC0
00150 #define PIC_DACCON1_VDD                 0x1F
00151 #define PIC_DACCON0_VSS                 0x80
00152 #define PIC_DACCON1_VSS                 0x00
00153 
00154 #define PIC_DACOUT_DACCON0_VSS          0xA0
00155 #define PIC_DACOUT_DACCON0_1_3RD_VDD    0xA0
00156 #define PIC_DACOUT_DACCON0_HALF_VDD     0xA0
00157 #define PIC_DACOUT_DACCON0_2_3RD_VDD    0xE0
00158 #define PIC_DACOUT_DACCON0_VDD          0xE0
00159 
00160 #define PIC_DACOUT_DACCON1_VSS          0x00
00161 #define PIC_DACOUT_DACCON1_1_3RD_VDD    0x0B
00162 #define PIC_DACOUT_DACCON1_HALF_VDD     0x10
00163 #define PIC_DACOUT_DACCON1_2_3RD_VDD    0x16
00164 #define PIC_DACOUT_DACCON1_VDD          0x1F
00165 
00166 
00167 //===========================================================
00168 //  Software-enabled Watchdog Timer Configuration
00169 //===========================================================
00170 #define PIC_SWDTEN_AVAILABLE
00171 #define PIC_SWDTEN_OFF()                WDTCONbits.SWDTEN = 0
00172 #define PIC_SWDTEN_ON()                 WDTCONbits.SWDTEN = 1
00173 
00174 
00175 
00176 //===========================================================
00177 //  Analog Port Mapping
00178 //  - Right Justification
00179 //  - VDD/VSS Reference
00180 //  - GO/DONE cleared
00181 //  - ADON enabled
00182 //===========================================================
00183 #define MTOUCH_AD_AN0           0x01
00184 #define MTOUCH_AD_AN1           0x05
00185 #define MTOUCH_AD_AN2           0x09
00186 #define MTOUCH_AD_AN3           0x0D
00187 #define MTOUCH_AD_AN4           0x11
00188 #define MTOUCH_AD_AN5           0x15
00189 #define MTOUCH_AD_AN6           0x19
00190 #define MTOUCH_AD_AN7           0x1D
00191 #define MTOUCH_AD_AN8           0x21
00192 #define MTOUCH_AD_AN9           0x25
00193 #define MTOUCH_AD_AN10          0x29
00194 #define MTOUCH_AD_AN11          0x2D
00195 #define MTOUCH_AD_DAC_AND_GO    0x7B
00196 #define MTOUCH_AD_DAC_NOGO      0x79
00197 #define MTOUCH_AD_ISO_AND_GO    0x33
00198 #define MTOUCH_AD_ISO_NOGO      0x31
00199 
00200 
00201 #define MTOUCH_PIN_AN0          0
00202 #define MTOUCH_PIN_AN1          1
00203 #define MTOUCH_PIN_AN2          2
00204 #define MTOUCH_PIN_AN3          3
00205 #define MTOUCH_PIN_AN4          4
00206 #define MTOUCH_PIN_AN5          6
00207 #define MTOUCH_PIN_AN6          7
00208 #define MTOUCH_PIN_AN7          5
00209 #define MTOUCH_PIN_AN8          4
00210 #define MTOUCH_PIN_AN9          3
00211 #define MTOUCH_PIN_AN10         2
00212 #define MTOUCH_PIN_AN11         1
00213 
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       B
00221 #define MTOUCH_LETTER_AN6       B
00222 #define MTOUCH_LETTER_AN7       B
00223 #define MTOUCH_LETTER_AN8       B
00224 #define MTOUCH_LETTER_AN9       B
00225 #define MTOUCH_LETTER_AN10      B
00226 #define MTOUCH_LETTER_AN11      B
00227 
00228 
00229 #endif
00230 
00231 

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