Step 5: Build Project, Program MCU

Step 5.1: Specify the C Include Directories for the Compiler

The Include Directory paths are used by the C compiler to find files referenced through #include directives. This is the preferred method of referencing include files that are not at the root of your project directory, as opposed to using relative paths in code: #include "subdirectory/filename.h".

1

Right-click on the project and select Properties.

SelectProjectProperties.png

2

Click on Conf: [default] > XC16 > xc16-gcc.

3

Click on the drop-down for Option Categories and select Preprocessing and messages.

4

Click the C include dirs triple dot box.

Picture42.jpg

5

Browse for <your MPLAB X IDE project folder>. Add each highlighted directory and click Open. Click the Browse button to select the next directory. This directive permits files in these directories to be added to the build process.

Note: Directories can only be selected one-at-a-time.

Includefolders.png

6

The C include dirs window should be the same as the image below. Press OK to apply the changes.

IncludeDirectories.png

Step 5.2: Build Application

1

Right-click on the project and select Build.

BuildProject.png

2

The project will successfully build.

BuildSuccessful.png

Step 5.3: Program MCU

1

Click the Make and Program Device icon to program the MCU.

Programdevice.png

2

On the Starter Kit on Board tab, you will be able to see “Programming/Verify complete”.

ProgramVerify.png
© 2022 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.