.Changes From MPLAB

Combining Hex Files For Bootloader Projects etc In MPLAB you could export a specific memory areas only hex file from a bootloader project and then use this: Menu > Configure > Settings > Program Loading > 'Clear program memory uploading a program' to import it into the main project so the hex files became combined.  You […]

Read More

.MPLAB X Things to know

Watches Window There’s a button on the right of it that allows different column types to be shown so you can see multiple data types at once. If you’ve got a colum selected as the sort order it won’t allow you to drag the order of variables around. If you change the type of a […]

Read More

Configuration Bits, SFR’s, etc

  Menu > Window > PIC Memory Views > Configuration Bits Getting available config settings for a device Get the config fields from the "C:\Program Files (x86)\Microchip\MPASM Suite" .inc file for the device

Read More

Configuration of projects

Places where your project may be configured in MPLAB X Files or directories included in compiler preprocessing Right click project > Properties > Select the configuration you are using for your project > XC16 (Global Options) > xc16-gcc > Option categories: Preprocessing and message > C include dirs This is where the basic device config […]

Read More

Configurations (Build Configurations)

Selectively including files in different build configurations Add all of the files to your project. Configurations dropdown (“default” plus any new ones you create) > Customize… File Inclusion/Exclusion Now select each Configuration and exclude the files you don’t want in that configuration.

Read More

Debug / Release Modes

MPLAB allows you to use this macro: __DEBUG to detect if a debug or release mode is selected. It is not built in into MPLAB X and will be automatically set when compiling for a debugger. To forcibly enable it you can also just add this to a global header file when debugging: #ifndef __DEBUG […]

Read More

Debugger / Programmer

Right click the project > Properties   Window > Project Environment   Debugger is only connected once you start a debug session  

Read More

Defines

Microchip define examples #ifdef __DEBUG //Debug mode selected in MPLAB #if defined(__18CXX) #elif defined(__C30__) #elif defined (__PIC32MX__) #else #endif #ifndef __DEBUG #if (defined(__18CXX) & !defined(PIC18F87J50_PIM)) #endif #if defined(PIC18F87J50_PIM) || defined(PIC18F46J50_PIM) #if defined(__PIC24FJ256GB110__) #if defined(__18F46J50)   Is This Microcontoller In Use #if defined( __PIC24FJ256GB106__ ) #if defined(__PIC24FJ256GB110__) || defined(__PIC24FJ256GB106__) || defined(__PIC24FJ256GA110__) || defined(__PIC24FJ256GB210__)   Handy UART Setup Example #define […]

Read More

Files

Selectively including files in project build configurations See here.

Read More