PIC24 Support Libraries
pic24_chip.h
Go to the documentation of this file.
1 /*
2  * "Copyright (c) 2008 Robert B. Reese, Bryan A. Jones, J. W. Bruce ("AUTHORS")"
3  * All rights reserved.
4  * (R. Reese, reese_AT_ece.msstate.edu, Mississippi State University)
5  * (B. A. Jones, bjones_AT_ece.msstate.edu, Mississippi State University)
6  * (J. W. Bruce, jwbruce_AT_ece.msstate.edu, Mississippi State University)
7  *
8  * Permission to use, copy, modify, and distribute this software and its
9  * documentation for any purpose, without fee, and without written agreement is
10  * hereby granted, provided that the above copyright notice, the following
11  * two paragraphs and the authors appear in all copies of this software.
12  *
13  * IN NO EVENT SHALL THE "AUTHORS" BE LIABLE TO ANY PARTY FOR
14  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
15  * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE "AUTHORS"
16  * HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
17  *
18  * THE "AUTHORS" SPECIFICALLY DISCLAIMS ANY WARRANTIES,
19  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
20  * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
21  * ON AN "AS IS" BASIS, AND THE "AUTHORS" HAS NO OBLIGATION TO
22  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS."
23  *
24  * Please maintain this header in its entirety when copying/modifying
25  * these files.
26  *
27  *
28  */
29 
30 
31 // Documentation for this file. If the \file tag isn't present,
32 // this file won't be documented.
33 /** \file
34  * This header file includes the correct
35  * processor-specific include file. It also provides
36  * additional processor-specific information, such as
37  * the device ID, revision IDs, and the number of various
38  * peripherals.
39  */
40 
41 #pragma once
42 
43 // Include processor-specific header file
44 #include <xc.h>
45 
46 #ifdef _ISR
47 #undef _ISR
48 /// Override the standard Microchip ISR definition, since it produces the
49 /// following warning:
50 /// warning: PSV model not specified for '_DefaultInterrupt';
51 /// assuming 'auto_psv' this may affect latency
52 /// This definition adds the auto_psv specifier, which produces
53 /// a bit of extra code but allow accessing constant data
54 /// (data stored in program memory).
55 #define _ISR __attribute__((interrupt)) __attribute__ ((auto_psv))
56 #endif
57 
58 #ifdef _ISRFAST
59 #undef _ISRFAST
60 /// Unlike \ref _ISR, this definition does not allow the ISR to access
61 /// constant data (data stored in program memory). This saves some
62 /// clock cycles. Unlike the Microchip definition, it does NOT use
63 /// shadow registers as well.
64 #define _ISRFAST __attribute__((interrupt)) __attribute__ ((no_auto_psv))
65 #endif
66 
67 
68 /// Place the processor in sleep mode.
69 #define SLEEP() Sleep()
70 
71 /// Place the processor in idle mode.
72 #define IDLE() Idle()
73 
74 /// Clear the watch-dog timer.
75 #define CLRWDT() ClrWdt()
76 
77 /// Insert a one-cycle nop instruction.
78 #define NOP() Nop()
79 
80 /// Enable the watchdog timer.
81 #define ENABLEWDT() (_SWDTEN = 1)
82 
83 /// Disable the watchdog timer.
84 #define DISABLEWDT() (_SWDTEN = 0)
85 
86 /// \name Peripheral identification
87 //@{
88 /** Define the number of UART modules supported by this chip.
89  * NOTE: this only works when testing \#defines, not
90  * testing variable. So, don't test UxSTA; instead,
91  * test _UxRXIF which is uniquely defined for each
92  * UART. (Idea taken from the C30 peripheral library,
93  * in uart.h.)
94  */
95 #if defined(_U4RXIF)
96 # define NUM_UART_MODS 4
97 #elif defined(_U3RXIF)
98 # define NUM_UART_MODS 3
99 #elif defined(_U2RXIF)
100 # define NUM_UART_MODS 2
101 #elif defined(_U1RXIF) || defined(__DOXYGEN__)
102 # define NUM_UART_MODS 1
103 #else
104 # error "UxRXIF flag not defined!"
105 #endif
106 
107 /** Define the number of I2C modules supported by this chip.
108  * See \ref NUM_UART_MODS for details on this methodology.
109  */
110 #if defined(_SI2C2IF)
111 # define NUM_I2C_MODS 2
112 #elif defined(_SI2C1IF) || defined(__DOXYGEN__)
113 # define NUM_I2C_MODS 1
114 #else
115 # error "SI2CxIF flag not defined!"
116 #endif
117 
118 /** Define the number of SPI modules supported by this chip.
119  * See \ref NUM_UART_MODS for details on this methodology.
120  */
121 #if defined(_SPI2IF)
122 # define NUM_SPI_MODS 2
123 #elif defined(_SPI1IF) || defined(__DOXYGEN__)
124 # define NUM_SPI_MODS 1
125 #else
126 # error "SPIxIF flag not defined!"
127 #endif
128 
129 /** Define the number of ECAN modules supported by this chip.
130  * See \ref NUM_UART_MODS for details on this methodology.
131  */
132 #if defined(_C2IF)
133 # define NUM_ECAN_MODS 2
134 #elif defined(_C1IF) || defined(__DOXYGEN__)
135 # define NUM_ECAN_MODS 1
136 #else
137 # define NUM_ECAN_MODS 0
138 #endif
139 //@}
140 
141 
142 
143 /** \name Chip identification
144  * These routines assist in identifying the device and revision
145  * of the PIC in use. See checkDeviceAndRevision() for a usage
146  * example.
147  */
148 //@{
149 /** The location in program memory of the device ID.
150  * Revision information is found in the Silicon Errata
151  * sheet for the device. The Device ID is contained
152  * in the datasheet for the target device.
153  */
154 #define DEV_ID_LOCATION 0xFF0000
155 /** The location in program memory of the revision. */
156 #define REVISION_LOCATION 0xFF0002
157 
158 
159 #if defined(__PIC24HJ12GP201__) || defined(__DOXYGEN__)
160 /** The device ID for this chip, located in program memory
161  * at \ref DEV_ID_LOCATION.
162  */
163 #define DEV_ID 0x00080a
164 /** A string to identify this chip, printed by
165  * checkDeviceAndRevision().
166  */
167 #define DEV_ID_STR "PIC24HJ12GP201"
168 /** A revision for this device, located in program memory
169  * at \ref REVISION_LOCATION. Additional revisions
170  * can be defined as EXPECTED_REVISIONn, where n = 1..5.
171  */
172 #define EXPECTED_REVISION1 0x003001
173 /** A string to accompany this revision, printed by
174  * checkDeviceAndRevision(). Additional revision strings
175  * can be defined as EXPECTED_REVISIONn, where n = 1..5.
176  */
177 #define EXPECTED_REVISION1_STR "A2"
178 
179 #define EXPECTED_REVISION2 0x003002
180 #define EXPECTED_REVISION2_STR "A3"
181 #define EXPECTED_REVISION3 0x003003
182 #define EXPECTED_REVISION3_STR "A4"
183 #endif
184 
185 #ifdef __PIC24HJ12GP202__
186 #define DEV_ID 0x00080B
187 #define DEV_ID_STR "PIC24HJ12GP202"
188 #define EXPECTED_REVISION1 0x003001
189 #define EXPECTED_REVISION1_STR "A2"
190 #define EXPECTED_REVISION2 0x003002
191 #define EXPECTED_REVISION2_STR "A3"
192 #define EXPECTED_REVISION3 0x003003
193 #define EXPECTED_REVISION3_STR "A4"
194 #endif
195 
196 
197 
198 /* PIC24H32GP202/204,PIC24HJ16GP304 */
199 
200 #ifdef __PIC24HJ16GP304__
201 #define DEV_ID 0x000F17
202 #define DEV_ID_STR "PIC24HJ16GP304"
203 #endif
204 
205 #ifdef __PIC24HJ32GP202__
206 #define DEV_ID 0x000F1D
207 #define DEV_ID_STR "PIC24HJ32GP202"
208 #endif
209 
210 #ifdef __PIC24HJ32GP204__
211 #define DEV_ID 0x000F1F
212 #define DEV_ID_STR "PIC24HJ32GP204"
213 #endif
214 
215 #if (defined(__PIC24HJ16GP304__) || defined(__PIC24HJ32GP202__) || defined(__PIC24HJ32GP204__))
216 #define EXPECTED_REVISION1 0x003001
217 #define EXPECTED_REVISION1_STR "A2"
218 #define EXPECTED_REVISION2 0x003002
219 #define EXPECTED_REVISION2_STR "A3"
220 #define EXPECTED_REVISION3 0x003004
221 #define EXPECTED_REVISION3_STR "A4"
222 #define EXPECTED_REVISION4 0x003005
223 #define EXPECTED_REVISION4_STR "A5"
224 #define EXPECTED_REVISION5 0x003006
225 #define EXPECTED_REVISION5_STR "A6"
226 #endif
227 
228 /* PIC24H32GP302/304, PIC24HJGPX02/X04, PIC24HJ128GPX02/X04 */
229 
230 #ifdef __PIC24HJ32GP302__
231 #define DEV_ID 0x000645
232 #define DEV_ID_STR "PIC24HJ32GP302"
233 #endif
234 
235 #ifdef __PIC24HJ32GP304__
236 #define DEV_ID 0x000647
237 #define DEV_ID_STR "PIC24HJ32GP304"
238 #endif
239 
240 #ifdef __PIC24HJ64GP202__
241 #define DEV_ID 0x000655
242 #define DEV_ID_STR "PIC24HJ64GP202"
243 #endif
244 
245 #ifdef __PIC24HJ64GP204__
246 #define DEV_ID 0x000657
247 #define DEV_ID_STR "PIC24HJ64GP204"
248 #endif
249 
250 #ifdef __PIC24HJ64GP502__
251 #define DEV_ID 0x000675
252 #define DEV_ID_STR "PIC24HJ64GP502"
253 #endif
254 
255 #ifdef __PIC24HJ64GP504__
256 #define DEV_ID 0x000677
257 #define DEV_ID_STR "PIC24HJ64GP504"
258 #endif
259 
260 #ifdef __PIC24HJ128GP202__
261 #define DEV_ID 0x000665
262 #define DEV_ID_STR "PIC24HJ128GP202"
263 #endif
264 
265 
266 #ifdef __PIC24HJ128GP204__
267 #define DEV_ID 0x000667
268 #define DEV_ID_STR "PIC24HJ128GP204"
269 #endif
270 
271 #ifdef __PIC24HJ128GP502__
272 #define DEV_ID 0x00067d
273 #define DEV_ID_STR "PIC24HJ128GP502"
274 #endif
275 
276 #ifdef __PIC24HJ128GP504__
277 #define DEV_ID 0x00067f
278 #define DEV_ID_STR "PIC24HJ128GP504"
279 #endif
280 
281 #if (defined(__PIC24HJ128GP504__) || defined(__PIC24HJ128GP502__)\
282 || defined(__PIC24HJ128GP204__) || defined(__PIC24HJ128GP202__)\
283 || defined(__PIC24HJ64GP504__) || defined(__PIC24HJ64GP502__)\
284 || defined(__PIC24HJ64GP204__) || defined(__PIC24HJ64GP202__)\
285 || defined(__PIC24HJ32GP304__) || defined(__PIC24HJ32GP302__))
286 #define EXPECTED_REVISION1 0x003001
287 #define EXPECTED_REVISION1_STR "A1"
288 #define EXPECTED_REVISION2 0x003002
289 #define EXPECTED_REVISION2_STR "A2"
290 #define EXPECTED_REVISION3 0x003003
291 #define EXPECTED_REVISION3_STR "A3"
292 #endif
293 
294 
295 /* PIC24HJXXXGPX06/X08/X10 */
296 
297 #if (defined(__PIC24HJ64GP206__) || defined(__PIC24HJ64GP206A__))
298 #define DEV_ID 0x000041
299 #define DEV_ID_STR "PIC24HJ64GP206"
300 #endif
301 
302 #if (defined(__PIC24HJ64GP210__) || defined(__PIC24HJ64GP210A__))
303 #define DEV_ID 0x000047
304 #define DEV_ID_STR "PIC24HJ64GP210"
305 #endif
306 
307 #if (defined(__PIC24HJ64GP506__) || defined(__PIC24HJ64GP506A__))
308 #define DEV_ID 0x000049
309 #define DEV_ID_STR "PIC24HJ64GP506"
310 #endif
311 
312 #if (defined(__PIC24HJ64GP510__) || defined(__PIC24HJ64GP510A__))
313 #define DEV_ID 0x00004B
314 #define DEV_ID_STR "PIC24HJ64GP510"
315 #endif
316 
317 #if (defined(__PIC24HJ128GP206__) || defined(__PIC24HJ128GP206A__))
318 #define DEV_ID 0x00005D
319 #define DEV_ID_STR "PIC24HJ128GP206"
320 #endif
321 
322 #if (defined(__PIC24HJ128GP210__) || defined(__PIC24HJ128GP210A__))
323 #define DEV_ID 0x00005F
324 #define DEV_ID_STR "PIC24HJ128GP210"
325 #endif
326 
327 #if (defined(__PIC24HJ128GP306__) || defined(__PIC24HJ128GP306A__))
328 #define DEV_ID 0x000065
329 #define DEV_ID_STR "PIC24HJ128GP306"
330 #endif
331 
332 #if (defined(__PIC24HJ128GP310__) || defined(__PIC24HJ128GP310A__))
333 #define DEV_ID 0x000067
334 #define DEV_ID_STR "PIC24HJ128GP310"
335 #endif
336 
337 
338 #if defined(__PIC24HJ128GP506__) || defined(__PIC24HJ128GP506A__)
339 #define DEV_ID 0x000061
340 #define DEV_ID_STR "PIC24HJ128GP506/506A"
341 #endif
342 
343 #if (defined(__PIC24HJ128GP510__) || defined(__PIC24HJ128GP510A__))
344 #define DEV_ID 0x000063
345 #define DEV_ID_STR "PIC24HJ128GP510"
346 #endif
347 
348 #if (defined(__PIC24HJ256GP206__) )
349 #define DEV_ID 0x000071
350 #define DEV_ID_STR "PIC24HJ256GP206"
351 #endif
352 
353 #ifdef __PIC24HJ256GP210__
354 #define DEV_ID 0x000073
355 #define DEV_ID_STR "PIC24HJ256GP210"
356 #endif
357 
358 
359 #ifdef __PIC24HJ256GP610__
360 #define DEV_ID 0x00007B
361 #define DEV_ID_STR "PIC24HJ256GP610"
362 #endif
363 
364 #if (defined(__PIC24HJ64GP206__) || defined(__PIC24HJ64GP210__) || defined(__PIC24HJ64GP506__) || defined(__PIC24HJ64GP510__)\
365 || defined(__PIC24HJ128GP206__) || defined(__PIC24HJ128GP210__) || defined(__PIC24HJ128GP306__)\
366 || defined(__PIC24HJ128GP310__) || defined(__PIC24HJ128GP506__)|| defined(__PIC24HJ128GP510__)\
367 || defined(__PIC24HJ256GP206__) || defined(__PIC24HJ256GP210__)|| defined(__PIC24HJ256GP610__))
368 
369 #define EXPECTED_REVISION1 0x003002
370 #define EXPECTED_REVISION1_STR "A2"
371 #define EXPECTED_REVISION2 0x003004
372 #define EXPECTED_REVISION2_STR "A3"
373 #define EXPECTED_REVISION3 0x003040
374 #define EXPECTED_REVISION3_STR "A4"
375 #endif
376 
377 #if (defined(__PIC24HJ64GP206A__) || defined(__PIC24HJ64GP210A__) || defined(__PIC24HJ64GP506A__) || defined(__PIC24HJ64GP510A__)\
378 || defined(__PIC24HJ128GP206A__) || defined(__PIC24HJ128GP210A__) || defined(__PIC24HJ128GP306A__)\
379 || defined(__PIC24HJ128GP310A__) || defined(__PIC24HJ128GP506A__)|| defined(__PIC24HJ128GP510A__)\
380 || defined(__PIC24HJ256GP206A__) || defined(__PIC24HJ256GP210A__)|| defined(__PIC24HJ256GP610A__))
381 #define EXPECTED_REVISION1 0x003009
382 #define EXPECTED_REVISION1_STR "A3"
383 #define EXPECTED_REVISION2 0x00300A
384 #define EXPECTED_REVISION2_STR "A4"
385 #define EXPECTED_REVISION3 0x00300B
386 #define EXPECTED_REVISION3_STR "A5"
387 #endif
388 
389 //24F Family
390 
391 /* PIC24FJ128GA010 Family */
392 
393 #ifdef __PIC24FJ128GA010__
394 #define DEV_ID 0x00040D
395 #define DEV_ID_STR "PIC24FJ128GA010"
396 #endif
397 
398 #ifdef __PIC24FJ96GA010__
399 #define DEV_ID 0x00040C
400 #define DEV_ID_STR "PIC24FJ96GA010"
401 #endif
402 
403 #ifdef __PIC24FJ64GA010__
404 #define DEV_ID 0x00040B
405 #define DEV_ID_STR "PIC24FJ64GA010"
406 #endif
407 
408 #ifdef __PIC24FJ128GA008__
409 #define DEV_ID 0x00040A
410 #define DEV_ID_STR "PIC24FJ128GA008"
411 #endif
412 
413 #ifdef __PIC24FJ96GA008__
414 #define DEV_ID 0x000409
415 #define DEV_ID_STR "PIC24FJ96GA008"
416 #endif
417 
418 #ifdef __PIC24FJ64GA008__
419 #define DEV_ID 0x000408
420 #define DEV_ID_STR "PIC24FJ64GA008"
421 #endif
422 
423 #ifdef __PIC24FJ128GA006__
424 #define DEV_ID 0x000407
425 #define DEV_ID_STR "PIC24FJ128GA006"
426 #endif
427 
428 #ifdef __PIC24FJ96GA006__
429 #define DEV_ID 0x000409
430 #define DEV_ID_STR "PIC24FJ96GA006"
431 #endif
432 
433 #ifdef __PIC24FJ64GA006__
434 #define DEV_ID 0x000408
435 #define DEV_ID_STR "PIC24FJ64GA006"
436 #endif
437 
438 #if (defined(__PIC24FJ128GA010__) || defined(__PIC24FJ96GA010__) || defined(__PIC24FJ64GA010__)\
439 || defined(__PIC24FJ128GA008__) || defined(__PIC24FJ96GA008__) || defined(__PIC24FJ64GA008__)\
440 || defined(__PIC24FJ128GA006__) || defined(__PIC24FJ96GA006__) || defined(__PIC24FJ64GA006__))
441 #define EXPECTED_REVISION1 0x003002
442 #define EXPECTED_REVISION1_STR "A2"
443 #define EXPECTED_REVISION2 0x003003
444 #define EXPECTED_REVISION2_STR "A3"
445 #define EXPECTED_REVISION3 0x003007
446 #define EXPECTED_REVISION3_STR "A4"
447 #define EXPECTED_REVISION4 0x003043
448 #define EXPECTED_REVISION4_STR "C1"
449 #define EXPECTED_REVISION5 0x003044
450 #define EXPECTED_REVISION5_STR "C2"
451 #endif
452 
453 
454 
455 //PIC24FJ64GA104 Family
456 #ifdef __PIC24FJ32GA102__
457 #define DEV_ID 0x004202
458 #define DEV_ID_STR "PIC24FJ32GA102"
459 #endif
460 #ifdef __PIC24FJ32GA104__
461 #define DEV_ID 0x00420A
462 #define DEV_ID_STR "PIC24FJ32GA104"
463 #endif
464 #ifdef __PIC24FJ64GA102__
465 #define DEV_ID 0x004206
466 #define DEV_ID_STR "PIC24FJ64GA102"
467 #endif
468 #ifdef __PIC24FJ64GA104__
469 #define DEV_ID 0x00420E
470 #define DEV_ID_STR "PIC24FJ64GA104"
471 #endif
472 
473 
474 #if (defined(__PIC24FJ32GA102__) || defined(__PIC24FJ32GA104__)\
475 || defined(__PIC24FJ64GA102__) || defined(__PIC24FJ64GA104__))
476 #define EXPECTED_REVISION1 0x000002
477 #define EXPECTED_REVISION1_STR "A2"
478 #endif
479 
480 
481 //PIC24FJXXGA002 (28 pin),PIC24FJXXGA004 (44 pin)
482 #ifdef __PIC24FJ16GA002__
483 #define DEV_ID 0x000444
484 #define DEV_ID_STR "PIC24FJ16GA002"
485 #endif
486 
487 #ifdef __PIC24FJ32GA002__
488 #define DEV_ID 0x000445
489 #define DEV_ID_STR "PIC24FJ32GA002"
490 #endif
491 
492 #ifdef __PIC24FJ48GA002__
493 #define DEV_ID 0x000446
494 #define DEV_ID_STR "PIC24FJ48GA002"
495 #endif
496 
497 #ifdef __PIC24FJ64GA002__
498 #define DEV_ID 0x000447
499 #define DEV_ID_STR "PIC24FJ64GA002"
500 #endif
501 
502 #ifdef __PIC24FJ16GA004__
503 #define DEV_ID 0x00044C
504 #define DEV_ID_STR "PIC24FJ16GA004"
505 #endif
506 
507 #ifdef __PIC24FJ32GA004__
508 #define DEV_ID 0x00044D
509 #define DEV_ID_STR "PIC24FJ32GA004"
510 #endif
511 
512 #ifdef __PIC24FJ48GA004__
513 #define DEV_ID 0x00044E
514 #define DEV_ID_STR "PIC24FJ48GA004"
515 #endif
516 
517 #ifdef __PIC24FJ64GA004__
518 #define DEV_ID 0x00044F
519 #define DEV_ID_STR "PIC24FJ64GA004"
520 #endif
521 
522 #if (defined(__PIC24FJ64GA004__) || defined(__PIC24FJ48GA004__) || defined(__PIC24FJ32GA004__) || defined(__PIC24FJ16GA004__)\
523 || defined(__PIC24FJ64GA002__) || defined(__PIC24FJ48GA002__) || defined(__PIC24FJ32GA002__) || defined(__PIC24FJ16GA002__))
524 
525 #define EXPECTED_REVISION1 0x003003
526 #define EXPECTED_REVISION1_STR "A3/A4"
527 #define EXPECTED_REVISION2 0x003042
528 #define EXPECTED_REVISION2_STR "B4"
529 #define EXPECTED_REVISION3 0x003043
530 #define EXPECTED_REVISION3_STR "B5"
531 #define EXPECTED_REVISION4 0x003046
532 #define EXPECTED_REVISION4_STR "B8"
533 #endif
534 
535 
536 /* GA110, GA108,GA106 Family */
537 
538 
539 #ifdef __PIC24FJ256GA110__
540 #define DEV_ID 0x00101E
541 #define DEV_ID_STR "PIC24FJ256GA110"
542 #endif
543 
544 #ifdef __PIC24FJ192GA110__
545 #define DEV_ID 0x001016
546 #define DEV_ID_STR "PIC24FJ192GA110"
547 #endif
548 
549 #ifdef __PIC24FJ128GA110__
550 #define DEV_ID 0x00100E
551 #define DEV_ID_STR "PIC24FJ128GA110"
552 #endif
553 
554 #ifdef __PIC24FJ256GA108__
555 #define DEV_ID 0x00101A
556 #define DEV_ID_STR "PIC24FJ256GA108"
557 #endif
558 
559 #ifdef __PIC24FJ192GA108__
560 #define DEV_ID 0x001012
561 #define DEV_ID_STR "PIC24FJ192GA108"
562 #endif
563 
564 #ifdef __PIC24FJ128GA108__
565 #define DEV_ID 0x00100A
566 #define DEV_ID_STR "PIC24FJ128GA108"
567 #endif
568 
569 #ifdef __PIC24FJ256GA106__
570 #define DEV_ID 0x001018
571 #define DEV_ID_STR "PIC24FJ256GA106"
572 #endif
573 
574 #ifdef __PIC24FJ192GA106__
575 #define DEV_ID 0x001010
576 #define DEV_ID_STR "PIC24FJ192GA106"
577 #endif
578 
579 #ifdef __PIC24FJ128GA106__
580 #define DEV_ID 0x001008
581 #define DEV_ID_STR "PIC24FJ128GA106"
582 #endif
583 
584 #if (defined(__PIC24FJ256GA110__) || defined(__PIC24FJ192GA110__) || defined(__PIC24FJ128GA110__)\
585 || defined(__PIC24FJ256GA108__) || defined(__PIC24FJ192GA108__) || defined(__PIC24FJ128GA108__)\
586 || defined(__PIC24FJ256GA106__) || defined(__PIC24FJ192GA106__) || defined(__PIC24FJ128GA106__))
587 
588 #define EXPECTED_REVISION1 0x003001
589 #define EXPECTED_REVISION1_STR "A3"
590 #define EXPECTED_REVISION2 0x003003
591 #define EXPECTED_REVISION2_STR "A5"
592 #endif
593 
594 /***** PIC24F K ****/
595 
596 #ifdef __PIC24F04KA200__
597 #define DEV_ID 0x000D02
598 #define DEV_ID_STR "PIC24F04KA200"
599 #endif
600 
601 #ifdef __PIC24F04KA201__
602 #define DEV_ID 0x000D00
603 #define DEV_ID_STR "PIC24F04KA201"
604 #endif
605 
606 #if (defined(__PIC24F04KA200__) || defined(__PIC24F04KA201__) )
607 #define EXPECTED_REVISION1 0x000001
608 #define EXPECTED_REVISION1_STR "A1"
609 #endif
610 
611 
612 #ifdef __PIC24F08KA101__
613 #define DEV_ID 0x000D08
614 #define DEV_ID_STR "PIC24F08KA101"
615 #endif
616 
617 #ifdef __PIC24F08KA102__
618 #define DEV_ID 0x000D0A
619 #define DEV_ID_STR "PIC24F08KA102"
620 #endif
621 
622 #ifdef __PIC24F16KA101__
623 #define DEV_ID 0x000D01
624 #define DEV_ID_STR "PIC24F16KA101"
625 #endif
626 
627 #ifdef __PIC24F16KA102__
628 #define DEV_ID 0x000D03
629 #define DEV_ID_STR "PIC24F16KA102"
630 #endif
631 
632 #if (defined(__PIC24F08KA101__) || defined(__PIC24F08KA102__) || defined(__PIC24F16KA101__)\
633 || defined(__PIC24F16KA102__))
634 
635 #define EXPECTED_REVISION1 0x000005
636 #define EXPECTED_REVISION1_STR "A5"
637 #define EXPECTED_REVISION2 0x000006
638 #define EXPECTED_REVISION2_STR "A6"
639 #endif
640 
641 
642 #ifdef __PIC24F32KA304__
643 #define DEV_ID 0x004516
644 #define DEV_ID_STR "PIC24F32KA304"
645 #endif
646 
647 #ifdef __PIC24F32KA302__
648 #define DEV_ID 0x004512
649 #define DEV_ID_STR "PIC24F32KA302"
650 #endif
651 
652 #ifdef __PIC24F32KA301__
653 #define DEV_ID 0x004518
654 #define DEV_ID_STR "PIC24F32KA301"
655 #endif
656 
657 #ifdef __PIC24F16KA304__
658 #define DEV_ID 0x004506
659 #define DEV_ID_STR "PIC24F16KA304"
660 #endif
661 
662 #ifdef __PIC24F16KA302__
663 #define DEV_ID 0x004502
664 #define DEV_ID_STR "PIC24F16KA302"
665 #endif
666 
667 #ifdef __PIC24F16KA301__
668 #define DEV_ID 0x004508
669 #define DEV_ID_STR "PIC24F16KA301"
670 #endif
671 
672 #ifdef __PIC24FV32KA304__
673 #define DEV_ID 0x004517
674 #define DEV_ID_STR "PIC24FV32KA304"
675 #endif
676 
677 #ifdef __PIC24FV32KA302__
678 #define DEV_ID 0x004513
679 #define DEV_ID_STR "PIC24FV32KA302"
680 #endif
681 
682 #ifdef __PIC24FV32KA301__
683 #define DEV_ID 0x004519
684 #define DEV_ID_STR "PIC24FV32KA301"
685 #endif
686 
687 #ifdef __PIC24FV16KA304__
688 #define DEV_ID 0x004507
689 #define DEV_ID_STR "PIC24FV16KA304"
690 #endif
691 
692 #ifdef __PIC24FV16KA302__
693 #define DEV_ID 0x004503
694 #define DEV_ID_STR "PIC24FV16KA302"
695 #endif
696 
697 #ifdef __PIC24FV16KA301__
698 #define DEV_ID 0x004509
699 #define DEV_ID_STR "PIC24FV16KA301"
700 #endif
701 
702 #if defined(__PIC24F32KA304__) || defined(__PIC24F32KA302__) || defined(__PIC24F32KA301__) || defined(__PIC24F16KA304__)|| defined(__PIC24F16KA302__)|| defined(__PIC24F16KA301__) || defined(__PIC24FV32KA304__) || defined(__PIC24FV32KA302__) || defined(__PIC24FV32KA301__) || defined(__PIC24FV16KA304__) || defined(__PIC24FV16KA302__) || defined(__PIC24FV16KA301__)
703 #define EXPECTED_REVISION1 0x000004
704 #define EXPECTED_REVISION1_STR "A4"
705 #define EXPECTED_REVISION2 0x000006
706 #define EXPECTED_REVISION2_STR "A6"
707 #endif
708 
709 
710 
711 /***** PIC24F GB ****/
712 
713 #ifdef __PIC24FJ256GB110__
714 #define DEV_ID 0x00101F
715 #define DEV_ID_STR "PIC24FJ256GB110"
716 #endif
717 
718 #ifdef __PIC24FJ192GB110__
719 #define DEV_ID 0x001017
720 #define DEV_ID_STR "PIC24FJ192GB110"
721 #endif
722 
723 #ifdef __PIC24FJ128GB110__
724 #define DEV_ID 0x00100F
725 #define DEV_ID_STR "PIC24FJ128GB110"
726 #endif
727 
728 #ifdef __PIC24FJ64GB110__
729 #define DEV_ID 0x001007
730 #define DEV_ID_STR "PIC24FJ64GB110"
731 #endif
732 
733 #ifdef __PIC24FJ256GB108__
734 #define DEV_ID 0x00101B
735 #define DEV_ID_STR "PIC24FJ256GB108"
736 #endif
737 
738 #ifdef __PIC24FJ192GB108__
739 #define DEV_ID 0x001013
740 #define DEV_ID_STR "PIC24FJ192GB108"
741 #endif
742 
743 #ifdef __PIC24FJ128GB108__
744 #define DEV_ID 0x00100B
745 #define DEV_ID_STR "PIC24FJ128GB108"
746 #endif
747 
748 #ifdef __PIC24FJ64GB108__
749 #define DEV_ID 0x001003
750 #define DEV_ID_STR "PIC24FJ64GB108"
751 #endif
752 
753 #ifdef __PIC24FJ256GB106__
754 #define DEV_ID 0x001018
755 #define DEV_ID_STR "PIC24FJ256GB106"
756 #define EXPECTED_REVISION1 0x000001
757 #define EXPECTED_REVISION1_STR "A3"
758 #endif
759 
760 #ifdef __PIC24FJ192GB106__
761 #define DEV_ID 0x001010
762 #define DEV_ID_STR "PIC24FJ192GB106"
763 #endif
764 
765 #ifdef __PIC24FJ128GB106__
766 #define DEV_ID 0x001008
767 #define DEV_ID_STR "PIC24FJ128GB106"
768 #endif
769 
770 #ifdef __PIC24FJ64GB106__
771 #define DEV_ID 0x001001
772 #define DEV_ID_STR "PIC24FJ64GB106"
773 #endif
774 
775 #ifdef __PIC24FJ32GB002__
776 #define DEV_ID 0x004203
777 #define DEV_ID_STR "PIC24FJ32GB002"
778 #endif
779 
780 #ifdef __PIC24FJ32GB004__
781 #define DEV_ID 0x00420B
782 #define DEV_ID_STR "PIC24FJ32GB004"
783 #endif
784 
785 #ifdef __PIC24FJ64GB002__
786 #define DEV_ID 0x004207
787 #define DEV_ID_STR "PIC24FJ64GB002"
788 #endif
789 
790 #ifdef __PIC24FJ64GB004__
791 #define DEV_ID 0x00420F
792 #define DEV_ID_STR "PIC24FJ64GB004"
793 #endif
794 
795 #if (defined(__PIC24FJ32GB002__) || defined(__PIC24FJ32GB004__) || defined(__PIC24FJ64GB002__) || defined(__PIC24FJ64GB004__))
796 #define EXPECTED_REVISION1 0x000002
797 #define EXPECTED_REVISION1_STR "A2"
798 #endif
799 
800 
801 #if (defined(__PIC24FJ256GB110__) || defined(__PIC24FJ192GB110__) || defined(__PIC24FJ128GB110__) || defined(__PIC24FJ64GB110__)\
802 || defined(__PIC24FJ256GB108__) || defined(__PIC24FJ192GB108__) || defined(__PIC24FJ128GB108__) || defined(__PIC24FJ64GB108__)\
803 || defined(__PIC24FJ256GB106__) || defined(__PIC24FJ192GB106__) || defined(__PIC24FJ128GB106__) || defined(__PIC24FJ64GB106__))
804 
805 #define EXPECTED_REVISION1 0x003001
806 #define EXPECTED_REVISION1_STR "A3"
807 #define EXPECTED_REVISION2 0x003003
808 #define EXPECTED_REVISION2_STR "A5"
809 #endif
810 
811 //dsPIC33 CPUS
812 
813 //dsPIC33FJ12GP201, dsPIC33FJ12GP202
814 #ifdef __dsPIC33FJ12GP201__
815 #define DEV_ID 0x000802
816 #define DEV_ID_STR "dsPIC33FJ12GP201"
817 #endif
818 
819 #ifdef __dsPIC33FJ12GP202__
820 #define DEV_ID 0x000803
821 #define DEV_ID_STR "dsPIC33FJ12GP202"
822 #endif
823 
824 #if (defined(__dsPIC33FJ12GP201__) || defined(__dsPIC33FJ12GP202__))
825 #define EXPECTED_REVISION1 0x003001
826 #define EXPECTED_REVISION1_STR "A2"
827 #define EXPECTED_REVISION2 0x003002
828 #define EXPECTED_REVISION2_STR "A3"
829 #define EXPECTED_REVISION3 0x003004
830 #define EXPECTED_REVISION3_STR "A4"
831 #endif
832 
833 //dsPIC33FJ32GP202/04,dsPIC33FJ16GP304
834 
835 #ifdef __dsPIC33FJ32GP202__
836 #define DEV_ID 0x000F0D
837 #define DEV_ID_STR "dsPIC24FJ32GP202"
838 #endif
839 
840 #ifdef __dsPIC33FJ32GP204__
841 #define DEV_ID 0x000F0F
842 #define DEV_ID_STR "dsPIC33FJ32GP204"
843 #endif
844 
845 #ifdef __dsPIC33FJ16GP304__
846 #define DEV_ID 0x000F07
847 #define DEV_ID_STR "dsPIC33FJ16GP304"
848 #endif
849 
850 #if (defined(__dsPIC33FJ32GP202__) || defined(__dsPIC33FJ32GP204___) || defined(__dsPIC33FJ16GP304__))
851 #define EXPECTED_REVISION1 0x003001
852 #define EXPECTED_REVISION1_STR "A2"
853 #define EXPECTED_REVISION2 0x003002
854 #define EXPECTED_REVISION2_STR "A3"
855 #define EXPECTED_REVISION3 0x003004
856 #define EXPECTED_REVISION3_STR "A4"
857 #endif
858 
859 //dsPIC33FJ32GP302/304,dsPIC33FJ64GPX02/X04,dsPIC33FJ128GPX02,X04
860 
861 #ifdef __dsPIC33FJ32GP302__
862 #define DEV_ID 0x000605
863 #define DEV_ID_STR "dsPIC33FJ32GP302"
864 #endif
865 
866 #ifdef __dsPIC33FJ32GP304__
867 #define DEV_ID 0x000607
868 #define DEV_ID_STR "dsPIC33FJ32GP304"
869 #endif
870 
871 #ifdef __dsPIC33FJ64GP202__
872 #define DEV_ID 0x000615
873 #define DEV_ID_STR "dsPIC33FJ64GP202"
874 #endif
875 
876 #ifdef __dsPIC33FJ64GP204__
877 #define DEV_ID 0x000617
878 #define DEV_ID_STR "dsPIC33FJ64GP204"
879 #endif
880 
881 #ifdef __dsPIC33FJ64GP802__
882 #define DEV_ID 0x00061d
883 #define DEV_ID_STR "dsPIC33FJ64GP802"
884 #endif
885 
886 #ifdef __dsPIC33FJ64GP804__
887 #define DEV_ID 0x00061f
888 #define DEV_ID_STR "dsPIC33FJ64GP804"
889 #endif
890 
891 #ifdef __dsPIC33FJ128GP202__
892 #define DEV_ID 0x000625
893 #define DEV_ID_STR "dsPIC33FJ128GP202"
894 #endif
895 
896 
897 #ifdef __dsPIC33FJ128GP204__
898 #define DEV_ID 0x000627
899 #define DEV_ID_STR "dsPIC33FJ128GP204"
900 #endif
901 
902 #ifdef __dsPIC33FJ128GP802__
903 #define DEV_ID 0x00062d
904 #define DEV_ID_STR "dsPIC33FJ128GP802"
905 #endif
906 
907 #ifdef __dsPIC33FJ128GP804__
908 #define DEV_ID 0x00062f
909 #define DEV_ID_STR "dsPIC33FJ128GP804"
910 #endif
911 
912 #if (defined(__dsPIC33FJ128GP804__) || defined(__dsPIC33FJ128GP802__)\
913 || defined(__dsPIC33FJ128GP204__) || defined(__dsPIC33FJ128GP202__)\
914 || defined(__dsPIC33FJ64GP804__) || defined(__dsPIC33FJ64GP802__)\
915 || defined(__dsPIC33FJ64GP204__) || defined(__dsPIC33FJ64GP202__)\
916 || defined(__dsPIC33FJ32GP304__) || defined(__dsPIC33FJ32GP302__))
917 #define EXPECTED_REVISION1 0x003001
918 #define EXPECTED_REVISION1_STR "A1"
919 #define EXPECTED_REVISION2 0x003002
920 #define EXPECTED_REVISION2_STR "A2"
921 #define EXPECTED_REVISION3 0x003003
922 #define EXPECTED_REVISION3_STR "A3"
923 #endif
924 
925 /* PIC24E/dsPIC33E Families */
926 
927 //64K devices
928 #ifdef __PIC24EP64GP202__
929 #define DEV_ID 0x001D39
930 #define DEV_ID_STR "PIC24EP64GP202"
931 #define EXPECTED_REVISION1 0x004002
932 #define EXPECTED_REVISION1_STR "A2"
933 #endif
934 
935 #ifdef __PIC24EP64GP203__
936 #define DEV_ID 0x001D3A
937 #define DEV_ID_STR "PIC24EP64GP203"
938 #define EXPECTED_REVISION1 0x004002
939 #define EXPECTED_REVISION1_STR "A2"
940 #endif
941 
942 #ifdef __PIC24EP64GP204__
943 #define DEV_ID 0x001D38
944 #define DEV_ID_STR "PIC24EP64GP204"
945 #define EXPECTED_REVISION1 0x004002
946 #define EXPECTED_REVISION1_STR "A2"
947 #endif
948 
949 #ifdef __PIC24EP64GP206__
950 #define DEV_ID 0x001D3B
951 #define DEV_ID_STR "PIC24EP64GP206"
952 #define EXPECTED_REVISION1 0x004002
953 #define EXPECTED_REVISION1_STR "A2"
954 #endif
955 
956 #ifdef __dsPIC33EP64GP502__
957 #define DEV_ID 0x001D2D
958 #define DEV_ID_STR "dsPIC33EP64GP502"
959 #define EXPECTED_REVISION1 0x004002
960 #define EXPECTED_REVISION1_STR "A2"
961 #endif
962 
963 #ifdef __dsPIC33EP64GP503__
964 #define DEV_ID 0x001D2E
965 #define DEV_ID_STR "dsPIC33EP64GP503"
966 #define EXPECTED_REVISION1 0x004002
967 #define EXPECTED_REVISION1_STR "A2"
968 #endif
969 
970 #ifdef __dsPIC33EP64GP504__
971 #define DEV_ID 0x001D2C
972 #define DEV_ID_STR "dsPIC33EP64GP504"
973 #define EXPECTED_REVISION1 0x004002
974 #define EXPECTED_REVISION1_STR "A2"
975 #endif
976 
977 #ifdef __dsPIC33EP64GP506__
978 #define DEV_ID 0x001D2F
979 #define DEV_ID_STR "dsPIC33EP64GP506"
980 #define EXPECTED_REVISION1 0x004002
981 #define EXPECTED_REVISION1_STR "A2"
982 #endif
983 
984 #ifdef __PIC24EP64MC202__
985 #define DEV_ID 0x001D31
986 #define DEV_ID_STR "PIC24EP64MC202"
987 #define EXPECTED_REVISION1 0x004002
988 #define EXPECTED_REVISION1_STR "A2"
989 #endif
990 
991 #ifdef __PIC24EP64MC203__
992 #define DEV_ID 0x001D32
993 #define DEV_ID_STR "PIC24EP64MC203"
994 #define EXPECTED_REVISION1 0x004002
995 #define EXPECTED_REVISION1_STR "A2"
996 #endif
997 
998 #ifdef __PIC24EP64MC204__
999 #define DEV_ID 0x001D30
1000 #define DEV_ID_STR "PIC24EP64MC204"
1001 #define EXPECTED_REVISION1 0x004002
1002 #define EXPECTED_REVISION1_STR "A2"
1003 #endif
1004 
1005 #ifdef __PIC24EP64MC206__
1006 #define DEV_ID 0x001D33
1007 #define DEV_ID_STR "PIC24EP64MC206"
1008 #define EXPECTED_REVISION1 0x004002
1009 #define EXPECTED_REVISION1_STR "A2"
1010 #endif
1011 
1012 #ifdef __dsPIC33EP64MC202__
1013 #define DEV_ID 0x001D21
1014 #define DEV_ID_STR "dsPIC33EP64MC202"
1015 #define EXPECTED_REVISION1 0x004002
1016 #define EXPECTED_REVISION1_STR "A2"
1017 #endif
1018 
1019 #ifdef __dsPIC33EP64MC203__
1020 #define DEV_ID 0x001D22
1021 #define DEV_ID_STR "dsPIC33EP64MC203"
1022 #define EXPECTED_REVISION1 0x004002
1023 #define EXPECTED_REVISION1_STR "A2"
1024 #endif
1025 
1026 #ifdef __dsPIC33EP64MC204__
1027 #define DEV_ID 0x001D20
1028 #define DEV_ID_STR "dsPIC33EP64MC204"
1029 #define EXPECTED_REVISION1 0x004002
1030 #define EXPECTED_REVISION1_STR "A2"
1031 #endif
1032 
1033 #ifdef __dsPIC33EP64MC206__
1034 #define DEV_ID 0x001D23
1035 #define DEV_ID_STR "dsPIC33EP64MC206"
1036 #define EXPECTED_REVISION1 0x004002
1037 #define EXPECTED_REVISION1_STR "A2"
1038 #endif
1039 
1040 #ifdef __dsPIC33EP64MC502__
1041 #define DEV_ID 0x001D25
1042 #define DEV_ID_STR "dsPIC33EP64MC502"
1043 #define EXPECTED_REVISION1 0x004002
1044 #define EXPECTED_REVISION1_STR "A2"
1045 #endif
1046 
1047 #ifdef __dsPIC33EP64MC503__
1048 #define DEV_ID 0x001D26
1049 #define DEV_ID_STR "dsPIC33EP64MC503"
1050 #define EXPECTED_REVISION1 0x004002
1051 #define EXPECTED_REVISION1_STR "A2"
1052 #endif
1053 
1054 #ifdef __dsPIC33EP64MC504__
1055 #define DEV_ID 0x001D24
1056 #define DEV_ID_STR "dsPIC33EP64MC504"
1057 #define EXPECTED_REVISION1 0x004002
1058 #define EXPECTED_REVISION1_STR "A2"
1059 #endif
1060 
1061 #ifdef __dsPIC33EP64MC506__
1062 #define DEV_ID 0x001D27
1063 #define DEV_ID_STR "dsPIC33EP64MC506"
1064 #define EXPECTED_REVISION1 0x004002
1065 #define EXPECTED_REVISION1_STR "A2"
1066 #endif
1067 
1068 //128K devices
1069 #ifdef __dsPIC33EP128GP504__
1070 #define DEV_ID 0x001E4C
1071 #define DEV_ID_STR "dsPIC33EP128GP504"
1072 #define EXPECTED_REVISION1 0x004003
1073 #define EXPECTED_REVISION1_STR "A3"
1074 #endif
1075 
1076 
1077 //256K devices
1078 #ifdef __PIC24EP256GU810__
1079 #define DEV_ID 0x001826
1080 #define DEV_ID_STR "PIC24EP256GU810"
1081 #define EXPECTED_REVISION1 0x004002
1082 #define EXPECTED_REVISION1_STR "B1"
1083 #endif
1084 
1085 #ifdef __PIC24EP256GU814__
1086 #define DEV_ID 0x001827
1087 #define DEV_ID_STR "PIC24EP256GU814"
1088 #define EXPECTED_REVISION1 0x004002
1089 #define EXPECTED_REVISION1_STR "B1"
1090 #endif
1091 
1092 #ifdef __dsPIC33EP256MU806__
1093 #define DEV_ID 0x001861
1094 #define DEV_ID_STR "dsPIC33EP256MU806"
1095 #define EXPECTED_REVISION1 0x004002
1096 #define EXPECTED_REVISION1_STR "B1"
1097 #endif
1098 
1099 #ifdef __dsPIC33EP256MU810__
1100 #define DEV_ID 0x001862
1101 #define DEV_ID_STR "dsPIC33EP256MU810"
1102 #define EXPECTED_REVISION1 0x004002
1103 #define EXPECTED_REVISION1_STR "B1"
1104 #endif
1105 
1106 #ifdef __dsPIC33EP256MU814__
1107 #define DEV_ID 0x001863
1108 #define DEV_ID_STR "dsPIC33EP256MU814"
1109 #define EXPECTED_REVISION1 0x004002
1110 #define EXPECTED_REVISION1_STR "B1"
1111 #endif
1112 
1113 //512K Devices
1114 
1115 #ifdef __dsPIC33EP512MU810__
1116 #define DEV_ID 0x001872
1117 #define DEV_ID_STR "dsPIC33EP512MU810"
1118 #define EXPECTED_REVISION1 0x004002
1119 #define EXPECTED_REVISION1_STR "B1"
1120 #endif
1121 
1122 #ifdef __dsPIC33EP512MU814__
1123 #define DEV_ID 0x001873
1124 #define DEV_ID_STR "dsPIC33EP512MU814"
1125 #define EXPECTED_REVISION1 0x004002
1126 #define EXPECTED_REVISION1_STR "B1"
1127 #endif
1128 
1129 #ifdef __dsPIC33EP512GP806__
1130 #define DEV_ID 0x00187D
1131 #define DEV_ID_STR "dsPIC33EP512GP806"
1132 #define EXPECTED_REVISION1 0x004002
1133 #define EXPECTED_REVISION1_STR "B1"
1134 #endif
1135 
1136 #ifdef __dsPIC33EP512MC806__
1137 #define DEV_ID 0x001879
1138 #define DEV_ID_STR "dsPIC33EP512MC806"
1139 #define EXPECTED_REVISION1 0x004002
1140 #define EXPECTED_REVISION1_STR "B1"
1141 #endif
1142 
1143 #ifdef __PIC24EP512GU810__
1144 #define DEV_ID 0x001836
1145 #define DEV_ID_STR "PIC24EP512GU810"
1146 #define EXPECTED_REVISION1 0x004002
1147 #define EXPECTED_REVISION1_STR "B1"
1148 #endif
1149 
1150 #ifdef __PIC24EP512GU814__
1151 #define DEV_ID 0x001837
1152 #define DEV_ID_STR "PIC24EP512GU814"
1153 #define EXPECTED_REVISION1 0x004002
1154 #define EXPECTED_REVISION1_STR "B1"
1155 #endif
1156 
1157 #ifdef __PIC24EP512GP806__
1158 #define DEV_ID 0x00183D
1159 #define DEV_ID_STR "PIC24EP512GP806"
1160 #define EXPECTED_REVISION1 0x004002
1161 #define EXPECTED_REVISION1_STR "B1"
1162 #endif
1163 
1164 #ifdef __dsPIC33EP128GP502__
1165 #define DEV_ID 0x001E4D
1166 #define DEV_ID_STR "dsPIC33EP128GP502"
1167 #define EXPECTED_REVISION1 0x004003
1168 #define EXPECTED_REVISION1_STR "A3"
1169 #endif
1170 
1171 #ifdef __PIC24FJ128GB204__
1172 #define DEV_ID 0x004C5B
1173 #define DEV_STR "PIC24FJ128GB204"
1174 #define EXPECTED_REVISION1 0x000004
1175 #define EXPECTED_REVISION1_STR "B3"
1176 #endif
1177 
1178 #ifdef __PIC24FJ128GB202__
1179 #define DEV_ID 0x004C5A
1180 #define DEV_STR "PIC24FJ128GB202"
1181 #define EXPECTED_REVISION1 0x000004
1182 #define EXPECTED_REVISION1_STR "B3"
1183 #endif
1184 
1185 #ifdef __PIC24FJ64GB204__
1186 #define DEV_ID 0x004C59
1187 #define DEV_STR "PIC24FJ64GB204"
1188 #define EXPECTED_REVISION1 0x000004
1189 #define EXPECTED_REVISION1_STR "B3"
1190 #endif
1191 
1192 #ifdef __PIC24FJ64GB202__
1193 #define DEV_ID 0x004C58
1194 #define DEV_STR "PIC24FJ64GB202"
1195 #define EXPECTED_REVISION1 0x000004
1196 #define EXPECTED_REVISION1_STR "B3"
1197 #endif
1198 
1199 #ifdef __PIC24FJ64GA704__
1200 #define DEV_ID 0x007505
1201 #define DEV_STR "PIC24FJ64GA704"
1202 #define EXPECTED_REVISION1 0x000003
1203 #define EXPECTED_REVISION1_STR "A3"
1204 #endif
1205 
1206 #ifdef __PIC24FJ64GA702__
1207 #define DEV_ID 0x007506
1208 #define DEV_STR "PIC24FJ64GA702"
1209 #define EXPECTED_REVISION1 0x000003
1210 #define EXPECTED_REVISION1_STR "A3"
1211 #endif
1212 
1213 #ifdef __PIC24FJ64GA705__
1214 #define DEV_ID 0x007507
1215 #define DEV_STR "PIC24FJ64GA705"
1216 #define EXPECTED_REVISION1 0x000003
1217 #define EXPECTED_REVISION1_STR "A3"
1218 #endif
1219 
1220 #ifdef __PIC24FJ128GA704__
1221 #define DEV_ID 0x007509
1222 #define DEV_STR "PIC24FJ128GA704"
1223 #define EXPECTED_REVISION1 0x000003
1224 #define EXPECTED_REVISION1_STR "A3"
1225 #endif
1226 
1227 #ifdef __PIC24FJ128GA702__
1228 #define DEV_ID 0x00750A
1229 #define DEV_STR "PIC24FJ128GA702"
1230 #define EXPECTED_REVISION1 0x000003
1231 #define EXPECTED_REVISION1_STR "A3"
1232 #endif
1233 
1234 #ifdef __PIC24FJ128GA705__
1235 #define DEV_ID 0x00750B
1236 #define DEV_STR "PIC24FJ128GA705"
1237 #define EXPECTED_REVISION1 0x000003
1238 #define EXPECTED_REVISION1_STR "A3"
1239 #endif
1240 
1241 #ifdef __PIC24FJ256GA704__
1242 #define DEV_ID 0x00750D
1243 #define DEV_STR "PIC24FJ256GA704"
1244 #define EXPECTED_REVISION1 0x000003
1245 #define EXPECTED_REVISION1_STR "A3"
1246 #endif
1247 
1248 #ifdef __PIC24FJ256GA702__
1249 #define DEV_ID 0x00750E
1250 #define DEV_STR "PIC24FJ256GA702"
1251 #define EXPECTED_REVISION1 0x000003
1252 #define EXPECTED_REVISION1_STR "A3"
1253 #endif
1254 
1255 #ifdef __PIC24FJ256GA705__
1256 #define DEV_ID 0x00750F
1257 #define DEV_STR "PIC24FJ256GA705"
1258 #define EXPECTED_REVISION1 0x000003
1259 #define EXPECTED_REVISION1_STR "A3"
1260 #endif
1261 
1262 
1263 /* Use these default device ID and revision values
1264  if you are trying to discover the ID/Revision by
1265  executing code on your target device and watching
1266  was is printed by the printResetCause() function.
1267 */
1268 #ifndef DEV_ID
1269 #define DEV_ID 0
1270 #define DEV_ID_STR "unknown"
1271 #define EXPECTED_REVISION1 0
1272 #define EXPECTED_REVISION1_STR "unknown"
1273 #warning "*********************************************"
1274 #warning "* Unknown chip type! Define a device ID and *"
1275 #warning "* revision ID in the lines above for this *"
1276 #warning "* chip to remove this warning message. *"
1277 #warning "* These values can be found by *"
1278 #warning "* executing the checkDeviceAndRevision() *"
1279 #warning "* function, which is typically called after *"
1280 #warning "* reset via calling printResetCause(). *"
1281 #warning "* This check allows you to ensure that the *"
1282 #warning "* programmed hex file is running on the *"
1283 #warning "* same device type it was compiled for. *"
1284 #warning "* This is only a warning. *"
1285 #warning "*********************************************"
1286 #endif
1287 
1288 //@}