42 #if defined(THIS_IS_MAIN_FILE)
43 #if defined(__PIC24FJ256GB110__)
45 #if !defined(CONFIGURATION_FUSES_SET)
46 #define CONFIGURATION_FUSES_SET
49 #define DEBUG_ON 0x77FF
50 #define DEBUG_OFF 0x7FFF
59 _CONFIG1(JTAGEN_OFF & GCP_OFF & GWRP_OFF & ICS_PGx2 & FWDTEN_OFF)
69 _CONFIG2(IESO_OFF & PLLDIV_NODIV & FNOSC_PRIPLL & FCKSM_CSDCMD & OSCIOFNC_ON & IOL1WAY_OFF & DISUVREG_OFF & POSCMOD_EC)
73 _CONFIG3(WPCFG_WPCFGDIS & WPDIS_WPDIS)
76 #error "Not configured for valid CPU"
78 #endif // Prevent more than one set of config fuse definitions
81 #if !defined(CLOCK_FREQ)
82 #define CLOCK_FREQ (32000000ul)
83 #define GetSystemClock() (32000000ul) // Hz
84 #define GetInstructionClock() (GetSystemClock()/2)
85 #define GetPeripheralClock() GetInstructionClock()
99 #define PIN_SYSLED _RB6
100 #define LAT_SYSLED _LATB6
101 #define DIR_SYSLED _TRISB6
102 #define PULLUP_SYSLED _CN24PUE
103 #define PULLDOWN_SYSLED _CN24PDE
110 #define ADC_REF_MV 2500 //ADC External Reference in MV
114 #define ADC_MAX_CHAN_BRD 14
116 #define ADC_CHANNEL_MASK_LOW_BRD 0b1100111100111111 //AN0-AN5, AN8-AN11, AN14-AN15
117 #define ADC_CHANNEL_MASK_HIGH_BRD 0 //Only has 16 ADC channels
136 #define ADC_CH_AN10 8
137 #define ADC_CH_AN11 9
138 #define ADC_CH_AN12 10
139 #define ADC_CH_AN13 11
140 #define ADC_CH_AN14 12
141 #define ADC_CH_AN15 13
142 #define ADC_CH_AN16 14
143 #define ADC_CH_AN19 15
144 #define ADC_CH_AN20 16
145 #define ADC_CH_AN21 17
146 #define ADC_CH_AN22 18
148 #define ADC_OPEN_AN0 0x0001 //AN0
149 #define ADC_OPEN_AN1 0x0002 //AN1
150 #define ADC_OPEN_AN2 0x0004 //AN2
151 #define ADC_OPEN_AN3 0x0008 //AN3
152 #define ADC_OPEN_AN4 0x0010 //AN4
153 #define ADC_OPEN_AN5 0x0020 //AN5
154 #define ADC_OPEN_AN8 0x0100 //AN8
155 #define ADC_OPEN_AN9 0x0200 //AN9
156 #define ADC_OPEN_AN10 0x0400 //AN10
157 #define ADC_OPEN_AN11 0x0800 //AN11
158 #define ADC_OPEN_AN12 0x1000 //AN12
159 #define ADC_OPEN_AN13 0x2000 //AN13
160 #define ADC_OPEN_AN14 0x4000 //AN14
161 #define ADC_OPEN_AN15 0x8000 //AN15
193 #define SPI_FLASH_SECTOR_SIZE (4096ul)
195 #define SPI_FLASH_PAGE_SIZE (256ul) // Winbond FLASH has 256 byte pages
196 #define SPI_FLASH_SIZE (0x400000ul) // Flash is 4MByte
224 #define USB_BUS_SENSE U1OTGSTATbits.SESVD
231 #define XEEPROM_SIZE (8192) //Default EEPROM is 25LC640 = 64kBits = 8kBytes)
232 #define XEEPROM_PAGE_SIZE (32)