6.3.5.4 Create a Primary Project

How to Create a Primary Project - Video (NO AUDIO)

Now create the Primary core project (unless you have already done so in 6.3.5.2 Create a Secondary Project. If you have, then proceed to add a main file.)

For ways to open the New Project wizard, see 5.1.1 Launch New Project Wizard.

The wizard will launch to guide you through new project set up. Click Next to move to the next step.

  • Step 1. Choose Project. Select the Microchip Embedded category and choose Application Project.
  • Step 2. Select Device (and Tool). Select the primary device, e.g., PIC32CX2051MTSH128, and then select your debug tool.
  • Steps 3 and 4. These steps are skipped for the selected devices.
  • Step 5. Select Compiler. Select the compiler and compiler version you will be using to develop your application from the list, i.e., XC32 v4.21.
  • Step 6. Select Project Name and Folder. Select a name and location for your new project. You may browse to a location. Click Finish when done. The new project will open in the Projects window.

To add a main file to the project:

  • In the Projects window under the Primary project, right click on the Source Files folder and select New > C Main File.
  • In the wizard, name the main file, e.g., primary.c, and click Finish. The new file will open in an Editor tab.

To use example code:

  • Click in the file window, press the CTRL+A keys and then Delete to remove the contents of this file.
  • Copy and paste example code found in the topic 6.3.5.8 PIC32CXMTSH Example Code.
    Note: Although already provided in the example, for your own code you must provide an _on_reset() function.