00001 /* 00002 * "Copyright (c) 2008 Robert B. Reese, Bryan A. Jones, J. W. Bruce ("AUTHORS")" 00003 * All rights reserved. 00004 * (R. Reese, reese_AT_ece.msstate.edu, Mississippi State University) 00005 * (B. A. Jones, bjones_AT_ece.msstate.edu, Mississippi State University) 00006 * (J. W. Bruce, jwbruce_AT_ece.msstate.edu, Mississippi State University) 00007 * 00008 * Permission to use, copy, modify, and distribute this software and its 00009 * documentation for any purpose, without fee, and without written agreement is 00010 * hereby granted, provided that the above copyright notice, the following 00011 * two paragraphs and the authors appear in all copies of this software. 00012 * 00013 * IN NO EVENT SHALL THE "AUTHORS" BE LIABLE TO ANY PARTY FOR 00014 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT 00015 * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE "AUTHORS" 00016 * HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00017 * 00018 * THE "AUTHORS" SPECIFICALLY DISCLAIMS ANY WARRANTIES, 00019 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 00020 * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS 00021 * ON AN "AS IS" BASIS, AND THE "AUTHORS" HAS NO OBLIGATION TO 00022 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS." 00023 * 00024 * Please maintain this header in its entirety when copying/modifying 00025 * these files. 00026 * 00027 * 00028 */ 00029 00030 // Documentation for this file. If the \file tag isn't present, 00031 // this file won't be documented. 00043 // No relevant defines in pic24_adc.h 00044 00049 // Doxygen 1.5.6 warns that the \copydoc below produces a 00050 // recursive call chain. This warning also appears if 00051 // the referenced file doesn't exist, so it seems like 00052 // Doxygen can find the referenced file. Workaround: this 00053 // file needs to come before all of its references 00054 // alphabetically (i.e. pic24_alibconfig.h puts it before 00055 // pic24_clockfreq.h, which makes the line below work). 00057 // Uncomment one of the #defines below to make 00058 // a clock choice. If all the #defines below 00059 // are commentend, code in pic24_clockfreq.h 00060 // will pick a default clock choice. 00061 #ifndef CLOCK_CONFIG 00062 //#define CLOCK_CONFIG SIM_CLOCK 00063 //#define CLOCK_CONFIG FRCPLL_FCY16MHz 00064 //#define CLOCK_CONFIG FRC_FCY4MHz 00065 //#define CLOCK_CONFIG PRIPLL_8MHzCrystal_16MHzFCY 00066 //#define CLOCK_CONFIG PRI_NO_PLL_7372KHzCrystal 00067 //#define CLOCK_CONFIG FRC_FCY3685KHz 00068 //#define CLOCK_CONFIG FRCPLL_FCY40MHz 00069 //#define CLOCK_CONFIG PRIPLL_7372KHzCrystal_40MHzFCY 00070 //#define CLOCK_CONFIG PRIPLL_8MHzCrystal_40MHzFCY 00071 #endif 00072 00073 // For convenience, choose the fastest 00074 // possible clock depending on which 00075 // processor we're using. If simulation mode is 00076 // selected, then use the simulation clock. 00077 #ifndef CLOCK_CONFIG 00078 #if defined(SIM) 00079 #define CLOCK_CONFIG SIM_CLOCK 00080 #elif defined(EXPLORER16_100P) && defined(__PIC24H__) 00081 #define CLOCK_CONFIG PRIPLL_8MHzCrystal_40MHzFCY 00082 #elif defined(EXPLORER16_100P) && defined(__PIC24F__) 00083 #define CLOCK_CONFIG PRIPLL_8MHzCrystal_16MHzFCY 00084 #elif defined(__PIC24H__) || defined(__DOXYGEN__) 00085 #define CLOCK_CONFIG FRCPLL_FCY40MHz 00086 #elif defined(__PIC24F__) 00087 #define CLOCK_CONFIG FRCPLL_FCY16MHz 00088 #else 00089 #error Unknown processor 00090 #endif 00091 #endif 00092 00094 00099 // Renaming this from pic24_defaults.h to pic24_libconfig.h 00100 // causes this to be reported by Doxygen as a recursive call 00101 // chain. Doxygen 1.5.6. See comments on CLOCK_CONFIG in this 00102 // file for a workaround. 00104 #ifndef DEBOUNCE_DLY 00105 #define DEBOUNCE_DLY 15 //in milliseconds 00106 #endif 00107 00109 00110 00111 // No relevant defines in pic24_dma.h 00112 // No relevant defines in pic24_ecan.h 00113 // No relevant defines in pic24_flash.h 00114 // No relevant defines in pic24_generic.h 00115 // No relevant defines in pic24_i2c.h 00116 // No relevant defines in pic24_ports.h 00117 00122 00123 #ifndef SERIAL_EOL_DEFAULT //can be overridden in project file 00124 #define SERIAL_EOL_DEFAULT SERIAL_EOL_LF 00125 #endif 00126 00128 #ifndef DEFAULT_UART 00129 #if defined(EXPLORER16_100P) 00130 #define DEFAULT_UART 2 00131 #else 00132 #define DEFAULT_UART 1 00133 #endif 00134 #endif 00135 00137 00138 // No relevant defines in pic24_spi.h 00139 // No relevant defines in pic24_timer.h 00140 00145 00146 #ifndef DEFAULT_BAUDRATE 00147 // For convenience, common baud rates (uncomment one): 00148 //#define DEFAULT_BAUDRATE 230400 00149 //#define DEFAULT_BAUDRATE 115200 00150 #define DEFAULT_BAUDRATE 57600 00151 //#define DEFAULT_BAUDRATE 38400 00152 //#define DEFAULT_BAUDRATE 19200 00153 //#define DEFAULT_BAUDRATE 9600 00154 #endif 00155 00157 #ifndef DEFAULT_BRGH 00158 #define DEFAULT_BRGH 0 00159 #endif 00160 00162 #ifndef DEFAULT_BAUDRATE1 00163 #define DEFAULT_BAUDRATE1 DEFAULT_BAUDRATE //defined in pic24_serial.h 00164 #endif 00165 00167 #ifndef DEFAULT_BRGH1 00168 #define DEFAULT_BRGH1 0 00169 #endif 00170 00171 00173 00174 // No relevant defines in pic24_timer.h 00175 00180 #ifndef USE_CLOCK_TIMEOUT 00181 #define USE_CLOCK_TIMEOUT 1 00182 #endif 00183 00184 #ifndef USE_HEARTBEAT 00186 #define USE_HEARTBEAT 1 00187 #endif 00188 00189 00190 00191 #ifndef HB_LED 00192 #if defined(EXPLORER16_100P) 00193 #define HB_LED _LATA7 00194 #define CONFIG_HB_LED() CONFIG_RA7_AS_DIG_OUTPUT() 00195 #else 00197 #define HB_LED _LATB15 00199 #define CONFIG_HB_LED() CONFIG_RB15_AS_DIG_OD_OUTPUT() 00200 #endif 00201 #endif // #ifndef HB_LED 00202 00204