1

To detect a single MCU with XC16 we can use the defines such as __dsPIC33EP128MC202__, but what are the defines for a family such as dsPIC33E?

When googeling I find references to __PIC24F__ etc, but none of them are defined within XC16. I can't find any define related to a whole family, only specific MCU:s.

I know I can add my own define to the project, but that would involve the human factor, remembering to set/update it correctly on each project. I figured if __PIC24F__ is defined in a XC compiler, then XC16 would logically have the same system.

Mike
  • 4,041
  • 6
  • 20
  • 37
Max Kielland
  • 5,627
  • 9
  • 60
  • 95

1 Answers1

1
#if defined(__dsPIC33E__)

works for me. In a central header file I Have this :

#if defined(__dsPIC33F__)
#include "p33fxxxx.h"
#elif defined(__dsPIC33E__)
#include "p33exxxx.h"
#elif defined(__PIC24F__)
#include "p24fxxxx.h"
#endif

I think I got this from Microchips MLA libraries. I assume there is also a -H. I do work with dspic33C, but that is a different codebase/repo since the peripherals are generally different

Marco van de Voort
  • 25,628
  • 5
  • 56
  • 89